MySQL Forums
Forum List  »  Spanish

MySq STRICT_TRANS_TABLES, No funciona
Posted by: esteban cuezzo
Date: June 05, 2020 09:09AM

Estoy usando Mysql vercion 5.1
al hacer **SHOW VARIABLES LIKE** 'sql_mode';
retorna esto
**STRICT_TRANS_TABLES**,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
entonces esta habilitado el Strict trans

una columna "stock_sal" esta como unsigned osea no debería recibir negativos
pero cuando hago un update stock_sal = stock_sal - 10;; suponiendo este en 9 no da error solo lo setea a cero ,,,, y necesito que me de un error, como en la teoría
podrían decirme por que o como lo puedo solucionar

/*Column Information*/
----------------------

Field Type Collation Null Key Default Extra Privileges Comment
---------------- ---------------- --------- ------ ------ ------- -------------- ------------------------------- -----------------
idStock int(10) unsigned (NULL) NO PRI (NULL)
IdProductoST int(10) unsigned (NULL) NO UNI
stock_sal double unsigned (NULL) NO 0

Options: ReplyQuote


Subject
Views
Written By
Posted
MySq STRICT_TRANS_TABLES, No funciona
525
June 05, 2020 09:09AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.