Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old March 9th, 2006, 12:05 PM
alex.mcshane@btinternet.com
Guest
 
Posts: n/a
Default 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




  #2  
Old March 9th, 2006, 01:15 PM
johnl
Guest
 
Posts: n/a
Default Re: Generating SQL Scripts from SPUFI

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.

  #3  
Old March 9th, 2006, 04:25 PM
Phil Sherman
Guest
 
Posts: n/a
Default Re: Generating SQL Scripts from SPUFI

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



alex.mcshane@btinternet.com wrote:[color=blue]
> 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
>[/color]
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,414 network members.