jfosorio Posted February 22, 2012 at 11:56 AM Report Share #440688 Posted February 22, 2012 at 11:56 AM Boas, Devo confessar que estou um pouco perturbado com este problema. Então não é que no mysql, um atributo pode ser actualizado com o valor NULL, apesar de estar definido como NOT NULL!!! Isto é de loucos! Ou o meu phpmyadmin está a bater mal, ou então o mysql ficou lerdinho! 😛 Será que alguém já se deparou com este problema e sabe como dar-lhe a volta? Já agora, estou a usar o storage engine InnoDB (caso seja útil a informação). CSS 3D Text - Partilha mensagens em 3D com os teus amigos no Facebook! Portal de Informática it4life - Emprego, notícias, fórum, comunidade. Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted February 22, 2012 at 12:12 PM Report Share #440690 Posted February 22, 2012 at 12:12 PM nop ... ao criar um SQL para actualizar uma coluna com o valor de NULL onde não deveria deixar retornou : 0 rows affected. ( Query took 0.0003 sec ) IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
yoda Posted February 22, 2012 at 01:21 PM Report Share #440699 Posted February 22, 2012 at 01:21 PM Isso aconteceu porque definiste o NULL como string e não como NULL, ou seja, o que tens é uma string no resultado. happens all the time before you post, what have you tried? - http://filipematias.info sense, purpose, direction Link to comment Share on other sites More sharing options...
Th3Alchemist Posted February 22, 2012 at 03:09 PM Report Share #440715 Posted February 22, 2012 at 03:09 PM Também de referir que "Null" != Null, mas creio que não seja esse o caso Edit: yoda ja disse isto Link to comment Share on other sites More sharing options...
jfosorio Posted February 24, 2012 at 04:35 PM Author Report Share #441033 Posted February 24, 2012 at 04:35 PM Sinceramente, não sei o que estou a fazer errado. O comando que estou a utilizar é o seguinte: UPDATE delegados SET nome_delegado = NULL WHERE id_delegado = 4; O campo nome_delegado está definido como not null. Mas quando executo este comando, o campo fica vazio. Nem sei o que vos diga... 😕 CSS 3D Text - Partilha mensagens em 3D com os teus amigos no Facebook! Portal de Informática it4life - Emprego, notícias, fórum, comunidade. Link to comment Share on other sites More sharing options...
brunoais Posted February 24, 2012 at 08:33 PM Report Share #441065 Posted February 24, 2012 at 08:33 PM Deixa-me adivinhar, fica com o valor que está definido como default e lança um aviso. Inserting NULL into a column that has been declared NOT NULL. For multiple-row INSERT statements or INSERT INTO ... SELECT statements, the column is set to the implicit default value for the column data type. This is 0 for numeric types, the empty string ('') for string types, and the “zero” value for date and time types. INSERT INTO ... SELECT statements are handled the same way as multiple-row inserts because the server does not examine the result set from the SELECT to see whether it returns a single row. (For a single-row INSERT, no warning occurs when NULL is inserted into a NOT NULL column. Instead, the statement fails with an error.) "[Os jovens da actual geração]não lêem porque não envolve um telecomando que dê para mirar e atirar, não falam porque a trapalhice é rainha e o calão é rei" autor: thoga31 Life is a genetically transmitted disease, induced by sex, with death rate of 100%. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now