Error -605 *** Value Null ***

Forum related to Firebird

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
sfxcc
Senior Boarder
Senior Boarder
Posts: 95
Joined: 13.05.2010, 18:48

Error -605 *** Value Null ***

Post by sfxcc »

ENDDATE is date and was created after the table being created and it allows nulls so it filled the colum with nulls automatic.

So i want to set ENDDATE then i do :

UPDATE MYTABLE
SET ENDDATE=CURRENT_DATE
WHERE MYID=1

Error -605 ???? ****value null****
This wasnt supposed to happen ? It should Set RowID MYID primarykey ENDDATE with th CURRENT_DATE .The problem yet is in the IBOConsole if i change it manualy it accepts it with no problem only Query and Zeos Problem with zeos does an error ? Querrinmg it With Update on IBO Error Tooo but on the IBO Grid doesnt.

I dont undestand wheres the problem.
where's the code ..
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

sfxcc,

are you sure this exeution fails?

Is it possible that your statement looks like:

Code: Select all

UPDATE MYTABLE
SET ENDDATE=:CURRENT_DATE
WHERE MYID=1 
In this case does the TZSQLQuery handle the function CURRENT_DATE as Parameter 'CURRENT_DATE' and if no value is assigned we prepare a NULL value on executing the statment.

On the other hand: No idea. Can you make a bugtemplate to reproduce this issue?
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
sfxcc
Senior Boarder
Senior Boarder
Posts: 95
Joined: 13.05.2010, 18:48

Post by sfxcc »

This only fails if we alter a table add a new column with null if we create new rows with null i works fine but it is a firebird way to work, so after we alter and set the new column to null we must change the value and then set it to null again.
where's the code ..
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Post by marsupilami »

Hello sfxcc,

maybe it helps to use the date literal 'TODAY'? See http://www.firebirdsql.org/en/firebird-date-literals/

So your query would look like this:
UPDATE MYTABLE
SET ENDDATE='TODAY'
WHERE MYID=1

What you say about altering the value of columns multiple times to get them right seems odd to me?
sfxcc
Senior Boarder
Senior Boarder
Posts: 95
Joined: 13.05.2010, 18:48

Post by sfxcc »

Yes is odd to me too but i spoke with firebird team and they said is like that.


so i solved the problem so im developing yet so i deleted all data from table and inserted again. Prob solved.
where's the code ..
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

sfxcc,

if guess Jan is rigtht. But i wanted to find out if Zeos makes trouble here. And i think this is the case but absolutely expected behavior.

Simply switch of ParamChecks of your Component like TZQuery.ParamsCheck := False;

If this is set Zeos doesn't assume :CURRENT_DATE is a Parameter with name 'CURRENT_DATE'. Zeos will execute the query like you expect it.

Btw. This is a common behavior for all SQL Database Components.
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Post Reply