Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 05 Mar 2004 @ 11:45:38 GMT


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


Subj:   Re: Store procedure Select into
 
From:   naresh.x.mudunuru

Can you plz provide your SP definiton. Following is a small example that works fine:

 BTEQ -- Enter your DBC/SQL request or BTEQ command:

show procedure sp;

show procedure sp;

 *** Text of DDL statement returned.
 *** Total elapsed time was 1 second.

------------------------------------------------------------------------
--------

replace procedure sp (out j int)
begin
select count(*) from mytab into :j where c2 like 'a%';
end;



 BTEQ -- Enter your DBC/SQL request or BTEQ command:
call sp(j);

call sp(j);

 *** Procedure has been executed.
 *** Total elapsed time was 1 second.

          j
-----------
          3

Another version :
------------------------

 BTEQ -- Enter your DBC/SQL request or BTEQ command:
show procedure sp;

show procedure sp;

 *** Text of DDL statement returned.
 *** Total elapsed time was 1 second.

------------------------------------------------------------------------
--------

replace procedure sp (out j int)
begin
declare i int;
select count(*) from mytab into :i where c2 like 'a%';
set j=i;
end;



 BTEQ -- Enter your DBC/SQL request or BTEQ command:
call sp(j);

call sp(j);

 *** Procedure has been executed.
 *** Total elapsed time was 1 second.

          j
-----------
          3

 BTEQ -- Enter your DBC/SQL request or BTEQ command:

Thanks



     
  <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