[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

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); *

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); EXCEPTION WHEN

[SQL] update using recursion

2011-04-14 Thread Steven Dahlin
Is it possible to execute an update using recursion?  I need to update a set of records and also update their children with the same value. I tried the following query but it gave an error at the update schema.table tbl:     with recursive childTbl( pid, ppid,