Monday 13 March 2017

Oracle Reports - SRW PACKAGE most useful procedures

SRW.BREAK:

This procedure temporarily stops the report execution and displays the read only values of columns and parameter values, Report execution resumes when read only screen accepted.

syntax: SRW.BREAK;

SRW.CONTEXT_FAILURE: (EXCEPTION);

Oracle reports stops execution and raises the error when ever we call a built in procedure in an invalid context. ex: calling a srw.get_page_num from pram form triggers.

SRW.DO_SQL: 
This procedure is used to execute the ddl /dml from report builder. DML are much faster using in plsql rather than DO_SQL.

syntax: SRW.DO_SQL('SQL Statment');

SRW.DO_SQL_FAILURE (EXCEPTION): 

Oracle raises this error when srw.do_sql fails execution. 



SRW.GET_PAGE_NUM: This procedure is used to get the page number of the report. It must be used in thefields format trigger.
page_num ---attribute
Syntax: SRW.GET_PAGE_NUM (page_num);


SRW.SET_FORMAT_ORDER:  This procedure is used to alter the order of execution of main , header & trailer sections of a report. Even though we change the order of execution of these section these will be display by the default order HEADER - MAIN - TRAILER.

This will be used to display the contents of the main section in the header section. So, that we can populate the summarized vales in the header section / trailer sections.

Syntax: SRW.SET_FORMAT_ORDER(SRW.main_section,srw.header_section,srw.trailer_section);




SRW.SET_FIELD :  To conditionally change the field value of char/number/date datatype.

Syntax: SRW.SET_FIELD (object_id [---it is always 0], text CHAR|number NUM|date DATE); 


SRW.SET_MAXROW:  Specifies the maximum number of records that can be fetched from a specified query. used in case your are going to display limited number of rows from the query. it is used to increase the performance.
used only with before report trigger

syntax: SRW.SET_MAXROW (query_name CHAR, maxnum PLS_INTEGER);


SRW.SET_PRINTER_TRAY:  This procedure is used to print the report from different trays. based on conditions we can print some reports in on one color pages and other from different color. etc.,

It must be used with after_report, before_report, between pages.

syntax:  SRW>SET_PRINTER_TRAY('TRAY');

SRW.INTEGER_ERROR (exception): Raises when SRW package program with non integer values.

ex: Srw.message / set_max_row.

SRW.MESSAGE : It is used to display message in report execution. msg numer is of 5 digits length if u provide less than that then it will be padded with zero's.

syntax: SRW.MESSAGE(error number, message);


SRW.NULL_ARGUMENTS (EXCEPTION):
It stops execution when you pass null arguments for any of the procedures,(rw.message,srw.set_max_rows, srw.do_sql, srw.userexits,srw.run_report)....

SRW.PROGRAM_ABORT : Used to stop the report execution explicitly.

Syntax: SRW.PROGRAM_ABORT;


SRW.RUN_REPORT:   This report is used to invoke RWRUN60.

* To run drill down reports (run report from action triggers)
* sending parts of report to multiple recipients.
* sending parts of reports to multiple printers.
* run multiple reports from a single driver report.

If you want to pas prameter form values to srw.run_report then it must be called after before param trigger.


syntax: SRW.RUN_REPORT(COMMAND_LINE CHAR); 


SRW.RUN_REPORT_FAILURE(EXCEPTION) : Oracle stops execution when srw.run_report fails and raise this execption.



SRW.GETERR_RUN : This will get the error message associated with the latest SRW.RUN_REPORT failure.

Syntax: attribute:=srw.geterr_run;


SRW.UNKNOWN_USER_EXIT (EXECPTION) :  Oracle raises this exception when we pass an invalid user exit value.















No comments:

Post a Comment