By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,514 Members | 1,717 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,514 IT Pros & Developers. It's quick & easy.

Generating SQL Scripts from SPUFI

P: n/a
Hi - I would be grateful for advice regarding the following.

Via SPUFI, I am using an SQL member to generate further SQL Statements.
Unfortunately, the generating output SQL statements are longer than 80
bytes in length.
SPUFU will only accept statements that are <= 80 bytes.

Therefore, do you know of an automatic method of splitting each
generated output statement over 2 lines.

I dont think this can be done via SPUFI.
How about a SORT step?

Thanks

Mar 9 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Run mulitple SQL statements that have output smaller than 80 bytes.
You will need to put data and a literal in front of the output that you
can than sort on... In this case here I would be selecting NAME and
the literal 1, 2, ... from SYSTABLES.

Example
First statement
Select name || '1' || 'this is your sql statement you are generating'
from SYSIBM.SYSTABLES....
second statement
Select name || '2' || 'this is the rest of the your sql statement ...'
from SYSIBM.SYSTABLES....

Then take the entire spufi output and sort on the first 10 bytes. You
will then get the output grouped by your name. You have to play around
with the output a little bit to remove what you included at the
beginning.

Mar 9 '06 #2

P: n/a
You might investigate if DSNTEP2 or DSNTEP4 will accept input records
longer than 80 characters. Executable code for both is provided with
DB2. You can check the provided source code for both to determine if the
program uses the input file DCB parameters or requires a fixed 80
character record. If you ave the PL/I compiler available, you could
easily alter (if necessary) the program to handle longer input records.

Phil Sherman

al**********@btinternet.com wrote:
Hi - I would be grateful for advice regarding the following.

Via SPUFI, I am using an SQL member to generate further SQL Statements.
Unfortunately, the generating output SQL statements are longer than 80
bytes in length.
SPUFU will only accept statements that are <= 80 bytes.

Therefore, do you know of an automatic method of splitting each
generated output statement over 2 lines.

I dont think this can be done via SPUFI.
How about a SORT step?

Thanks

Mar 9 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.