Subject Re: [IBO] INSERT ... SELECT with paramters problem
Author Jason Wharton
I use statements like this all the time and don't have any problems.
What does the SQL monitor reveal about what is happening?

Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com

-- We may not have it all together --
-- But together we have it all --


----- Original Message -----
From: "achidan" <ac.hi@...>
To: <IBObjects@yahoogroups.com>
Sent: Thursday, March 06, 2003 5:57 AM
Subject: [IBO] INSERT ... SELECT with paramters problem


> Hi!
>
> I have a problem with statements of the following type:
>
> INSERT INTO T1(T1_PK, T1_Fld1, T1_Fld2, T2_FK)
> SELECT :pT1_PK, :pT1_Fld1, 'Const', T2_FK
> FROM T2 WHERE T2_Fld = :pT2_Fld
>
> The statements executes without error but there is no insert.
> RowsAffected is zero. I'm using the TIB_DSQL-Component (but with
> TIB_Cursor the effect is the same).
>
> The statements works fine, if primary key of T1 is not a parameter, i.e.
>
> INSERT INTO T1(T1_PK, T1_Fld1, T1_Fld2, T2_FK)
> SELECT Gen_ID(IDGen, 1), :pT1_Fld1, 'Const', T2_FK
> FROM T2 WHERE T2_Fld = :pT2_Fld
>
> I'm using Delphi 6.0 update pack 2 with Firebird 1.0 and IBObjects 4.2.I.
>
> Anyone has an idea what could be the problem?
>
> Thank's
> Daniel