Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> How do I retrive newly added records?

How do I retrive newly added records?

From: Fredrik Öhrn <d96ohrn_at_ios.chalmers.se>
Date: Sat, 01 May 1999 12:51:54 GMT
Message-ID: <372af889.2552521@news.chalmers.se>

Hello!

I'm working on a java applet that adds records to an Oracle database.

To add a new record I use the following construct: statement.executeUpdate ("INSERT INTO mytable VALUES (0, myvalue1, myvalue2, ...)");

The catch is that the first 0 is a primary key column and the server automatically assigns a unique running number instead of the value I provide. How can I get hold of the server assigned primary key value? I need it to add records to other tables that has this key as a foreign key.

Any input is appreciated.

Regards,
Fredrik

--

        I don't see why there's a problem with computers thinking
        it's the year 1900. Computers weren't even invented in 1900.

Fredrik Öhrn                               Chalmers University of Technology
d96ohrn_at_ios.chalmers.se                                               Sweden
Received on Sat May 01 1999 - 07:51:54 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US