Solved

Oracle Forms Passing Parameters

Posted on 1998-05-24
2
11,579 Views
Last Modified: 2008-08-31
Hello Developer 2K Users,
I am trying to pass a few parameters from one form to the next form using built-in call_form function
by creating run time parameters in the calling form. How do I capture these parameters in the called form.
Please help me understand the process.
Thanks,
  Venkat.
0
Comment
Question by:Venkat052498
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
sganta earned 50 total points
ID: 1081565
Hai Venkat !

I have the solution for your problem.

Definitions : FORM parameters are variables of TYPE char,number, or date that you define
at design time.

Let us assume that I am calling form in this script.

** Example:   Calls a form, passing a parameter list if the
**            parameter list exists.
   Here it passes the city_name and City_date;
*/
DECLARE
  pl_id       ParamList;  
  city_name VARCHAR2(30) := 'BANGALORE'; // You can assign dyanamically;
  city_date DATE := SYSDATE;
BEGIN
  /*
  ** Try to lookup the 'TEMPDATA' parameter list
  */
  pl_id := Get_Parameter_List('tempdata');
 
  IF NOT ID_NULL(pl_id) THEN
      Destroy_Parameter_List(pl_id);
  END IF;

  pl_id := CREATE_PARAMETER_LIST('tempdata');

  ADD_PARAMETER(pl_id,'p_city',TEXT_PARAMETER,city);
  ADD_PARAMETER(pl_id,'p_city_date',TEXT_PARAMETER,TO_CHAR(city_date));

  /* Please note that here you can pass only Text i.e., CHAR parameters, that
     means if it is other than CHAR you have to convert into CHAR function */

  CALL_FORM('XYZ_FORM', HIDE, NO_REPLACE, NO_QUERY_ONLY,pl_id);

END IF;

In the above program I am calling XYZ_FORM by passing parameter list of "TEMPDATA"

which contains 2 parameters
    1. P_City
    2. P_city_date

When you are receiving these parameters in the XYZ_FORM.

You MUST HAVE these PARAMETERS in the XYZ_FORM.

You can declare like this

1. In XYZ_FORM, Click on PARAMETERS.
2. Go to the property sheet of PARAMETER1
    Change the following things
    i) Name = P_CITY   /* It must be the same name that what you are passing */
    ii) Data Type = CHAR
    iii) Maximum Length = 30 //sample
    iv) Close the parameter sheet.
/* Now you have created for one parameter */
3. Similarly Create one more parameter for P_City_date by clicking "new".
    i)  Name = P_CITY_DATE   /* It must be the same name that what you are passing */
    ii) Data Type = DATE
    iii) Close the parameter sheet.
-- Similarly you can have no. of parameters.

To access the values of the above parameters in the XYZ_FORM
append with :PARAMETER.
That is
You can access P_City in Xyz_form by   :PARAMETER.P_CITY
Similarly for P_City_Date is :PARAMETER.P_CITY_DATE.

I hope this is more than sufficient and it is acceptable to you
Thanks and Regards - SGANTA
0
 

Author Comment

by:Venkat052498
ID: 1081566
 Thanks for your answer ,which has worked for me.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
Via a live example, show how to take different types of Oracle backups using RMAN.

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question