View previous topic :: View next topic
|
Author |
Message |
apandey
New User
Joined: 31 Aug 2009 Posts: 73 Location: Mumbai
|
|
|
|
Hi,
If i have a table say X, which has 10 columns(fields), I want to fetch 5 fields using select clause which i can do,These 5 columns have total lenght of 50, I want it to write in output file, this i can do thru IKJEFT01 utility, but the output file is of 150 length that means 50 lenght i can get from fields of table but remaining 150 fields i want it to write as spaces.
Now 1 way is to do is -
SELECT 5 fields,CHAR( 150 spaces ) FROM table(X) .... But this will cost me to type 150 spaces in CHAR field, Is there anyway to fetch 150 spaces? |
|
Back to top |
|
|
apandey
New User
Joined: 31 Aug 2009 Posts: 73 Location: Mumbai
|
|
|
|
Just to add correction in above query, output file is of 200 length. |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
do you mean repeat(' ',200) ? |
|
Back to top |
|
|
apandey
New User
Joined: 31 Aug 2009 Posts: 73 Location: Mumbai
|
|
|
|
Sorry GuyC, i havent understood ur reply .. But my output file's LRECL is 200 in SYSREC(i m using IKJEFT01). When i will fetch 5 fields, 50 legth's data will written to file(as each field's length is 10), but for remaining 150 length, i want to write space, so how i will fetch that 150 space using select query. 1 way i already mentioned in my 1st post. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Ashutosh,
since you wrote this
it is not surprising that you do not understand GuyC's solution,
because that would require looking in a manual for the db2 utility that you are invoking thru the terminal monitor program,
or simply knowing sql. |
|
Back to top |
|
|
apandey
New User
Joined: 31 Aug 2009 Posts: 73 Location: Mumbai
|
|
|
|
I got it now .. thanks GuyC .. !! |
|
Back to top |
|
|
|