sub-procedures don't see outer scope
------------------------------------

                 Key: CORE-4449
                 URL: http://tracker.firebirdsql.org/browse/CORE-4449
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 3.0 Alpha 2, 3.0 Alpha 1
         Environment: Win7 WI-T3.0.0.31152 Firebird 3.0 Alpha 2
            Reporter: Volker Rehn


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;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to