X-Original-To: pgsql-odbc@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id E32294762D7 for ; Tue, 1 Apr 2003 09:49:08 -0500 (EST) Received: from paiol.terra.com.br (paiol.terra.com.br [200.176.3.18]) by postgresql.org (Postfix) with ESMTP id EC1AB476237 for ; Tue, 1 Apr 2003 09:49:05 -0500 (EST) Received: from araci.terra.com.br (araci.terra.com.br [200.176.3.44]) by paiol.terra.com.br (Postfix) with ESMTP id 86003882EE for ; Tue, 1 Apr 2003 11:49:03 -0300 (BRT) Received: from insyde (200-171-250-132.customer.telesp.net.br [200.171.250.132]) (authenticated user insyde09) by araci.terra.com.br (Postfix) with ESMTP id 0BD74C412B for ; Tue, 1 Apr 2003 11:49:00 -0300 (BRT) Message-ID: <01a601c2f85e$08c15f20$84faabc8@insyde> From: "lists" To: Subject: problem with add Date: Tue, 1 Apr 2003 11:50:20 -0300 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01A3_01C2F844.DF4B16E0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Status: No, hits=-0.1 required=5.0 tests=BAYES_30,HTML_40_50,RCVD_IN_OSIRUSOFT_COM,UPPERCASE_25_50 version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/1 X-Sequence-Number: 2803 This is a multi-part message in MIME format. ------=_NextPart_000_01A3_01C2F844.DF4B16E0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable (this is a long post, sorry, but I have to explain the history) Hi, I've posted this some time ago, but I received an answer that do not satisfy me, and possibly others. What I'm trying to do is: I have a taable, say TBL1 built like this: CREATE TABLE TBL1 ( A INT, B CHAR(4), C CHAR(3) ); ALTER TABLE TBL1 ADD PRIMARY KEY ( A, B); Then I add some values to it, via ODBC INSERT INTO TBL1 (A,B,C) VALUES (1,'aaaa', 'bbb'); INSERT INTO TBL1 (A,B,C) VALUES (2,'aaaa', 'bbb'); INSERT INTO TBL1 (A,B,C) VALUES (3,'aaaa', 'bbb'); INSERT INTO TBL1 (A,B,C) VALUES (4,'aaaa', 'bbb'); INSERT INTO TBL1 (A,B,C) VALUES (5,'aaaa', 'bbb'); It's ok so far. But a new user of the system tries to insert a value that already exists: INSERT INTO TBL1 (A,B,C) VALUES (4,'aaaa', 'ccc'); then the program crashes!=20 You can say that I didn't treated the error, but I did treat the error, but the error code I was expecting (23000 - duplicated primary key) didn't came back. Instead an error message from the SGBD came. Is there any chance this would be corrected? Anyone else had the same problem/experience? Any work-around? If I know more programming, I would correct this, but I can't program. TIA, Ricardo. ------=_NextPart_000_01A3_01C2F844.DF4B16E0 Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
(this is a long post, sorry, but I have to= explain=20 the history)
 
Hi,
 
I've posted this some time ago, but I rece= ived an=20 answer
that do not satisfy me, and possibly=20 others.
 
What I'm trying to do is:
 
I have a taable, say TBL1 built like=20 this:
 
CREATE TABLE TBL1 ( A INT,
       =20                = =20             B CHAR(4),<= /DIV>
           =             &nb= sp;           =20 C CHAR(3) );
ALTER TABLE TBL1 ADD PRIMARY KEY ( A,=20 B);
 
Then I add some values to it, via ODBC
 
INSERT INTO TBL1 (A,B,C) VALUES (1,'a= aaa',=20 'bbb');
INSERT INTO TBL1 (A,B,C) VALUES (2,'a= aaa',=20 'bbb');
INSERT INTO TBL1 (A,B,C) VALUES (3,'a= aaa',=20 'bbb');
INSERT INTO TBL1 (A,B,C) VALUES (4,'a= aaa',=20 'bbb');
INSERT INTO TBL1 (A,B,C) VALUES (5,'a= aaa',=20 'bbb');
 
It's ok so far.
 
But a new user of the system tries to inse= rt a=20 value that
already exists:
 
INSERT INTO TBL1 (A,B,C) VALUES (4,'a= aaa',=20 'ccc');
 
then the program crashes!
 
You can say that I didn't treated the error, but I did treat the=20 error,
but the error code I was expecting (23000 - duplicated primary key)
didn't came back. Instead an error message from the SGBD came.
 
Is there any chance this would be corrected? Anyone else had the same<= /DIV>
problem/experience? Any work-around?
 
If I know more programming, I would correct this, but I can't=20 program.
 
TIA,
Ricardo.
------=_NextPart_000_01A3_01C2F844.DF4B16E0--