Archives of the TeradataForum
Message Posted: Mon, 10 Jun 2013 @ 15:28:18 GMT
<-- Anonymously Posted: Monday, June 10, 2013 08:56 -->
I'm trying to select a enclose character values within quotes in dynamic SQL in a procedure and failing miserably. Can you kindly help me out here.
I have tried to show in a small script below what I?m trying to do. I have to encapuslate the values in charval from chartest within single quotes and insert it into Proctest table.
i.e if chartest has values abc, def etc, proctest must have 'abc','def' and so on. In normal SQL, this of course is quite simple but I'm strugging to do this within the dynamic SQL construct. Requesting your inputs.
REPLACE PROCEDURE charinstest ( ) L1: BEGIN CALL DBC.SYSEXECSQL ( 'INSERT INTO? ud_gem_ad.proctest (charval) Select'||''||' charval FROM chartest;') ; END L1;
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|