If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Oracle Convertion

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-19-04, 10:00
etobar etobar is offline
Registered User
 
Join Date: Feb 2004
Posts: 3
Post Oracle Convertion

I need to convert this oracle statement "select userenv( 'sessionid' ) from dual" to DB2
Can Anyone help me ?
Reply With Quote
  #2 (permalink)  
Old 02-19-04, 10:47
jsander jsander is offline
Registered User
 
Join Date: Apr 2003
Posts: 191
Re: Oracle Convertion

Hi,

you will need to define userenv('sessionid') as a function. Then you can use the values statement:

values userenv('sessionid')

Johann

Quote:
Originally posted by etobar
I need to convert this oracle statement "select userenv( 'sessionid' ) from dual" to DB2
Can Anyone help me ?
Reply With Quote
  #3 (permalink)  
Old 02-19-04, 12:04
etobar etobar is offline
Registered User
 
Join Date: Feb 2004
Posts: 3
Hi Johan
i got your message but i need the db2's session number. The oracle function userenv returns many values ( sessionid, userid, ...), and, in this case i need to know the session id, to identify user and comand.

Thanks
Reply With Quote
  #4 (permalink)  
Old 02-20-04, 03:15
jsander jsander is offline
Registered User
 
Join Date: Apr 2003
Posts: 191
Hi etobar,

sorry, no can do. With DB2, you have no such thing as a session id that is available from SQL. The special register CURRENT USER is all you can get. You will need to implement the rest in your application.

Johann

Quote:
Originally posted by etobar
Hi Johan
i got your message but i need the db2's session number. The oracle function userenv returns many values ( sessionid, userid, ...), and, in this case i need to know the session id, to identify user and comand.

Thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On