Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Sat, 23 Nov 2002 @ 01:44:36 GMT


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


Subj:   Re: Syntax error in Stored Procedure
 
From:   Sam bass

Syed,

I recently ran into this issue, and here's what I found.

CALL DBC.SysExecSQL('SELECT COUNT(*) INTO :rowcount from :TableNames');

Your entire DML statement is being treated as a string, because of the ''. You need to seperate your variables out, like this:

CALL DBC.SysExecSQL( 'SELECT Count(*) AS CNT INTO ' || :rowcount ||
'FROM || :TableNames || ';' );

Note 2 additions to your original. You need to Name all expressions in Select Into statements. Also, I've found (V2R4.13) that a DynamicSQL statement needs to include a ';'.


Hope this helps,

Sam



     
  <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