Subject | RE: [ib-support] Generator created PK in trigger: how to get that value? |
---|---|
Author | Alan McDonald |
Post date | 2002-08-12T22:39:14Z |
spvar = GEN_ID(GEN_ID, 1);
insert into thistable(PKID, field1) values(:spvar, value);
insert into othertable (FORIEGNID, field1) values (:spvar, value);
-----Original Message-----
From: Jaume Andreu Sabater Malondra [mailto:jsabater@...]
Sent: Tuesday, 13 August 2002 8:21
To: ib-support@yahoogroups.com
Subject: [ib-support] Generator created PK in trigger: how to get that
value?
Hi everyone.
I have got these tables: NEWS - NEWS_LANGUAGE - LANGUAGES, N-M
cardinality.
I want to insert a row in table NEWS, then multiple rows in table
NEWS_LANGUAGE using the primary key just created on NEWS as foreign key on
NEWS_LANGUAGE.
I have got a stored procedure, POST_NEWS, which first inserts in table
NEWS.
A trigger on event "before insert" raises and, using a generator, creates
an integer value which is used as primary key.
Now I would like to know how to get that "just created" value without
having
to launch a SELECT query after that INSERT.
Finally, using that integer value, I have to launch multiple INSERT
statements on table NEWS_LANGUAGE, which shouldn't give me any trouble if
a
owe the primary key integer value.
Thanks in advance.
--
Jaume Andreu Sabater Malondra
jsabater@...
Registered linux user #209072
"Ubi sapientas ibi libertas"
Yahoo! Groups Sponsor
ADVERTISEMENT
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]
insert into thistable(PKID, field1) values(:spvar, value);
insert into othertable (FORIEGNID, field1) values (:spvar, value);
-----Original Message-----
From: Jaume Andreu Sabater Malondra [mailto:jsabater@...]
Sent: Tuesday, 13 August 2002 8:21
To: ib-support@yahoogroups.com
Subject: [ib-support] Generator created PK in trigger: how to get that
value?
Hi everyone.
I have got these tables: NEWS - NEWS_LANGUAGE - LANGUAGES, N-M
cardinality.
I want to insert a row in table NEWS, then multiple rows in table
NEWS_LANGUAGE using the primary key just created on NEWS as foreign key on
NEWS_LANGUAGE.
I have got a stored procedure, POST_NEWS, which first inserts in table
NEWS.
A trigger on event "before insert" raises and, using a generator, creates
an integer value which is used as primary key.
Now I would like to know how to get that "just created" value without
having
to launch a SELECT query after that INSERT.
Finally, using that integer value, I have to launch multiple INSERT
statements on table NEWS_LANGUAGE, which shouldn't give me any trouble if
a
owe the primary key integer value.
Thanks in advance.
--
Jaume Andreu Sabater Malondra
jsabater@...
Registered linux user #209072
"Ubi sapientas ibi libertas"
Yahoo! Groups Sponsor
ADVERTISEMENT
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]