473,396 Members | 1,599 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

dynamic compound statement

I have problem where a ETL team is trying to update a column in a very
large table. They are trying to do this in single query. Also each
time they run it consumes all available space in the logs and this in
turn abends their process. We are limited on log space.

I would like to use a SQL dynamic compound statement, "basically
adding commit processing after X amount of rows". I already create a
Stored Procedure(SP) that works. However they do not wish to call an
SP. And before you ask. No they do not want to write a program,
they want it all to be in SQL!!!

I have been playing round with ATOMIC SQL but I can't seem to get it
to work.

Basic Code:
1. Set variable for how often to commit.
2. Declare cursor for update
3. open cursor
4. Loop until end or table
4a. fetch row
4b. update row based on cursor
4c. check if commit limit reached if so commit and reset counter
5. at end one last commit and close cursor.

Any ideas:

Thanks for any help....
Nov 19 '07 #1
1 1833
do*********@db2helpdesk.com wrote:
I have problem where a ETL team is trying to update a column in a very
large table. They are trying to do this in single query. Also each
time they run it consumes all available space in the logs and this in
turn abends their process. We are limited on log space.

I would like to use a SQL dynamic compound statement, "basically
adding commit processing after X amount of rows". I already create a
Stored Procedure(SP) that works. However they do not wish to call an
SP. And before you ask. No they do not want to write a program,
they want it all to be in SQL!!!

I have been playing round with ATOMIC SQL but I can't seem to get it
to work.
SQL has an old fashioned appoach to ATOMIC's they are undividable.
So what you want to do is not possible.
The stored procedure is the way to go, unless you want to revisit your
log-policy.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Nov 20 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Khaled Afiouni | last post by:
Hello, How can I stop/prevent SQL server from running compound SQL statements. I do not want the server to run multiple update/delete/insert/select statements as a batch. Is there an option? ...
3
by: andrewbb | last post by:
Is it possible to force the use of a compound index in a query? create table Test (ColOne int, ColTwo int) The compound index is ColOne + ColTwo. I'm interested in searching on ColTwo, but I...
1
by: Eugene | last post by:
In a DB2 V8.1 FP4 database I am trying to create a table SQL UDF that is to return a contents of a temporary table with in this UDF: create function getitemdata(pint int) returns table (...
7
by: Yaro | last post by:
Hello Is it possible using dynamic SQL in UDF? In Sybase below example work but in DB2 UDB 8.1.3 I get error: "SQL0104N Unexpected element "EXECUTE IMMEDIATE" found....." CREATE FUNCTION...
6
by: William Ahern | last post by:
So, GCC 4.01 is giving errors that GCC 3.3 did not, and I'm thinking they've gone overboard with their new type checking infrastructure. Here's the supposedly offending code (no laughing or...
7
by: Timo Haberkern | last post by:
Hi there, i have some troubles with my TSearch2 Installation. I have done this installation as described in http://www.sai.msu.su/~megera/oddmuse/index.cgi/Tsearch_V2_compound_words...
11
by: Holger | last post by:
Hi I have not been able to figure out how to do compound statement from C - "<test>?<true-val>:<false-val>" But something similar must exist...?! I would like to do the equivalent if python...
9
by: Jameson.Quinn | last post by:
I have: try: for line in open(myFileName): count += 1 except IOError: print "Can't open myfile" (I know, this is bad, I never close the file, but its just for illustration). But then I...
2
by: Damir | last post by:
Hello! I have noticed that after (sucessfully) executing the command: FLUSH PACKAGE CACHE DYNAMIC the dynamic SQL statement cache is not completely cleared (some of the dynamic SQL statement...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.