Re: [SQL] Get id of a tuple using exception

2011-04-16 Thread Jasen Betts
On 2011-04-14, f vf wrote: > --000e0cd2bf6a60c30804a0dec84b > Content-Type: text/plain; charset=ISO-8859-1 > > Hello, > i'm using a pl/sql procedure and I prevent inserting duplicate tuples using > an exception for example: > > BEGIN >INSERT INTO "Triples"(id, subject, predicate, "object

Re: [SQL] Get id of a tuple using exception

2011-04-14 Thread Adrian Klaver
On Thursday, April 14, 2011 6:50:57 am f vf wrote: > No, the id is nextval( 'triples_seq'), if I do nothing, so its something > like: > BEGIN > INSERT INTO "Triples"(id, subject, predicate, "object") > VALUES (nextval( 'triples_seq'), sub_i, pred_i, > obj_i); EXCEPTIO

Re: [SQL] Get id of a tuple using exception

2011-04-14 Thread Adrian Klaver
On Thursday, April 14, 2011 3:56:51 am f vf wrote: > Hello, > i'm using a pl/sql procedure and I prevent inserting duplicate tuples using > an exception for example: > > BEGIN >INSERT INTO "Triples"(id, subject, predicate, "object") > VALUES (id, sub_i, pred_i, obj_i)

[SQL] Get id of a tuple using exception

2011-04-14 Thread f vf
Hello, i'm using a pl/sql procedure and I prevent inserting duplicate tuples using an exception for example: BEGIN INSERT INTO "Triples"(id, subject, predicate, "object") VALUES (id, sub_i, pred_i, obj_i); * EXCEPTION WHEN unique_violation THEN --do som