[SQL] transaction in function

2006-12-05 Thread Marian POPESCU
Hi, I want to write a function that updates several tables; if there is an exception while updating, it should rollback the transaction and raise an error. How can this be done in pgPLSQL in PostgreSQL 8.1 ? Thank you for helping me out on this one ! ---(end of broadca

[SQL] Join issue?

2004-12-15 Thread Marian POPESCU
Hi, I have a problem with this join query: SELECT CASE WHEN (UR.id_rights IS NULL) THEN '0' ELSE UR.id_rights END as id_rights, CASE WHEN (UR.r_category IS NULL) THEN 'CMP' ELSE UR.r_category END as category, U.id as id_user, U.username FROM mgw_users U LEFT OUTER JOIN mgw_cnt_us

[SQL] Join issue?

2004-12-15 Thread Marian POPESCU
Hi, I have a problem with this join query: SELECT CASE WHEN (UR.id_rights IS NULL) THEN '0' ELSE UR.id_rights END as id_rights, CASE WHEN (UR.r_category IS NULL) THEN 'CMP' ELSE UR.r_category END as category, U.id as id_user, U.username FROM mgw_users U LEFT OUTER J