Solved

wrong number of argument error when calling report from forms 11gR2

Posted on 2015-02-03
12
417 Views
Last Modified: 2015-02-06
hi am trying to call report in form 11gR2

this is the procedure
PROCEDURE run_reports (rep_id IN Varchar2,
                       command_id Varchar2,
                       unit_id IN Varchar2,
                       dept_id IN Varchar2,
                       mec_id IN Varchar2,
                       syc_id IN Varchar2,
                       baseline_id IN Varchar2,
                       fail_id IN Varchar2,
                       upper_dev IN Varchar2,
                       lower_dev IN Varchar2,
                       min_avail IN Varchar2,
                       start_date IN Varchar2,
                       end_date IN Varchar2,
                       combined_mec IN Varchar2,
                       nsn IN Varchar2) IS
  pl_id ParamList;
/* */  
BEGIN
  pl_id := Get_Parameter_List('tmpdata');
  IF NOT Id_Null(pl_id) THEN
      Destroy_parameter_list(pl_id);
  END IF;
  pl_id := Create_parameter_list('tmpdata');
  
  Add_parameter(pl_id, 'COMMAND' ,TEXT_PARAMETER, command_id);
  Add_parameter(pl_id, 'UNIT' ,TEXT_PARAMETER, unit_id);
  Add_parameter(pl_id, 'DEPARTMENT' ,TEXT_PARAMETER, dept_id);
  Add_parameter(pl_id, 'MAIN_EQUIPMENT_CODE' ,TEXT_PARAMETER, mec_id);
  Add_parameter(pl_id, 'SYSTEM_CODE' ,TEXT_PARAMETER, syc_id);
  Add_parameter(pl_id, 'BASELINE' ,TEXT_PARAMETER, baseline_id);
  Add_parameter(pl_id, 'FAILURE' ,TEXT_PARAMETER, fail_id); 
  Add_parameter(pl_id, 'UPPER' ,TEXT_PARAMETER, upper_dev);
  Add_parameter(pl_id, 'LOWER' ,TEXT_PARAMETER, lower_dev);
  Add_parameter(pl_id, 'MIN_AVAIL' ,TEXT_PARAMETER, min_avail);
  Add_parameter(pl_id, 'START_DATE' ,TEXT_PARAMETER, start_date);
  Add_parameter(pl_id, 'END_DATE' ,TEXT_PARAMETER, end_date);
  Add_parameter(pl_id, 'COMBINED_MEC' ,TEXT_PARAMETER, combined_mec);
  Add_parameter(pl_id, 'NSN' ,TEXT_PARAMETER, nsn);
  Add_parameter(pl_id, 'PARAMFORM' ,TEXT_PARAMETER, 'NO');
  Add_parameter(pl_id, 'ORIENTATION' ,TEXT_PARAMETER, 'LANDSCAPE');
  Add_parameter(pl_id, 'DESTYPE' ,TEXT_PARAMETER, 'PREVIEW');

 -- RUN_PRODUCT(REPORTS, rep_id, SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL);
  
 --  RUN_REPORT_OBJECT(REPORTS, rep_id, SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL);
   
   SET_REPORT_OBJECT_PROPERTY(REPORTS, rep_id, SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL);

am geting wrong number of argument

END;

Open in new window

0
Comment
Question by:chalie001
  • 6
  • 3
  • 2
  • +1
12 Comments
 
LVL 16

Expert Comment

by:Wasim Akram Shaik
ID: 40586239
As error suggests.. you are trying to invoke/call a procedure which has either more or less number of arguments which it is expected as input..

check the procedure call..i think you had posted the procedure which you think the error message had reported.. where in you have to correct the code where this procedure is being called..

ie., in a simple way..

count the number of parameters from the invoking code, count the number of parameters in the actual procedure code.. both should match..
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 40586803
I'm unable to locate the specific document that shows the allowed syntax for SET_REPORT_OBJECT_PROPERTY but all the examples I find have report_id as the first parameter.

I see no examples with a parameter before it so my guess it is REPORTS that is causing the error.
0
 

Author Comment

by:chalie001
ID: 40587915
i did like this  SET_REPORT_OBJECT_PROPERTY(rep_id, SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL); but still geting error am not calling a procedure am calling a report
0
 

Author Comment

by:chalie001
ID: 40587918
even this still geve error
RUN_REPORT_OBJECT(rep_id, SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL);
0
 

Author Comment

by:chalie001
ID: 40587982
i use this and it works
RP2RRO.setDestype( 'PREVIEW');

  rp2rro.rp2rro_run_product(REPORTS, rep_id, SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL);
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 40588000
slightwv is right about first parameter:
 
report_id
     Specifies the unique ID of the report to be run. You can get the report ID for a particular report using the Built-in FIND_REPORT_OBJECT

There are another problems:
1) this is wrong: SET_REPORT_OBJECT_PROPERTY(rep_id, SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL);
because SET_REPORT_OBJECT_PROPERTY built-in has only 3 parameters.

This example is from on-line help:
SET_REPORT_OBJECT_PROPERTY Examples

DECLARE
 repid REPORT_OBJECT;
 report_prop VARCHAR2(20);
BEGIN
 repid := find_report_object('report4');
 SET_REPORT_OBJECT_PROPERTY(repid, REPORT_EXECUTION_MODE, BATCH);
 SET_REPORT_OBJECT_PROPERTY(repid, REPORT_COMM_MODE, SYNCHRONOUS);
 SET_REPORT_OBJECT_PROPERTY(repid, REPORT_DESTYPE, FILE);
END;

