Subject | INSERT ... SELECT with paramters problem |
---|---|
Author | achidan |
Post date | 2003-03-06T12:57:02Z |
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
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