IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Regarding Creating and Inserting a Global temporary table.


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 1208
Location: Bangalore,India

PostPosted: Wed Oct 18, 2006 2:25 pm
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top