From: shorti on 30 Nov 2009 13:41 Running DB2 V9.5 UDB on AIX I was wondering if there was a way to add directives to the DB2 DDL files? Specifically, I am looking for something similar to the C directives ifdef/ifndef where I can say "if criteria_1 then use UPDATE DB CFG....100, otherwise use UPDATE DB CFG....200". I know I can use different DDL files in the calling script but I was hoping to keep all my DB2 configs in one file to avoid confusion in the future. Any suggestions?
From: Ian on 30 Nov 2009 14:04 shorti wrote: > Running DB2 V9.5 UDB on AIX > > I was wondering if there was a way to add directives to the DB2 DDL > files? Specifically, I am looking for something similar to the C > directives ifdef/ifndef where I can say > > "if criteria_1 then use UPDATE DB CFG....100, otherwise use UPDATE DB > CFG....200". > > I know I can use different DDL files in the calling script but I was > hoping to keep all my DB2 configs in one file to avoid confusion in > the future. Any suggestions? DB2 9.7 added a lot of SQL PL features so you do have more control to do this. With older versions, you're much better off doing this via a scripting language (ksh/bash/perl/etc). Good luck,
From: Serge Rielau on 30 Nov 2009 14:27 Ian wrote: > shorti wrote: >> Running DB2 V9.5 UDB on AIX >> >> I was wondering if there was a way to add directives to the DB2 DDL >> files? Specifically, I am looking for something similar to the C >> directives ifdef/ifndef where I can say >> >> "if criteria_1 then use UPDATE DB CFG....100, otherwise use UPDATE DB >> CFG....200". >> >> I know I can use different DDL files in the calling script but I was >> hoping to keep all my DB2 configs in one file to avoid confusion in >> the future. Any suggestions? > > DB2 9.7 added a lot of SQL PL features so you do have more control > to do this. DB2 9.7 FP1 has "conditional compilation" http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.admin.config.doc/doc/r0056390.html http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.sql.ref.doc/doc/c0056403.html Cheers Serge -- Serge Rielau SQL Architect DB2 for LUW IBM Toronto Lab
|
Pages: 1 Prev: recursively get previous row using OLAP functions Next: Need advice to optimize this query |