View previous topic :: View next topic
|
Author |
Message |
rsm_deepak
New User
Joined: 06 Apr 2005 Posts: 30 Location: visakhapatnam
|
|
|
|
Here i just want to copy the records of a table having 47 fields into a new file.
My problem is that when i am declaring a cursor whether i have to declare all the 47 fields in the cursor or there is any other easy method. |
|
Back to top |
|
|
anamikak
New User
Joined: 10 May 2006 Posts: 64 Location: Singapore
|
|
|
|
try out unload utility |
|
Back to top |
|
|
red_roses
New User
Joined: 31 Oct 2005 Posts: 27
|
|
|
|
anamikak has a good suggestion, if u only want the recs on a file and no processing for it then its a safer way to ues the unload utiliy,
search the forumn for the exact jcl, someone had posted it jsut a few days ago |
|
Back to top |
|
|
ravi17s Warnings : 1 New User
Joined: 15 Aug 2003 Posts: 57
|
|
|
|
Yes u can use UNLOAD utility.
But if you want to go for a cursor,Just declare it as
EXEC SQL DECLARE C1 CURSOR FOR SELECT * FROM TABLE NAME:
Thanks,
Ravi.... |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Yeap Ravi is right but while fetchin the row from the cursor u have to give all 47 variable i.e
fetch cursor1 into :table1.field1,
:table1.field2,
:table1.field3,
....................................................
....................................................
....................................................
....................................................
:table1.field47 |
|
Back to top |
|
|
|