Re: [SQL] update with recursive query

2011-04-14 Thread Pavel Stehule
Hello it is possible in 9.1. In older version you have to use a temp table. Regards Pavel Stehule 2011/4/14 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 qu

[SQL] convert in GMT time zone without summer time

2011-04-14 Thread LaraK
Hello, I want write a function that converts a timestamp with time zone to the UTC zone. But it should all be stored in the winter time. For example, it must now, in the summer, the German time back by 2 hours and in the winter time only 1 hour. But it expects only back one hour. Is there a func

[SQL] update with recursive query

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,

[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,   

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