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 > DB2 Special Registers - Better way

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-14-08, 10:53
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
DB2 Special Registers - Better way

Hi,
Is there any other way to display value of "CURRENT USER" than
using SELECT from sysibm.sysdummy1


Can we use ECHO in our scripts some how ?


Please Help

DBFinder
Reply With Quote
  #2 (permalink)  
Old 10-14-08, 11:05
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Try "VALUES CURRENT USER"

Andy
Reply With Quote
  #3 (permalink)  
Old 10-14-08, 12:29
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Well, you are right,
that is for Dynamic SQL.

I was looking for source of retrieval of SPECIAL Register values. So that I can print in simple BAT file.

Thanks Anyway.

DBFinder
Reply With Quote
  #4 (permalink)  
Old 10-14-08, 14:08
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
A "special register" is a SQL construct, a SQL expression. Thus, you have to use SQL mechanisms to evaluate the expression and retrieve the value. So what's wrong with using the VALUES statement that Andy mentioned?

If you just need to get the user who is executing your batch file, you have to look at Windows mechanisms - not at DB2.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
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