开发者

How to have one UOW (transaction) across multiple DB2 SQL statements in IBM Data Studio script window?

开发者 https://www.devze.com 2023-02-15 01:07 出处:网络
I\'m trying to run a scri开发者_如何学运维pt interactively within IBM Data Studio against a DB2 LUW database.

I'm trying to run a scri开发者_如何学运维pt interactively within IBM Data Studio against a DB2 LUW database.

I'm trying to have the whole script execute within one unit of work (transaction) so that the NOT LOGGED attribute stays in effect until my INSERT statement finishes building a large table. At the moment, it runs for ~30 seconds then terminates with a 'logfile full' error.

Can someone please tell me how to get a single unit of work to persist across this script? The script I'm using is shown below.

(I know I could do this with a stored proc, but I'd like to know how to do it interactively in the Data Studio script window - if it's possible)

Thanks! John.

CREATE TABLE test.exp1 (    
client_id   int,
fx101       varchar(15),
fx102       varchar(15)
) NOT LOGGED INITIALLY;

ALTER TABLE test.exp1 ACTIVATE NOT LOGGED INITIALLY;

INSERT INTO test.exp1 ....<huge insert statement here> .... ;

COMMIT; 


It looks like it's not possible. See the SQL statements that are allowed in dynamic compound SQL here: http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=/com.ibm.db2.luw.sql.ref.doc/doc/r0004240.html

You can do slightly more in a procedure, but still not everything. See here: http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=/com.ibm.db2.luw.sql.ref.doc/doc/r0004239.html

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号