Subject | Re: [firebird-support] Problem with integer |
---|---|
Author | Helen Borrie |
Post date | 2005-11-02T00:58:09Z |
At 02:37 PM 1/11/2005 -0800, you wrote:
is that the value being written is coming from an input parameter that came
through as null when you expected it to be zero. Some programming
interface might do that.
Second guess is that you are reading a value returned by a [FOR]
SELECT...INTO construction, the column you are reading contains null and
your SP code has not catered for that possibility.
SELECT BLAH FROM ATABLE
WHERE KEYVALUE = :KEYVALUE
INTO :BLAH;
IF (BLAH IS NULL) THEN BLAH = 0;
INSERT INTO BTABLE (<various_things>, aInteger)
VALUES (<various_values>, :BLAH);
./heLen
>I have a stored procedure writing a record which contains severalNo. Firebird never converts 0 to null.
>integers. If I try and write 0 to one of the ints I get an error saying
>that is a null value. How can that be? Anyone every had this happen
>and what do I do about it?First guess (since, without the offending code, this has to be guesswork!)
is that the value being written is coming from an input parameter that came
through as null when you expected it to be zero. Some programming
interface might do that.
Second guess is that you are reading a value returned by a [FOR]
SELECT...INTO construction, the column you are reading contains null and
your SP code has not catered for that possibility.
SELECT BLAH FROM ATABLE
WHERE KEYVALUE = :KEYVALUE
INTO :BLAH;
IF (BLAH IS NULL) THEN BLAH = 0;
INSERT INTO BTABLE (<various_things>, aInteger)
VALUES (<various_values>, :BLAH);
./heLen