Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655

    Unanswered: 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

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Try "VALUES CURRENT USER"

    Andy

  3. #3
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    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

  4. #4
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    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

Posting Permissions

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