Subject | Re: [firebird-support] Re: Problem with integer |
---|---|
Author | ShofB |
Post date | 2005-11-02T04:18:45Z |
No triggers and no events registered. I am calling this stored procedure from c# using the Firebird .net interface. The exact error message is
"validation error for column STORAGEID, value \"*** null ***\"" string
The code calling the stored procedure is
FbCommand cmd = new FbCommand("ADDDIRECTORY", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@ID",ids[(int)FileTypes.Other]++);
cmd.Parameters.Add("@PATH", path);
cmd.Parameters.Add("@STORAGEID",0);
Obviously Firebird knows 0 is not null on an integer.
"validation error for column STORAGEID, value \"*** null ***\"" string
The code calling the stored procedure is
FbCommand cmd = new FbCommand("ADDDIRECTORY", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@ID",ids[(int)FileTypes.Other]++);
cmd.Parameters.Add("@PATH", path);
cmd.Parameters.Add("@STORAGEID",0);
Obviously Firebird knows 0 is not null on an integer.
----- Original Message -----
From: Adam
To: firebird-support@yahoogroups.com
Sent: Tuesday, November 01, 2005 7:24 PM
Subject: [firebird-support] Re: Problem with integer
> * Table: DIRECTORIES, Owner: IBEASY */
>
> CREATE TABLE "DIRECTORIES"
> (
> "ID" INTEGER NOT NULL,
> "PATH" CHAR(255) NOT NULL,
> "STORAGEID" INTEGER NOT NULL,
> CONSTRAINT "RDB$PRIMARY8" PRIMARY KEY ("ID")
> );
>
> BEGIN
> INSERT INTO directories(
> id,path,storageid
> ) VALUES (
> :id,:path,:storageid
> );
Any insert triggers on directories?
They will fire at this point and may be doing something if so?
> SUSPEND;
>
> /* Notify listeners of insert */
> POST_EVENT 'insert_sptable1_ins';
Anything registered for this event that might be attempting to run a
query?
> END
>
> id,path and storageid are correctly defined.
I would disagree with that comment, IMO path should probably be a
varchar, path will pad with spaces. But that is not your issue here.
I can assure you that Firebird understands the difference between
NULL and 0 in an integer field. The begin is a snippet of I assume a
stored procedure. What program is calling this stored procedure?
Tip:
Use isql to run it. If it runs fine, then you know it is something in
the interface layer of the program you are using. If there is still a
problem, then look for the triggers.
If you still have problems, you need to place the exact error
message. It should tell you which field is null. But my money is on
an insert trigger.
Adam
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------------------------------------------------
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]