Solved

Oracle Forms Passing Parameters

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

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

729 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