Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2001
    Posts
    32

    Unanswered: Regarding Substitution Variable in DB2

    We have substitution variable in SQL * PLUS.Similarly Do we have this variable in DB2.If it is ,can you explain how to use it in DB2.

    In SQL*PLUS,we have ampersand &.

    eg. SELECT * FROM EMP where ENAME=&1

    While passing the above query,it will prompt us to enter the i/p for ename.

    Can I know this variable in DB2 with above functionality?

  2. #2
    Join Date
    Mar 2001
    Location
    Lexington, KY
    Posts
    606

    Re: Regarding Substitution Variable in DB2

    Originally posted by thangam
    We have substitution variable in SQL * PLUS.Similarly Do we have this variable in DB2.If it is ,can you explain how to use it in DB2.

    In SQL*PLUS,we have ampersand &.

    eg. SELECT * FROM EMP where ENAME=&1

    While passing the above query,it will prompt us to enter the i/p for ename.

    Can I know this variable in DB2 with above functionality?
    I think you can do it this way:
    SELECT * FROM EMP where ENAME = :some_var_name
    Thanks,

    Matt

Posting Permissions

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