At 01:50 PM 4/19/2006, Alan Wolfe wrote:
I was wondering if there was a way to where if you insert a
row into a table with an auto incremented column to get the
last id# inserted?
Alan,
Here's how:
Use the following technique right after
the insert command.
-- start
SET VAR vIDNo INTEGER = NULL
SELECT IDNo INTO vIDNo INDIC ivIDNo +
FROM tablename WHERE COUNT = INSERT
-- end
The variable vIDNo will be the last IDNo
based on your last successful insert.
That's all there is to it!
Very Best R:egards,
Razzak.
--- RBASE-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]
(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body,
place any
text to search for.
================================================