Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2013
    Posts
    5

    Unanswered: Can anyone of u pls explain the below piece of code?

    execute immediate with quotes
    'insert #TempTbl ''' || @srv || '.tbl1''' ||
    '{select sum15digit, send_dt ' ||
    'from sumverificationtbl ' ||
    'where send_status = 1 and send_dt <> null} ';

    The above piece of code was in inside a iq sybase proc. Please explain me the abpve code. THanks.

  2. #2
    Join Date
    Feb 2012
    Location
    India,Mumbai
    Posts
    34
    Hi,
    concept of Execute Immediate is - to construct the DML/DDL statement through combination of string and variables.
    In above case insert statement has been constructed through local variables and executed it through ‘execute immediate’ utility of Sybase.

  3. #3
    Join Date
    Jun 2013
    Posts
    5
    Hi Suraj,
    Thanks for u r reply, could u pls clarify the belwo stmt

    'insert #TempTbl ''' || @srv || '.tbl1''' ||
    '{select sum15digit, send_dt ' ||
    'from sumverificationtbl ' ||
    'where send_status = 1 and send_dt <> null}

  4. #4
    Join Date
    Dec 2012
    Location
    Logan, Utah
    Posts
    163
    The code is inserting 2 columns into a temp table using a select statement and a conditional from the sumverificationtbl table.

    Please type your questions using whole words. It drives me nuts 2 c 1 chr.

Tags for this Thread

Posting Permissions

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