Results 1 to 3 of 3

Thread: select query

  1. #1
    Join Date
    Oct 2007
    Posts
    246

    Unanswered: select query

    Hi

    Need to have single codes around the tabname

    select 'select "'||(tabname)||'" from syscat.tables' from syscat.tables where type = 'T' fetch first 2 rows only

    getting output

    1
    ------------------------------------------------------------------------------------------------------------------------------------------------------------
    select "SYSTABLES" from syscat.tables
    select "SYSCOLUMNS" from syscat.tables


    I need output

    select 'SYSTABLE' from syscat.tables
    select 'SYSCOLUMNS' from syscat.tables

    regds
    paul

  2. #2
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    Hi,

    Place 2 consecutive single quotes inside each constant.
    'Select '''||...
    Regards,
    Mark.

  3. #3
    Join Date
    Oct 2007
    Posts
    246
    thanks mark got it,

    regds
    paul

Posting Permissions

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