Home » Developer & Programmer » Forms » how 2 share PL/SQL variable between 2 forms (please i need your help)
how 2 share PL/SQL variable between 2 forms [message #483332] Sat, 20 November 2010 08:14 Go to next message
colla
Messages: 36
Registered: January 2010
Location: ksa
Member
hi every one

I need some one to tel me what i missed. I create 2 forms

form 1:


http://www14.0zz0.com/2010/11/20/14/501142368.jpg

I used the Departments table to create this form

in form-level trigger :
When-New-Form-Instance

go_block('departments');
execute_query;


there is a control block with name (CTRL)
there is Exit button with trigger
When-Button-Pressed

exit_form


there is a text item to print the department_id that i select this is for confirmation. I populate this item by (department no) button
When-Button-Pressed

my_data.department := :departments.department_id;
:CTRL.TEXT_ITEM8:= :departments.department_id;


Now this part has the global shared pl/sql variable when i press in the button POPULATE_AND_SEND with a trigger
When-Button-Pressed
my_data.department := :departments.department_id;

OPEN_FORM('c:\Shared_PLSQL_Variables\employees.fmx',ACTIVATE,NO_SESSION,SHARE_LIBRARY_DATA);



- - - - - - - - - - - - - - - - - - - - - - - - -

form 2

http://www7.0zz0.com/2010/11/20/14/675581690.jpg


in this form i used employees table it will display the data that is content in the department selected from the first form it only has
form-level trigger When-New-Form-Instance

IF my_data.department IS NOT NULL THEN
SET_BLOCK_PROPERTY('employees',DEFAULT_WHERE,'department_id='||to_char(my_data.department));
:CTRL.TEXT_ITEM8:= my_data.department;
GO_BLOCK('employees');
EXECUTE_QUERY;
END IF;


this is the code in .pll file that i attached in Attached Libraries

PACKAGE my_data IS
department number;
END;

when I run this forms and press in (DEPARTMENT NO) button it's not display any thing in the text item I received this error
check the link please

http://www5.0zz0.com/2010/11/20/14/621345273.jpg


same error when i press in POPULATE AND SEND button to open the other window and execute query

Any help or advice i greatly appreciated

thanks
Re: how 2 share PL/SQL variable between 2 forms [message #483333 is a reply to message #483332] Sat, 20 November 2010 08:17 Go to previous messageGo to next message
colla
Messages: 36
Registered: January 2010
Location: ksa
Member
this is the employees form
  • Attachment: EMPLOYEES.fmb
    (Size: 56.00KB, Downloaded 1044 times)
Re: how 2 share PL/SQL variable between 2 forms [message #483346 is a reply to message #483333] Sat, 20 November 2010 16:32 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
ORA-06508 is could not find program unit being called. Since the trigger raising the error doesn't call any actual programs that leaves two possibilities:
1) It can't find the pll when running - are you running the forms locally on your pc?
2) It thinks that my_data.department is a procedure or function rather than variable - try writing procedures in the pll to set and get the value of the variable rather than trying to access it directly from the form.

Or you could just use a global variable instead, or a variable in a database package.
Re: how 2 share PL/SQL variable between 2 forms [message #483348 is a reply to message #483346] Sat, 20 November 2010 22:58 Go to previous messageGo to next message
colla
Messages: 36
Registered: January 2010
Location: ksa
Member
hi cookiemonster

greeeeeeeeeeeeeet appreciate your reply

Quote:
It can't find the pll when running


Okay what's your advice

Quote:
are you running the forms locally on your pc?


yees this is my personal PC there is no network here.

Quote:
It thinks that my_data.department is a procedure or function rather than variable - try writing procedures in the pll to set and get the value


no no no it's a package specification with only one variable
and this is the code
PACKAGE my_data IS
department number;
END;


please download this file and attach it to your Attached Libraries for both forms (Departments & Employees)

http://www.4shared.com/file/AyJVQmqe/shared_data.html

Quote:
Or you could just use a global variable instead, or a variable in a database package.


i know cookiemonster i can use a shared global variable or parameter list or global record group but i need your advice to solve this problem pleeeeeeeeez

thanks again


[Updated on: Sat, 20 November 2010 23:01]

Report message to a moderator

Re: how 2 share PL/SQL variable between 2 forms [message #483351 is a reply to message #483348] Sun, 21 November 2010 01:28 Go to previous messageGo to next message
colla
Messages: 36
Registered: January 2010
Location: ksa
Member

hi cookiemonster

I solve it

thanks for your interesting and your time

Re: how 2 share PL/SQL variable between 2 forms [message #483352 is a reply to message #483351] Sun, 21 November 2010 02:02 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It is a good practice to share a solution, so that other people (who have the same problem as you) would benefit from it.
Re: how 2 share PL/SQL variable between 2 forms [message #483355 is a reply to message #483352] Sun, 21 November 2010 05:20 Go to previous messageGo to next message
colla
Messages: 36
Registered: January 2010
Location: ksa
Member
sorry Littlefoot

this is the solution

please read this topic

http://www.oracle.com/webapps/online-help/forms/10g/state/content/navId.3/navSetId._/vtTopicFile.designing_forms|prgmunit_libraries|d g2010~html/

1- attache your .pll file in (PL/SQL Libraries)
2- generate the .plx file by press (Ctrl+Shift+k) and (Ctrl+k) and (Ctrl+t)
3- attache your .pll file in departments and employees forms in Attached Libraries node

Runnnnnnnnn

[Updated on: Sun, 21 November 2010 05:21]

Report message to a moderator

Re: how 2 share PL/SQL variable between 2 forms [message #483357 is a reply to message #483355] Sun, 21 November 2010 06:10 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
So the pll wasn't attached properly.
Re: how 2 share PL/SQL variable between 2 forms [message #483358 is a reply to message #483357] Sun, 21 November 2010 06:19 Go to previous messageGo to next message
colla
Messages: 36
Registered: January 2010
Location: ksa
Member
hi cookiemonster where r u, you leave me

you know what? I remembered when i configure a webutil I should create a .plx file because webutil it's also contain .pll file they are same but i forget . you know

thank you very much cookiemonster

sorry again littlefoot
Re: how 2 share PL/SQL variable between 2 forms [message #483359 is a reply to message #483357] Sun, 21 November 2010 06:20 Go to previous messageGo to next message
colla
Messages: 36
Registered: January 2010
Location: ksa
Member
cookiemonster i write a new topic i want to see your user name there

don't leave me again
Re: how 2 share PL/SQL variable between 2 forms [message #483461 is a reply to message #483359] Mon, 22 November 2010 05:04 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
I think you've got me confused with someone who you pay for assistance.
I've got better things to do on a weekend than hang around waiting for questions from you to answer.
This is a forum of volunteers. We help people as and when we can, but most of us have other things to do as well, including day jobs.

So next time you post a question bear in mind the following:
1) We might not all be online.
2) Those of us who are online might not know the answer to your question. I'm not answering your other thread because I know nothing about OLE2. Hopefully someone else does.

Also can you please stop:
1) Writing words with far more letters than needed - this is a professional forum.
2) Putting messages in the version field - we know you need help, you wouldn't be posting here otherwise, plus the actual version info might be useful.
Re: how 2 share PL/SQL variable between 2 forms [message #483465 is a reply to message #483461] Mon, 22 November 2010 05:29 Go to previous message
colla
Messages: 36
Registered: January 2010
Location: ksa
Member
Quote:
I think you've got me confused with someone who you pay for assistance.


I don't mean it

Pleas accept my apologize

I'm sorry
Previous Topic: Cursor record
Next Topic: How to convert Exponent into pure number
Goto Forum:
  


Current Time: Thu Sep 19 00:25:00 CDT 2024