Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Regarding Creating and Inserting a Global temporary table.

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

New User


Joined: 02 Jun 2006
Posts: 7

PostPosted: Wed Oct 18, 2006 2:14 pm    Post subject: Regarding Creating and Inserting a Global temporary table.
Reply with quote

Dear sir,

I want to create a Global temporary table in a program after that I have to Insert records from input file. After insert the sql code is displaying as zero. If tyr to fetch records from the same table in the very next step it fetching very first record n number of times

please let me what need to done to insert the records in to temp table.

Please send the syntax
Back to top
View user's profile Send private message

guptae

Moderator


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

PostPosted: Wed Oct 18, 2006 2:25 pm    Post subject:
Reply with quote

Hi there,

Would u please restate ur following stmt:

fetch records from the same table in the very next step it fetching very first record n number of times

would u mean that every times its fetching first row from the table if this is the case then how r u fetching record using select or cursor?

Actually when a query returns multiple row then it is mandatory to use cursor
Back to top
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Thu Oct 19, 2006 12:23 pm    Post subject: Re: Regarding Creating and Inserting a Global temporary tabl
Reply with quote

Hi Vijay,

There can be 2 chances to get the result as you said.

1) While inserting - Read file, move all the fields to host variables every time after read and then insert into Global Temporay Table.
Here If you miss to move fields after first record then every time first record's values will be inserted into Temporary Table.
This may lead to get the result as you said.

2) Cursor steps: Cursor Open, Fetch, Close may be in loop.

Check your program once and let us know.
Back to top
View user's profile Send private message
satya123
Warnings : 1

New User


Joined: 18 Aug 2006
Posts: 57

PostPosted: Fri Dec 01, 2006 4:30 pm    Post subject:
Reply with quote

Hi
Can u just let me know how to create a global temporary table????
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 SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm
No new posts Command UNIQUE CONSTRAINT on any tabl... rohanthengal DB2 2 Thu Aug 18, 2016 3:48 pm
No new posts Updating online Db2 table kishpra DB2 3 Fri Aug 12, 2016 2:44 pm
No new posts Creating an 'Enter' event with IMS MF... dileep chirasani Java & MQSeries 1 Sat Aug 06, 2016 2:23 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us