View Poll Results: Does My Question Makes any Sense>

Voters
0. You may not vote on this poll
  • Yes

    0 0%
  • No

    0 0%
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2013
    Posts
    3

    Unanswered: Need Table Variable

    Dear Friends,

    I am new to DB2 so please excuse me about my knowledge. I am trying to create a procedure which should store a huge amount of data in a temporary object like a Table Variable (in MSSQL) so that I can retrieve some set of data in each loop for processing.

    I can not use any temporary tables as I dont have any permission.

    Can I get some knowledge related to my need where in I need to retrieve data in batches to process it and finally delete the object which I dont need any more as its only for temporary purpose and for that instance.

    Thanks in Advance
    Sathya

  2. #2
    Join Date
    Sep 2013
    Posts
    3
    Urgently need this help !!!

  3. #3
    Join Date
    Sep 2013
    Posts
    11
    you might can populate this data in a cursor. then u can use it any where you want in the procedure. temporary table variable might not be a good idea.

  4. #4
    Join Date
    Sep 2013
    Posts
    3
    Thank you Dear Memon,

    Actually I have huge records to be processed (numbers in Millions) and each time I need to process some set of records like around 5000 in each iteration at one shot. Where as Cursors are meant only for row by row operations and processing each and every row at a time is going to hamper the performance as it would take tremendous amount of time.

    Currently what I want to do is to store all the millions of records in a table variable with identity column, I will loop through the records 5000 at a time and process it using a counter and incrementer and in the next iteration counter will get reduced by 5000 and increments by 5000 so that at a time 5000 records can be processed during each iteration instead of single row each time.

    Kindly help.

    Also I am worried about using cursors as it will affect performance of the server

    Thanks in advance
    Sathya

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •