Solved

Oracle Forms Passing Parameters

Posted on 1998-05-24
2
11,386 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that useā€¦
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

809 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