Home » Developer & Programmer » Forms » what is the different between parameters and global varibals ???
icon9.gif  what is the different between parameters and global varibals ??? [message #138985] Mon, 26 September 2005 03:52 Go to next message
sharogrammer
Messages: 2
Registered: September 2005
Location: Egypt
Junior Member
hiii ...
i hope someone help me with this ...???
What is the different if i use parameter from the parmeter list or using a global variable .... Specially with reports ????
Re: what is the different between parameters and global varibals ??? [message #139210 is a reply to message #138985] Mon, 26 September 2005 18:24 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Try searching this forum for 'parameter' and 'global'. I think this has been answered more fully previously.

A parameter can be passed between the two Oracle products but a global can not.

In Forms, a parameter is passed when another form is started, but a global can be set so that when control is returned the calling form can 'know' what has happened. If working in a single session you can use database variables to pass information.

David
icon9.gif  Re: what is the different between parameters and global varibals ??? [message #139271 is a reply to message #138985] Tue, 27 September 2005 03:40 Go to previous messageGo to next message
sixthpurgatory
Messages: 12
Registered: September 2005
Location: indonesia
Junior Member

It doesn't help much [sorry, but that's the truth]...

Here's my condition :
In the WHEN-NEW-FORM-INSTANCE trigger, I use :

declare
pl_id ParamList;
begin
pl_id := create_parameter_list('npk');
add_parameter(pl_id,'kunci',TEXT_PARAMETER,'blablabla');
end;


and in the same form, when I want to fetch that parameter, it works. But, when I pass the Parameter list to another form in WHEN-BUTTON-PRESSED trigger, like this :

declare
pl_id PARAMLIST;
temp varchar2(2000);
begin
pl_id := GET_PARAMETER_LIST('npk');
get_parameter_attr(pl_id,'kunci',temp,:bparam.param);
OPEN_FORM('C:\v_form\Parameter\Param2.fmx', activate, no_session, pl_id);
end;


It doesn't work at all. There is a message box writes :
FRM-47023 : No such parameter named KUNCI exists in form PARAM2
I don't know what's the meaning of it...

Can somebody help me ? Thx before.

Regards,

V

[Updated on: Tue, 27 September 2005 04:12]

Report message to a moderator

icon9.gif  Re: what is the different between parameters and global varibals ??? [message #139273 is a reply to message #138985] Tue, 27 September 2005 03:45 Go to previous messageGo to next message
sixthpurgatory
Messages: 12
Registered: September 2005
Location: indonesia
Junior Member

I forget something Razz

I don't create any parameter in the OBJECT NAVIGATOR. I want to manipulate the PARAMETER at runtime. But somehow, the PARAMETER id cannot be received by the second form.
Re: what is the different between parameters and global varibals ??? [message #139407 is a reply to message #139273] Tue, 27 September 2005 20:56 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
For a full description of the difference between a global and a parameter - read a book.

Oracle Form is not a dynamic product. You say
Quote:

FRM-47023 : No such parameter named KUNCI exists in form PARAM2
I don't know what's the meaning of it...
What it means is that 'No such parameter named KUNCI exists in form PARAM2'. You have to define it to use it. The parameter block is exactly the same as any other block. You can't use ':emp.id' if you have not defined 'id' in the 'emp' block. Same here, you can't use 'kunci' as ':parameter.kunci' unless you define 'kunci' in the 'parameter' block. This is not a dynamic language. Forms needs to know whether it is a character, number, or date. 'First use' rules don't apply to Oracle Forms.

Check out some of the 'global' threads for how people are passing dynamic stuff.

David
icon5.gif  Re: what is the different between parameters and global varibals ??? [message #139412 is a reply to message #138985] Tue, 27 September 2005 21:42 Go to previous messageGo to next message
sixthpurgatory
Messages: 12
Registered: September 2005
Location: indonesia
Junior Member

Wait... do you mean that we cannot pass some values using parameter to another form ? Or do you mean that we must define the same parameter in all form to pass the values ? Like I've mentioned before, the other threads [and don't for get, the form help too] don't help me much [sorry again, but that's the truth]. I'm a little bit confused now. Is there any better explanation for this "PARAMETER" things ?

Regards,

V

PS : Oh... About the book... it is veryyyy difficult to find one, especially about form and report.
Re: what is the different between parameters and global varibals ??? [message #139413 is a reply to message #139412] Tue, 27 September 2005 22:07 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Yes ... to pass a parameter it must be defined in the receiving form, and many people often define them in the calling form but that is not really necessary.

Please reread my previous explanation. :PARAMETER is a BLOCK. The values in parameter items are loaded when the new form is called. There must be a NAME for each item and they must have the same datatype as when the parameter list was built.

Books - I think I will build a sticky FAQ for them, but just search this forum for 'book' and 'documentation' and 'free'. Please read the sticky and existing FAQ. Go to http://www.oracle.com/technology/documentation/forms.html. Find 'Guidelines for Building Applications' and ''Form Builder Reference'. Also look at http://www.oracle.com/technology/products/forms/index.html.

David
icon14.gif  Re: what is the different between parameters and global varibals ??? [message #139427 is a reply to message #138985] Wed, 28 September 2005 00:04 Go to previous messageGo to next message
sixthpurgatory
Messages: 12
Registered: September 2005
Location: indonesia
Junior Member

Wow, thank you so much for the documentation. I think I'll learn it for some time Laughing .

Well, one more question. About the CREATE_PARAMETER_LIST function. How to use it then ?

Anyway, thx a lot for the link. Thank you so much.

Regards,

V
Re: what is the different between parameters and global varibals ??? [message #139441 is a reply to message #139427] Wed, 28 September 2005 01:00 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
From the 'Form Builder Reference"
-- CREATE_PARAMETER_LIST examples
/*
** Built-in: CREATE_PARAMETER_LIST
** Example: Create a parameter list named 'TEMPDATA'. First
** make sure the list does not already exist, then
** attempt to create a new list. Signal an error
** if the list already exists or if creating the
** list fails.
*/

DECLARE
   pl_id     ParamList;
   pl_name   VARCHAR2 (10) := 'tempdata';
BEGIN
   pl_id  := Get_Parameter_List (pl_name);

   IF Id_Null (pl_id) THEN
      pl_id  := Create_Parameter_List (pl_name);

      IF Id_Null (pl_id) THEN
         Message ('Error creating parameter list ' || pl_name);
         RAISE Form_Trigger_Failure;
      END IF;
   ELSE
      Message ('Parameter list ' || pl_name || ' already exists!');
      RAISE Form_Trigger_Failure;
   END IF;
END;
David
icon10.gif  Re: what is the different between parameters and global variabels ??? [message #139449 is a reply to message #138985] Wed, 28 September 2005 01:45 Go to previous messageGo to next message
sixthpurgatory
Messages: 12
Registered: September 2005
Location: indonesia
Junior Member

oops, wrong question Razz sorry...

I mean, I want to ask, what is the function of paramlist ? If I cannot pass some values to another for using paramlist, and I have to use the :PARAMETER, then the paramlist is useless. Cause the main problem is this :

FRM-47023 : No such parameter named xxx exists in form yyy

It happens when I want to pass the paramlist to another form. Any idea ? Thanx Laughing

Best regards,

V
Re: what is the different between parameters and global variabels ??? [message #139452 is a reply to message #139449] Wed, 28 September 2005 01:54 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Get the reference manual. In it are examples of 'paramlist'. Start with just one parameter eg kunci. Just work through the examples - they DO work.

David
icon10.gif  Re: what is the different between parameters and global varibals ??? [message #139461 is a reply to message #138985] Wed, 28 September 2005 02:27 Go to previous message
sixthpurgatory
Messages: 12
Registered: September 2005
Location: indonesia
Junior Member

NOW I understand Laughing At first, I thought that I didn't have to create parameter for transferring values to another form. Thanks a lot David. Sorry for all those silly questions Razz

Thank you so much.

Best Regards,

V
Previous Topic: cursors
Next Topic: Built-in Alert in 6i
Goto Forum:
  


Current Time: Fri Sep 20 00:45:55 CDT 2024