View previous topic :: View next topic
|
Author |
Message |
bh_arunk
New User
Joined: 03 Oct 2003 Posts: 3
|
|
|
|
hi, can anyone give me sample code to UNLOAD a VIEW using DSNUPROC ? The VIEW constitues tables from multiple TABLESPACE. I have tried couple of scenarios but in vain.
Any working code would be appreciable.
Thanks in advance. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
I have tried couple of scenarios but in vain. |
not really informative.
what is your sql, what is your sqlcode/error output? |
|
Back to top |
|
|
bh_arunk
New User
Joined: 03 Oct 2003 Posts: 3
|
|
|
|
Q1. Is it possible to UNLOAD the data directly from VIEW using DSNUPROC ? Please note, ABCDEF is a view (containing multiple tablespaces) |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Is it possible to UNLOAD the data directly from VIEW using DSNUPROC ? |
At the top of the page is a link to "IBM Manuals". Among these are manuals for several releases of DB2. Suggest you spend some time with the manuals for your release.
In the info for UNLOAD, i do not see VIEW mentioned. |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
UNLOAD is for tablespaces
You can specify TABLE but that is only for specifying a specific table in a segmented tablespace.
also the message : INVALID OPERAND 'ORDER' should have given you a clue that order by is not allowed. |
|
Back to top |
|
|
Srihari Gonugunta
Active User
Joined: 14 Sep 2007 Posts: 295 Location: Singapore
|
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
DSNTIAUL is JCL, DSNUPROC is a stored procedure. Two completely different ways of invoking.
Maybe if you stated the actual requirement, we could give an alternative solution. |
|
Back to top |
|
|
bh_arunk
New User
Joined: 03 Oct 2003 Posts: 3
|
|
|
|
Hi,
My requirement is to UNLOAD data from a VIEW say ABCD.
View ABCD spans Multiple tables
say table 1, table 2, table 3, table 4.
Table 1, Table 2 belong to the same table space but tables TABLE 3, TABLE 4 belong to a different tablespace.
I was looking for a code that would help me UNLOAD from such a VIEW using DSNUPROC.
Any working is code appriciable.
As already indicated
1. I would also like to know an equvivalent of ORDER BY during the UNLOAD using DSNUPROC. |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
AFAIK you can not unload a view using UNLOAD
not through DSNUPROC, not through DSNUTILS.
You can (as Srihari Gonugunta suggested) use DSNTIAUL
extract from the manual :
Code: |
//UNLOAD EXEC PGM=IKJEFT01,DYNAMNBR=20
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DSN)
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIB81) -
LIB('DSN810.RUNLIB.LOAD')
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSREC00 DD DSN=DSN8UNLD.SYSREC00,
// UNIT=SYSDA,SPACE=(32760,(1000,500)),DISP=(,CATLG),
// VOL=SER=SCR03
//SYSPUNCH DD DSN=DSN8UNLD.SYSPUNCH,
// UNIT=SYSDA,SPACE=(800,(15,15)),DISP=(,CATLG),
// VOL=SER=SCR03,RECFM=FB,LRECL=120,BLKSIZE=1200
//SYSIN DD *
DSN8810.PROJ WHERE DEPTNO='D01' |
|
|
Back to top |
|
|
|