Tuesday, May 7, 2013

(SQR 4407) Referenced variables not defined

There are 2 causes of this issue to occur.

1. Code between Begin-Select and End-select are not correctly formatted
or
2. check for variable which got error out, if the variable is referenced inside a procedure which have parameters (Called as function) and also referenced outside the issue occurs, the solution will be pass the referenced variable as parameter to the procedure.

Example for 2:

begin-select
----
----
    let $emplid=&emplid
----
----
end-select
do proc1($setid)


begin-procedure proc1($setid)
begin-select
----
---
where emplid = $emplid and setid=$setid
----
end-select
end-procedure

should be changed as below


begin-select
----
----
    let $emplid=&emplid
----
----
end-select
do proc1($setid,$emplid)


begin-procedure proc1($setid,$emplid)
begin-select
----
---
where emplid = $emplid and setid=$setid
----
end-select
end-procedure

3 comments:

Anonymous said...

Thanks.

Anonymous said...

Thanks. This helped me.

Krishan said...

Thanks Ramu, this really helped us to resolve a critical issue.