Archives of the TeradataForum
Message Posted: Fri, 05 Mar 2004 @ 11:45:38 GMT
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
|