Re: Oracle SQL help.

From: Lee Miller <lpm_at_newsguy.com>
Date: Thu, 24 May 2001 08:11:23 -0400
Message-ID: <9eitna013on_at_enews3.newsguy.com>


If you are creating the entry in your keys_table then you already have the key number. Assuming that it is as you say a function that is creating it and not a stored procedure. If it is a stored procedure then look at doing a udf instead and populate your keys_table from it and store the value for later usage at the same time.

Alternately use a sequence, select the next value from the sequence into a variable create your entry in keys_table from that and hold on to the variable for later usage.

(PS this sounds more like a web programming question than a database question)

"Josh" <netfall_at_yahoo.com> wrote in message news:9092672b.0105240337.11142b92_at_posting.google.com...
> I'm trying to create a website using Oracle to place retail orders.
> When I choose a customer to create an order for, I want to create a
> blank order and then return the number for that order (which is
> automatically created) back in a recordset, so that I can go to a
> subsequent page and add items to that order (items are in a separate
> table and have a foreign_key to the orders table).
> I can automatically create the key for the orders table (which will
> serve as order number, created using a stored function and a
> keys_table), but I can't figure out how to return that Key number in a
> recordset. I know I could just select the last key from the
> keys_table, but if there are multiple users and netlag at all, that's
> going to throw things off.
>
> Any suggestions? I'm even open to a completely new way of processing
> this!
>
> Thanks for any help!
>
> Josh
Received on Thu May 24 2001 - 14:11:23 CEST

Original text of this message