Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 12 Aug 2011 @ 13:26:29 GMT


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


Subj:   Re: How to assign the value od dynamic sql ?
 
From:   sobhan.k.pratim

Try this,

     CREATE PROCEDURE GetEmployeeSalary
     (IN EmpName VARCHAR(100), OUT Salary DEC(10,2))
     BEGIN
     DECLARE SqlStr VARCHAR(1000);
     DECLARE C1 CURSOR FOR S1;
     SET SqlStr = 'SELECT Salary FROM EmployeeTable WHERE EmpName = ?';
     PREPARE S1 FROM SqlStr;
     OPEN C1 USING EmpName;
     FETCH C1 INTO Salary;
     CLOSE C1;
     END;

Cheers.

Sobhan



     
  <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