View previous topic :: View next topic |
Author |
Message |
sam01 Beginner
Joined: 03 Jan 2019 Posts: 9 Topics: 4
|
Posted: Fri Jan 18, 2019 11:04 am Post subject: Getting columnn name by using DSNTIAUL PARM(SQL) |
|
|
Hello, i would like to get the columns nalme with this :
Code: |
SELECT STRIP(CHAINE)!!';'!!STRIP(DATEXE)!!';'
!!STRIP(HEUREXE)!!';'!!STRIP(DATESAV)!!';'
!!STRIP(HEURSAV)!!';'!!STRIP(CODRET)
FROM XDATE.REAL WHERE CHAINE LIKE 'XFDESQL%'
AND DATEXE BETWEEN '2018-01-01' AND '2018-12-31'
ORDER BY DATEXE ASC;
|
By using in my job :
Code: |
//SYSTSIN DD *
DSN SYSTEM(DB2R)
RUN PROGRAM(DSNTIAUL) PARMS('SQL')
|
Is it possible ?
Thank's for your help. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Fri Jan 18, 2019 11:37 am Post subject: |
|
|
sam01,
If you just need the column Name why are you selecting the data from the table? The DB2 catalog table sysibm.syscolumns will have the table information with the columns
something simple like this
Code: |
SELECT CHAR(STRIP(NAME))
FROM SYSIBM.SYSCOLUMNS
WHERE TBNAME = 'XDATE.REAL'
; |
If you need the column definition also then you can take a look at this topic
https://www.mvsforums.com/helpboards/viewtopic.php?t=11443&highlight=column _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
sam01 Beginner
Joined: 03 Jan 2019 Posts: 9 Topics: 4
|
Posted: Sat Jan 19, 2019 11:09 am Post subject: |
|
|
Hello,
i need both of them.
The data and the column name. Is there an option with header or something like that to get the data and the column name with using ORDER BY ?
Thnak's for your help |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Sat Jan 19, 2019 11:38 am Post subject: |
|
|
sam01 wrote: | Hello,
i need both of them.
The data and the column name. Is there an option with header or something like that to get the data and the column name with using ORDER BY ?
Thnak's for your help |
Nope. DSNTIAUL unloads the raw data from the table in its original format.
If you want headers then you need to use DSNTEP2 which is a report format unload.
Check this link which explains in detail about DSNTEP2
http://www.mvsforums.com/helpboards/viewtopic.php?t=2418 _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
sam01 Beginner
Joined: 03 Jan 2019 Posts: 9 Topics: 4
|
Posted: Mon Jan 21, 2019 2:39 am Post subject: |
|
|
Ok, i anderstood it's not possible. With DSNTEP2, the result is into the SYSPRINT and limited to 133 bytes records....
Thank's. |
|
Back to top |
|
|
promask Beginner
Joined: 19 Feb 2019 Posts: 1 Topics: 0
|
Posted: Thu Feb 28, 2019 4:04 am Post subject: |
|
|
he he))) |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Thu Feb 28, 2019 10:38 am Post subject: |
|
|
Promask,
Unless you have anything substantial to add to the topic, I suggest that you keep the giggles to your self. Consider this as a first warning. Keep this charade up , you will end up losing privileges to post on this board. _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
|
|