Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 14 Aug 2002 @ 12:44:36 GMT


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


Subj:   Prepare SQL in stored procedures
 
From:   Larry Londy

I would like to know if it is possible to prepare an sql statement within a stored procedure. Something as simple as the code below

Create Procedure mfrtest(simno char(10))

BEGIN

Prepare My_Query Select sim_mfr_no from valid_mfr where
sim_mfr_no = ?;

Execute My_Query using :simno;
End;

All I want to do is pass a parameter to the stored procedure and then dynamically create the SQL based on certain conditions. Every time I put the prepare statement in the store procedure i get errors.

Any help is greatly appreciated.

LL



     
  <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