; Shavonne Marietta Wijesinghe
Subject: Re: [SQL] duplicate key violates unique constraint
Shavonne,
You will probably always find someone on the list who will answer your
questions, but you really should read the manual too!
In this case you could have found the answer by reading
http
On Tue, Feb 26, 2008 at 11:36 AM, Shavonne Marietta Wijesinghe
<[EMAIL PROTECTED]> wrote:
> BEGIN
> SAVEPOINT s1;
> ... code here ...
> EXCEPTION
> WHEN ... THEN
> ROLLBACK TO s1;
> ... code here ...
> WHEN ... THEN
> ROLLB
Shavonne Marietta Wijesinghe wrote:
> I wrote the query in the SQL windows provided by the pgadmin.
That SQL window only executes SQL, so you can't use PL/pgSQL commands on
it. PL/pgSQL can only be used in the context of a PL/pgSQL function, so
you need to do CREATE FUNCTION to do that.
If you w
2008 5:28 PM
Subject: Re: [SQL] duplicate key violates unique constraint
On Tuesday 26 February 2008, Andrew Sullivan wrote:
Well, except that there's no "EXCEPTION" statement in SQL? Â I think
your correspondent was intending for this to be programmatic.
I was thinking pl/pgs
olation THEN
INSERT INTO my_shevi values ('a', 5, 2, 2);
END;
I don't see anything wrong with the code..
Shavonne
- Original Message -
From: "Teemu Torma" <[EMAIL PROTECTED]>
To:
Sent: Tuesday, February 26, 2008 4:17 PM
Subject: Re: [SQL] duplicate key vio
On Tuesday 26 February 2008, Andrew Sullivan wrote:
> Well, except that there's no "EXCEPTION" statement in SQL? I think
> your correspondent was intending for this to be programmatic.
I was thinking pl/pgsql.
Teemu
---(end of broadcast)---
TIP
On Tue, Feb 26, 2008 at 05:05:01PM +0100, Shavonne Marietta Wijesinghe wrote:
> Thank you. I tried as you said. But i get a ERROR: syntax error at or near
> "INSERT" at character 9
> I don't see anything wrong with the code..
Well, except that there's no "EXCEPTION" statement in SQL? I think
ing wrong with the code..
Shavonne
- Original Message -
From: "Teemu Torma" <[EMAIL PROTECTED]>
To:
Sent: Tuesday, February 26, 2008 4:17 PM
Subject: Re: [SQL] duplicate key violates unique constraint
On Tuesday 26 February 2008, Shavonne Marietta Wijesinghe wrote:
Duri
On Tuesday 26 February 2008, Shavonne Marietta Wijesinghe wrote:
> During an "INSERT INTO" I get an "Error - duplicate key violates
> unique constraint"
>
> Is there any way, that i can test the error. Something like this??
>
> IF error = "duplicate key violates unique constraint" then
> do
Hello
During an "INSERT INTO" I get an "Error - duplicate key violates unique
constraint"
Is there any way, that i can test the error. Something like this??
IF error = "duplicate key violates unique constraint" then
do something
else
insert into
end if
Thanks
Shavonne
10 matches
Mail list logo