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
 
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 Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
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 Creating ISPF Screens with Scrname vi... Albireo20 TSO/ISPF 10 Tue Sep 05, 2017 4:24 pm

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