|
|
Archives of the TeradataForum
Message Posted: Thu, 08 Apr 2004 @ 10:01:38 GMT
Subj: | | Re: Stored procedure OUT parameter |
|
From: | | Padmini_Bhattiprolu |
Hi,
Yes. You can do that. Please find the test results, would help.
Thanks, Padmini
BTEQ -- Enter your DBC/SQL request or BTEQ command:
.compile file sp1.spl
.compile file sp1.spl
*** Procedure has been replaced.
*** Total elapsed time was 10 seconds.
BTEQ -- Enter your DBC/SQL request or BTEQ command:
.export data file /tmp/mini
.export data file /tmp/mini
*** To reset export, type .EXPORT RESET
BTEQ -- Enter your DBC/SQL request or BTEQ command:
call sp1(1, p2);
call sp1(1, p2);
*** Success, Stmt# 1 ActivityCount = 1
*** Procedure has been executed.
*** Total elapsed time was 1 second.
BTEQ -- Enter your DBC/SQL request or BTEQ command:
.export reset
.export reset
*** Output returned to console.
BTEQ -- Enter your DBC/SQL request or BTEQ command:
.import data file /tmp/mini
.import data file /tmp/mini
BTEQ -- Enter your DBC/SQL request or BTEQ command:
using (i int) sel :i;
using (i int) sel :i;
*** Query completed. One row found. One column returned.
*** Total elapsed time was 1 second.
i
-----------
1
BTEQ -- Enter your DBC/SQL request or BTEQ command:
show procedure sp1;
show procedure sp1;
*** Text of DDL statement returned.
*** Total elapsed time was 1 second.
---------------------------------------------------------------------------
replace procedure sp1 (in p1 int, out p2 int)
begin
set p2=p1;
end;
BTEQ -- Enter your DBC/SQL request or BTEQ command:
call sp1(1, p2);
call sp1(1, p2);
*** Procedure has been executed.
*** Total elapsed time was 1 second.
p2
-----------
1
BTEQ -- Enter your DBC/SQL request or BTEQ command:
| |