Subject | TIBOQuery insert with parameters |
---|---|
Author | mitch_landor |
Post date | 2006-12-08T05:02:32Z |
I have a simple query as below which has a PK "LOC_ID" and a mandatory
field "PVERSION_ID" which is an FK.
SELECT
LOC_ID,
PVERSION_ID,
NAME
FROM LOC
WHERE PVERSION_ID = :var_PVERSION_ID
I need the value for :var_PVERSION_ID to be automatically put into
PVERSION_ID during an insert. Here is the insert code:
INSERT INTO LOC(
LOC_ID, /*PK*/
PVERSION_ID,
NAME)
VALUES (
:LOC_ID,
:PVERSION_ID,
:NAME)
Should this work OK when I test it by manually preparing it, then
entering a parameter, opening the returned records in the TIBO
component and inserting a row manually?
I thought I had this working before, but now it doesn't seem to. Can't
figure out why. I keep getting an error that PVERSION_ID must have a
value.
Any help would be appreciated.
Thanks
Mitch
field "PVERSION_ID" which is an FK.
SELECT
LOC_ID,
PVERSION_ID,
NAME
FROM LOC
WHERE PVERSION_ID = :var_PVERSION_ID
I need the value for :var_PVERSION_ID to be automatically put into
PVERSION_ID during an insert. Here is the insert code:
INSERT INTO LOC(
LOC_ID, /*PK*/
PVERSION_ID,
NAME)
VALUES (
:LOC_ID,
:PVERSION_ID,
:NAME)
Should this work OK when I test it by manually preparing it, then
entering a parameter, opening the returned records in the TIBO
component and inserting a row manually?
I thought I had this working before, but now it doesn't seem to. Can't
figure out why. I keep getting an error that PVERSION_ID must have a
value.
Any help would be appreciated.
Thanks
Mitch