DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Identify Session Id

  1. #1
    Join Date
    Dec 2000
    Posts
    2

    Question

    Hi,

    I want to delete all the rows in a temporary table before I Insert any new rows based on a query on the Top block.

    If any other user is also accessing the same form at the same time he will also delete those rows before inserting fresh rows in the same temporary table.

    In such a case the rows inserted by User1 will be lost and he can't do any operations on them as the records are lost because of the User2 operation.

    Hence I came up with an idea to insert the session id while I insert records into the temporary table. But how do I determine the session id from V$Session view when there are multiple sessions opened by me , for example I opened 2 sql*plus sessions and 1 Sql Navigator session and 2 form sessions, I have done the above operation in one of the form session, how do I identify the session id from that form which I can use to insert into temporary table?

    so, when I delete I will only delete those records which are created under this session.

    Any help much appreciated.

    TIA,
    Venu

  2. #2
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    There are 2 ways you can solve the problem:
    1 Using sessionid as one of the column in the temp table
    select userenv('sessionid') from dual;

    2 You can start using global temporary table.
    In this approach other session (user) will not see the rows inserted / deleted by the previous user (session).

  3. #3
    Join Date
    Dec 2000
    Posts
    2
    Thanks a lot Selvan.

Posting Permissions

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


Click Here to Expand Forum to Full Width