You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SP with 2 sub-procedures. sub1 and sub2 don't see anything from their outer scope, no params and no other sub-procedures declared in test. sub1 of course uses its own input param i. To reproduce uncomment lines in sub2.
CREATE PROCEDURE TEST (
I INTEGER
)
RETURNS (
O VARCHAR(100)
)
AS
declare outer_var int;
declare procedure sub1 (i varchar(20)) returns (out varchar(20)) as
begin
out = i;
suspend;
end
declare procedure sub2 returns (out int) as
begin
-- out = :i;
-- out = :outer_var;
out = 2;
suspend;
end
begin
outer_var = 1;
select out from sub1('xx') into :o;
suspend;
select out from sub2 into :o;
suspend;
end;
The text was updated successfully, but these errors were encountered:
Limitations:
2) Currently, a subroutine may not directly access or use variables, cursors or another
subroutines of the main statements. This may be allowed in the future.
asfernandes
changed the title
All sub-procedures to access variables/cursors defined at the outer/parent level [CORE4449]
Allow sub-procedures to access variables/cursors defined at the outer/parent level [CORE4449]
Jan 4, 2022
asfernandes
changed the title
Allow sub-procedures to access variables/cursors defined at the outer/parent level [CORE4449]
Allow sub-routines to access variables/cursors defined at the outer/parent level [CORE4449]
Jan 4, 2022
asfernandes
changed the title
Allow sub-routines to access variables/cursors defined at the outer/parent level [CORE4449]
Allow sub-routines to access variables/parameters defined at the outer/parent level [CORE4449]
Jan 29, 2022
Submitted by: Volker Rehn (vr2_s18)
SP with 2 sub-procedures. sub1 and sub2 don't see anything from their outer scope, no params and no other sub-procedures declared in test. sub1 of course uses its own input param i. To reproduce uncomment lines in sub2.
CREATE PROCEDURE TEST (
I INTEGER
)
RETURNS (
O VARCHAR(100)
)
AS
declare outer_var int;
declare procedure sub1 (i varchar(20)) returns (out varchar(20)) as
begin
out = i;
suspend;
end
declare procedure sub2 returns (out int) as
begin
-- out = :i;
-- out = :outer_var;
out = 2;
suspend;
end
begin
outer_var = 1;
select out from sub1('xx') into :o;
suspend;
select out from sub2 into :o;
suspend;
end;
The text was updated successfully, but these errors were encountered: