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 -> Re: distinguishing between different types of integrity constraint violations in ODBC

Re: distinguishing between different types of integrity constraint violations in ODBC

From: Jim Kennedy <kennedy-down_with_spammers_at_attbi.com>
Date: Sat, 04 Jan 2003 02:52:39 GMT
Message-ID: <X%rR9.619261$NH2.41308@sccrnsc01>


Yes. You will get back an error number. So a lot of people create a generic error handling routine and put the number and the message text there. Look in the docs for the error information. Jim

--
Replace part of the email address: kennedy-down_with_spammers_at_attbi.com
with family.  Remove the negative part, keep the minus sign.  You can figure
it out.
"Albert" <nothere_at_bigfoot.com> wrote in message
news:av4e9s$4kh$1_at_news5.svr.pol.co.uk...

> I have this table
>
> CREATE TABLE trn_test(
> trn_rpi number(8) not null,
> trn_name varchar2(32) not null,
> CONSTRAINT trn_primary_key PRIMARY KEY (trn_rpi),
> CONSTRAINT unq_trn_name UNIQUE(trn_name));
>
> I am using ODBC and C and when I insert I wish to be able to distinguish
an
> error due to a duplicate primary key to that of the unique constraint. Can
> this be done ?
>
> PS I know I can query first but I dont want to do this (speed
> considerations).
> Thanks.
>
>
Received on Fri Jan 03 2003 - 20:52:39 CST

Original text of this message

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