[Greater-commits] r281 - trunk/GREAT-ER-DB/impl/postgresql
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon Jun 27 14:35:17 CEST 2011
Author: aheinecke
Date: 2011-06-27 14:35:17 +0200 (Mon, 27 Jun 2011)
New Revision: 281
Modified:
trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc
Log:
Use indicator based updating instead of CASE WHEN in update_session.
Modified: trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc
===================================================================
--- trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc 2011-06-27 11:51:35 UTC (rev 280)
+++ trunk/GREAT-ER-DB/impl/postgresql/gdagreater_pg.pgc 2011-06-27 12:35:17 UTC (rev 281)
@@ -12389,20 +12389,20 @@
errln = 20;
EXEC SQL UPDATE SESS_TAB
SET SESS_ID = :h_sess.sess_id,
- CATCH_ID = CASE WHEN :h_sess.catch_id = -1 THEN NULL ELSE :h_sess.catch_id END,
- SUBST_ID = CASE WHEN :h_sess.subst_id = -1 THEN NULL ELSE :h_sess.subst_id END,
- ENV_ID = CASE WHEN :h_sess.env_id = -1 THEN NULL ELSE :h_sess.env_id END,
- MARKET_ID = CASE WHEN :h_sess.market_id = -1 THEN NULL ELSE :h_sess.market_id END,
- MOD_ID = CASE WHEN :h_sess.mod_id = -1 THEN NULL ELSE :h_sess.mod_id END,
- RES_ID = CASE WHEN :h_sess.res_id = -1 THEN NULL ELSE :h_sess.res_id END,
- SESS_DISCH_ID = CASE WHEN :h_sess.sess_disch_id = -1 THEN NULL ELSE :h_sess.sess_disch_id END,
+ CATCH_ID = :h_sess.catch_id :h_sess.catch_id,
+ SUBST_ID = :h_sess.subst_id :h_sess.subst_id,
+ ENV_ID = :h_sess.env_id :h_sess.env_id,
+ MARKET_ID = :h_sess.market_id :h_sess.market_id,
+ MOD_ID = :h_sess.mod_id :h_sess.mod_id,
+ RES_ID = :h_sess.res_id :h_sess.res_id,
+ SESS_DISCH_ID = :h_sess.sess_disch_id :h_sess.sess_disch_id,
NAME = :h_sess.name,
USER_ID = :h_sess.user_id,
MOD_DATE = to_timestamp(:h_sess.mod_date, :h_fmt_date),
STATUS = :h_sess.status,
PRIVS = :h_sess.privs,
IS_TEMP_SESS = :h_sess.is_temp_sess,
- TEMP_SESS_SRC_ID = CASE WHEN :h_sess.temp_sess_src_id = -1 THEN NULL ELSE :h_sess.temp_sess_src_id END,
+ TEMP_SESS_SRC_ID = :h_sess.temp_sess_src_id :h_sess.temp_sess_src_id,
TEMP_SESS_DB_SID = :h_sess.temp_sess_db_sid,
REMARK = :h_sess.remark
WHERE SESS_ID = :h_sess_id;
More information about the Greater-commits
mailing list