Subject Re: [firebird-support] Problem with integer
Author ShofB
Well, its strange. If I put 1 in it works, 0 complains about a null value
----- Original Message -----
From: Helen Borrie
To: firebird-support@yahoogroups.com
Sent: Tuesday, November 01, 2005 4:58 PM
Subject: Re: [firebird-support] Problem with integer


At 02:37 PM 1/11/2005 -0800, you wrote:
>I have a stored procedure writing a record which contains several
>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

No. Firebird never converts 0 to null.

>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




++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://firebird.sourceforge.net and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




SPONSORED LINKS Technical support Computer technical support Compaq computer technical support
Compaq technical support Microsoft technical support Dell computer technical support


------------------------------------------------------------------------------
YAHOO! GROUPS LINKS

a.. Visit your group "firebird-support" on the web.

b.. To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com

c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


------------------------------------------------------------------------------




------------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.12.7/153 - Release Date: 11/1/2005

----------

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.12.7/153 - Release Date: 11/1/2005


[Non-text portions of this message have been removed]