|
View previous topic :: View next topic
|
| Author |
Message |
meetsupriyo
New User
Joined: 19 May 2009 Posts: 11 Location: Hyderabad
|
|
|
|
Hi,
I have a table on which a column is defined as VARCHAR(3500). I want to extract this column by SQL in a File. However as the column is VARCHAR, I am getting length as first two bytes which I dont want. Using CAST AS CHAR wont help as maximum character that I can extract is 255 I think. Is there anyway to extract the whole VARCHAR column as normal character without the length?
Thanks,
Supriyo. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
One way would be to read the column into a ws-variable and then write your output file from this. |
|
| Back to top |
|
 |
meetsupriyo
New User
Joined: 19 May 2009 Posts: 11 Location: Hyderabad
|
|
|
|
Hi,
I dont want to write a COBOL DB2 Code for this. I was seeking if we can fulfil this requirement by a Job using SQL
Thanks,
Supriyo. |
|
| Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
|
of course you can do this - it just depends on what programs that job is trying to execute and if those programs can do what you need. If they cannot then you will have to write a piece of code that will do it. I would suspect that that would be the most efficient way of doing it - but maybe not. |
|
| Back to top |
|
 |
Pandora-Box
Global Moderator
.jpg)
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Hi,
Do you the output file as FB? |
|
| Back to top |
|
 |
sushanth bobby
Senior Member

Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Supriyo,
Give a try on CLOB function,
| Code: |
select CLOB(columnname,3500)
from tablename
|
Not tested
Thanks,
Sushanth |
|
| Back to top |
|
 |
|
|