Home » Developer & Programmer » Forms » Form compile error with accessing external Global variable from PLSQL package
Form compile error with accessing external Global variable from PLSQL package [message #352651] Wed, 08 October 2008 15:54 Go to next message
michaelv
Messages: 20
Registered: November 2006
Location: rockville, MD
Junior Member

I'm trying to compile the form which call an external global variable from plsql package with no luck.

For example, I have procedure in form calls something like A.l_var

l_var is a global variable declared in stored plsql package A.


I keep getting error "component 'l_var' must be declared.


Is there any other ways i can access the global variable l_var?

thanks.
Re: Form compile error with accessing external Global variable from PLSQL package [message #352671 is a reply to message #352651] Wed, 08 October 2008 22:16 Go to previous messageGo to next message
subba99
Messages: 31
Registered: September 2008
Member
when u declare a variables ,procedures ,functions inside a package ,,if u want to access them outside a package ,u must prefix them with package_name

1)Here is an example ,in this example i declare a varible inside a package

package A as

l_var varchar2(20);
end;
2)if u want to access this variable out side the package ,u must prefix it with 'A.l_var' i..e <package_name>.<variable_name>

if u still get an error post the code




Regards
subbu

[Updated on: Wed, 08 October 2008 22:34]

Report message to a moderator

Re: Form compile error with accessing external Global variable from PLSQL package [message #352766 is a reply to message #352671] Thu, 09 October 2008 08:17 Go to previous messageGo to next message
michaelv
Messages: 20
Registered: November 2006
Location: rockville, MD
Junior Member
Thanks.

I don't have the problem of defining the global variable or call it within plsql packages, but within the form.

I actually found one glitch that i should declare it in package spec, instead of body.

Now, when i compile the form i get error stating that i cannot direclty access remote package variable

Example:

In the form, i write small samples

if A.l_var is not null then
Display_Messge (A.l_var)
end if;

Since A.l_var is a global variable from package A, it will return a string or Null if i call it.

The problem is i can't compile it.

thanks.
Re: Form compile error with accessing external Global variable from PLSQL package [message #352774 is a reply to message #352766] Thu, 09 October 2008 09:12 Go to previous message
subba99
Messages: 31
Registered: September 2008
Member
hello michaelv

in first post u told I keep getting error "component 'l_var' must be declared . u will get this type of error when u try to wrong way of calling it in the form .that's why in earlier post i mention like that .

anyhow u this code in your form ,istead of display_message() use
message() built-in function

if A.l_var is not null then
message(A.l_var);
end if;

if u want display message in the form of alert dailog box use this code
if A.l_var is not null then
message(A.l_var);
message(' ');
end if;

note:use some space between ' ' i..e single quotes in empty message built-in function

[Updated on: Thu, 09 October 2008 09:17]

Report message to a moderator

Previous Topic: Blocking alert dialog with more than 3 buttons
Next Topic: Key is not navigating in Hierarchical Tree
Goto Forum:
  


Current Time: Fri Dec 09 17:36:20 CST 2016

Total time taken to generate the page: 0.48625 seconds