How to find primary key?

From: Randall J. Parr <RParr_at_TemporalArts.COM>
Date: Sun, 19 Mar 2000 08:32:43 -0600
Message-ID: <38D4E50B.1D5A641_at_TemporalArts.COM>



[Quoted] I am trying to impliment a load using JDBC wherein I read the table name, some column names, and associated column data from a file (delimited or XML). The primary key columns are in the column names / data BUT I don't know which columns they are (based on the file I'm reading). Even if this information was in the file, I would need to verify the table I'm targeting does in fact have that primary key. I can insert the records fine BUT to use the records to update I need to determine from the database which are the primary key columns (by name).

Essentially I'm trying to do the following:

{

    insert record into table

    if fails because of duplicate primary key     {

[Quoted]         determine the primary key of the current table

        retrieve the already existing record

        modify the retrieved record using my load data

        update the already existing record in the database

    }

}

[Quoted] My primary concern, now, is Oracle although I'm hoping to impliment this in as portable a fashion as possible.

Thanks.
R.Parr
TemporalArts
608.833.4578 Received on Sun Mar 19 2000 - 15:32:43 CET

Original text of this message