Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2002
    Location
    ATL
    Posts
    170

    Unanswered: Variable substitution

    What am i doing wrong

    The following query works

    db2 -x "select 'create alias PSW${DBN}.${T1} for psoft.${T1};' from syscat.tables where TABNAME='SAMPLE' and type='T'"

    The following does not work as soon as i pass a variable in where condition

    db2 -x "select 'create alias PSW${DBN}.${T1} for psoft.${T1};' from syscat.tables where TABNAME=${T1}"

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    TABNAME is a character literal and needs a single quote on both sides of the literal.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

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