Solved

Oracle Forms Passing Parameters

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

Join & Write a Comment

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

707 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now