Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 10 Jun 2013 @ 15:28:18 GMT


     
  <Prev Next>  
<<First
<Prev
Next> Last>>  


Subj:   Selecting single quotes within dynamic SQL
 
From:   Anomy Anom

<-- Anonymously Posted: Monday, June 10, 2013 08:56 -->

Dear All,

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;

Regards



     
  <Prev Next>  
<<First
<Prev
Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023