467,880 Members | 1,149 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,880 developers. It's quick & easy.

Generating SQL Scripts from SPUFI

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
  • viewed: 2498
Share:
2 Replies
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
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.

Similar topics

5 posts views Thread by Mortimer | last post: by
4 posts views Thread by Jagdip Singh | last post: by
1 post views Thread by Narender Singh | last post: by
2 posts views Thread by waimanlau | last post: by
3 posts views Thread by mvsguy | last post: by
reply views Thread by mohandaspradeep | last post: by
1 post views Thread by LA1 | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.