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 unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm


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