Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Copy Records from a table having 47 fields into a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
rsm_deepak

New User


Joined: 06 Apr 2005
Posts: 31
Location: visakhapatnam

PostPosted: Tue Jul 18, 2006 7:44 pm    Post subject: Copy Records from a table having 47 fields into a file
Reply with quote

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
View user's profile Send private message

anamikak

New User


Joined: 10 May 2006
Posts: 64
Location: Singapore

PostPosted: Tue Jul 18, 2006 9:55 pm    Post subject:
Reply with quote

try out unload utility
Back to top
View user's profile Send private message
red_roses

New User


Joined: 31 Oct 2005
Posts: 27

PostPosted: Tue Jul 18, 2006 10:36 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ravi17s
Warnings : 1

New User


Joined: 15 Aug 2003
Posts: 57

PostPosted: Wed Jul 19, 2006 5:13 pm    Post subject: Re: Copy Records from a table having 47 fields into a file
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Fri Jul 21, 2006 4:46 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 7 Fri Sep 22, 2017 11:35 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us