2) RUN_REPORT_OBJECT(rep_id, SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL); is also wrong, because RUN_REPORT_OBJECT built-in has 1 or 2 parameters - second is parameter list.
This example is also from on-line help:

RUN_REPORT_OBJECT Example
 DECLARE
 repid REPORT_OBJECT;
 v_rep VARCHAR2(100);
 rep_status VARCHAR2(20);
BEGIN
 repid := FIND_REPORT_OBJECT('report4');
 v_rep := RUN_REPORT_OBJECT(repid); --or  v_rep := RUN_REPORT_OBJECT(repid,pl_id);
 ...
END;
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:chalie001
ID: 40588489
i did this
 repid := FIND_REPORT_OBJECT('REPORTS');
    v_rep := RUN_REPORT_OBJECT(repid,pl_id);

but am geting this error
expression 'REPID' cannot be used as an assigment
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 40588499
Please show the complete code.
0
 

Author Comment

by:chalie001
ID: 40588556
PROCEDURE run_reports (rep_id IN Varchar2,
                       command_id Varchar2,
                       unit_id IN Varchar2,
                       dept_id IN Varchar2,
                       mec_id IN Varchar2,
                       syc_id IN Varchar2,
                       baseline_id IN Varchar2,
                       fail_id IN Varchar2,
                       upper_dev IN Varchar2,
                       lower_dev IN Varchar2,
                       min_avail IN Varchar2,
                       start_date IN Varchar2,
                       end_date IN Varchar2,
                       combined_mec IN Varchar2,
                       nsn IN Varchar2,
                       repid REPORT_OBJECT,
                       v_rep VARCHAR2,
                       rep_status VARCHAR2) IS
  pl_id ParamList;
/* */  
BEGIN
  pl_id := Get_Parameter_List('tmpdata');
  IF NOT Id_Null(pl_id) THEN
      Destroy_parameter_list(pl_id);
  END IF;
  pl_id := Create_parameter_list('tmpdata');
  
  Add_parameter(pl_id, 'COMMAND' ,TEXT_PARAMETER, command_id);
  Add_parameter(pl_id, 'UNIT' ,TEXT_PARAMETER, unit_id);
  Add_parameter(pl_id, 'DEPARTMENT' ,TEXT_PARAMETER, dept_id);
  Add_parameter(pl_id, 'MAIN_EQUIPMENT_CODE' ,TEXT_PARAMETER, mec_id);
  Add_parameter(pl_id, 'SYSTEM_CODE' ,TEXT_PARAMETER, syc_id);
  Add_parameter(pl_id, 'BASELINE' ,TEXT_PARAMETER, baseline_id);
  Add_parameter(pl_id, 'FAILURE' ,TEXT_PARAMETER, fail_id); 
  Add_parameter(pl_id, 'UPPER' ,TEXT_PARAMETER, upper_dev);
  Add_parameter(pl_id, 'LOWER' ,TEXT_PARAMETER, lower_dev);
  Add_parameter(pl_id, 'MIN_AVAIL' ,TEXT_PARAMETER, min_avail);
  Add_parameter(pl_id, 'START_DATE' ,TEXT_PARAMETER, start_date);
  Add_parameter(pl_id, 'END_DATE' ,TEXT_PARAMETER, end_date);
  Add_parameter(pl_id, 'COMBINED_MEC' ,TEXT_PARAMETER, combined_mec);
  Add_parameter(pl_id, 'NSN' ,TEXT_PARAMETER, nsn);
  Add_parameter(pl_id, 'PARAMFORM' ,TEXT_PARAMETER, 'NO');
  Add_parameter(pl_id, 'ORIENTATION' ,TEXT_PARAMETER, 'LANDSCAPE');
  Add_parameter(pl_id, 'DESTYPE' ,TEXT_PARAMETER, 'PREVIEW');

repid := FIND_REPORT_OBJECT('REPORTS');
v_rep := RUN_REPORT_OBJECT(repid,pl_id);


am geting wrong number of argument

is there a way i can do this without adding this 3
repid REPORT_OBJECT,
                       v_rep VARCHAR2,
                       rep_status VARCHAR2 
as this procedure is been called somewhere

END;
                                  

Open in new window

0
 

Author Comment

by:chalie001
ID: 40588558
am geting expression 'REPID' cannot be used as an assigment
not am geting wrong number of argument
0
 
LVL 22

Assisted Solution

by:Helena Marková
Helena Marková earned 250 total points
ID: 40588572
I would say that
repid REPORT_OBJECT
cannot be used as input parameter in your procedure:
PROCEDURE run_reports (rep_id IN Varchar2,
                       command_id Varchar2,
                       unit_id IN Varchar2,
                       dept_id IN Varchar2,
                       mec_id IN Varchar2,
                       syc_id IN Varchar2,
                       baseline_id IN Varchar2,
                       fail_id IN Varchar2,
                       upper_dev IN Varchar2,
                       lower_dev IN Varchar2,
                       min_avail IN Varchar2,
                       start_date IN Varchar2,
                       end_date IN Varchar2,
                       combined_mec IN Varchar2,
                       nsn IN Varchar2,
                       repid REPORT_OBJECT,
                       v_rep VARCHAR2,
                       rep_status VARCHAR2) IS
  pl_id ParamList;
and this is the reason why it is not recognized in a procedure body.
0
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 250 total points
ID: 40588604
By default parameters to a procedure are IN and thus, read only.

If you make it IN OUT you should be able to assign it a value.
or
create a local variable and assign it.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Via a live example, show how to take different types of Oracle backups using RMAN.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

705 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

18 Experts available now in Live!

Get 1:1 Help Now