Oracle9i Application Server PL/SQL Web Toolkit Reference Release 1.0.2.2 Part Number A90101-01 |
|
The owa_util package contains utility subprograms for performing operations such as getting the value of CGI environment variables, printing the data that is returned to the client, and printing the results of a query in an HTML table.
The owa_util contains three types of utility subprograms.
owa_util.bind_variables function - prepares a SQL query and binds variables to it.
owa_util.calendarprint procedure - prints a calendar.
owa_util.cellsprint procedure - prints the contents of a query in an HTML table.
owa_util.choose_date procedure - generates HTML form elements that allow the user to select a date.
owa_util.dateType data type - data type to hold date information.
owa_util.get_cgi_env function - returns the value of the specified CGI environment variable.
owa_util.get_owa_service_path function - returns the full virtual path for the PL/SQL Gateway.
owa_util.get_procedure function - returns the name of the procedure that is invoked by the PL/SQL Gateway.
owa_util.http_header_close procedure - closes the HTTP header.
owa_util.ident_arr data type - a data type
owa_util.ip_address data type - used by the owa_sec.get_client_ip function.
owa_util.listprint procedure - generates a HTML form element that contains data from a query.
owa_util.mime_header procedure - generates the Content-type line in the HTTP header.
owa_util.print_cgi_env procedure - generates a list of all CGI environment variables and their values.
owa_util.redirect_url procedure - generates the Location line in the HTTP header.
owa_util.showpage procedure - prints a page generated by the htp and htf packages in SQL*Plus.
owa_util.showsource procedure - prints the source for the specified subprogram.
owa_util.signature procedure - prints a line that says that the page is generated by the PL/SQL Agent.
owa_util.status_line procedure - generates the Status line in the HTTP header.
owa_util.tablePrint function - prints the data from a table in the database as an HTML table.
owa_util.todate function - converts dateType data to the standard PL/SQL date type.
owa_util.who_called_me procedure - returns information on the caller of the procedure.
This function prepares a SQL query by binding variables to it, and stores the output in an opened cursor. Use this function as a parameter to a procedure sending a dynamically generated query. Specify up to 25 bind variables.
This procedure creates a calendar in HTML. Each date in the calendar can contain any number of hypertext links. Design your query as follows:
This procedure has 2 versions. Version 1 uses a hard-coded query stored in a varchar2 string. Version 2 uses a dynamic query prepared with the owa_util.bind_variables function.
This procedure generates an HTML table from the output of a SQL query. SQL atomic data items are mapped to HTML cells and SQL rows to HTML rows. You must write the code to begin and end the HTML table. There are nine versions of this procedure:
The sixth through ninth versions are the same as the first four versions, except that they return a row count output parameter.
Properties | Definitions |
---|---|
Syntax: |
owa_util.cellsprint( p_colCnt in integer p_resultTbl in vc_arr p_format_numbers in varchar2 DEFAULT NULL); |
|
owa_util.cellsprint( p_theQuery in varchar2 p_max_rows in number DEFAULT 100 p_format_numbers in varchar2 DEFAULT NULL); |
|
owa_util.cellsprint( p_theCursor in integer p_max_rows in number DEFAULT 100 p_format_numbers in varchar2 DEFAULT NULL); |
|
owa_util.cellsprint( p_theQuery in varchar2 p_max_rows in number DEFAULT 100 p_format_numbers in varchar2 DEFAULT NULL p_skip_rec in numbe DEFAULT 0 p_more_data out boolean); |
|
owa_util.cellsprint( p_theCursor in integer p_max_rows in number DEFAULT 100 p_format_numbers in varchar2 DEFAULT NULL p_skip_rec in number DEFAULT 0 p_more_data out boolean); |
|
owa_util.cellsprint( p_theQuery in varchar2 p_max_rows in number DEFAULT 100 p_format_numbers in varchar2 DEFAULT NULL p_reccnt out number); |
|
owa_util.cellsprint( p_theCursor in integer p_max_rows in number DEFAULT 100 p_format_numbers in varchar2 DEFAULT NULL p_reccnt out number); |
|
owa_util.cellsprint( p_theQuery in varchar2 p_max_rows in number DEFAULT 100 p_format_numbers in varchar2 DEFAULT NULL p_skip_rec in number DEFAULT 0 p_more_data out boolean p_reccnt out number); |
|
owa_util.cellsprint( p_theCursor in integer p_max_rows in number DEFAULT 100 p_format_numbers in varchar2 DEFAULT NULL p_skip_rec in number DEFAULT 0 p_more_data out boolean p_reccnt out number); |
Parameters: |
p_colCnt - the number of columns in the table. p_theQuery - a SQL SELECT statement. p_theCursor - a cursor ID. This can be the return value from the owa_util.bind_variables function. p_max_rows - the maximum number of rows to print. p_format_numbers - if the value of this parameter is not NULL, number fields are right-justified and rounded to two decimal places. p_skip_rec - the number of rows to exclude from the HTML table. p_more_data - TRUE if there are more rows in the query or cursor, FALSE otherwise. p_reccnt - the number of rows that have been returned by the query. This value does not include skipped rows (if any). p_resultTbl - the index table which will contain the result of the query. Each entry in the query will correspond to one column value. |
Generates: |
<tr><td>QueryResultItem</td><td>QueryResultItem</td></tr> <tr><td>QueryResultItem</td><td>QueryResultItem</td></tr> |
This procedure generates three HTML form elements that allow the user to select the day, the month, and the year. The parameter in the procedure that receives the data from these elements must be a owa_util.dateType data type. Use the owa_util.todate function to convert the owa_util.dateType data type value to the standard Oracle7 DATE data type.
The owa_util.todate function converts an item of this type to the type DATE, which is understood and properly handled as data by the database. The procedure owa_util.choose_date procedure enables the user to select the desired date.
Properties | Definitions |
---|---|
Syntax: |
type dateType is table of varchar2(10) index by binary_integer; |
Returns: |
Not applicable. |
This function returns the value of the specified CGI environment variable. Although the WRB is not operated through CGI, many WRB cartridges, including the PL/SQL Gateway, can make use of CGI environment variables.
This function returns the full virtual path of the PL/SQL Gateway that is handling the request.
Properties | Definitions |
---|---|
Syntax: |
owa_util.get_owa_service_path return varchar2; |
Parameters: |
None. |
Returns: |
A virtual path of the PL/SQL Gateway that is handling the request. |
This function returns the name of the procedure that is being invoked by the PL/SQL Gateway.
Properties | Definitions |
---|---|
Syntax: |
owa_util.get_procedure return varchar2; |
Parameters: |
None. |
Returns: |
The name of a procedure, including the package name if the procedure is defined in a package. |
This procedure generates a newline character to close the HTTP header. Use this procedure if you have not closed the header by using the bclose_header parameter in calls such as owa_util.mime_header procedure, owa_util.redirect_url procedure, or owa_util.status_line procedure. The HTTP header must be closed before any htp.print
or htp.prn
calls.
Properties | Definitions |
---|---|
Syntax: |
owa_util.http_header_close; |
Parameters: |
None. |
Generates: |
A newline character, which closes the HTTP header. |
This data type is used for an array.
Properties | Definitions |
---|---|
Syntax: |
type ident_arr is table of varchar2(30) index by binary_integer; |
Returns: |
Not applicable. |
This data type is used by the owa_sec.get_client_ip function.
Properties | Definitions |
---|---|
Syntax: |
type ip_address is table of integer index by binary_integer; |
Returns: |
Not applicable. |
This procedure generates an HTML selection list form element from the output of a SQL query. The columns in the output of the query are handled in the following manner:
There are two versions of this procedure. The first version contains a hard-coded SQL query, and the second version uses a dynamic query prepared with the owa_util.bind_variables function.
Properties | Definitions |
---|---|
Syntax: |
owa_util.listprint( p_theQuery in varchar2 p_cname in varchar2 p_nsize in number p_multiple in boolean DEFAULT FALSE); owa_util.listprint( p_theCursor in integer p_cname in varchar2 p_nsize in number p_multiple in boolean DEFAULT FALSE); |
Parameters: |
p_theCursor - the cursor ID. This can be the return value from the owa_util.bind_variables function. p_cname - the name of the HTML form element. p_nsize - the size of the form element (this controls how many items the user can see without scrolling). p_multiple - whether multiple selection is permitted. |
Generates: |
<SELECT NAME="p_cname" SIZE="p_nsize"> <OPTION SELECTED value='value_from_the_first_column'>value_from_ the_second_column <OPTION SELECTED value='value_from_the_first_column'>value_from_ the_second_column ... </SELECT> |
This procedure changes the default MIME header that the script returns. This procedure must come before any htp.prin
t or htp.prn
calls to direct the script not to use the default MIME header.
This procedure generates all the CGI environment variables and their values made available by the PL/SQL Gateway to the stored procedure.
Properties | Definitions |
---|---|
Syntax: |
owa_util.print_cgi_env; |
Parameters: |
None. |
Generates: |
A list in the following format: cgi_env_var_name = value\n |
This procedure specifies that the application server is to visit the specified URL. The URL may specify either a web page to return or a program to execute. This procedure must come before any htp or htf procedure or function call.
This procedure prints out the HTML output of a procedure in SQL*Plus, SQL*DBA, or Oracle Server Manager. The procedure must use the htp
or htf
packages to generate the HTML page, and this procedure must be issued after the procedure has been called and before any other HTP or HTF subprograms are directly or indirectly called. This method is useful for generating pages filled with static data. This procedure uses dbms_output and is limited to 255 characters per line and an overall buffer size of 1,000,000 bytes.
This procedure prints the source of the specified procedure, function, or package. If a procedure or function which belongs to a package is specified, then the entire package is displayed.
This procedure generates an HTML line followed by a signature line on the HTML document. If a parameter is specified, the procedure also generates a hypertext link to view the PL/SQL source for that procedure. The link calls the owa_util.showsource procedure.
This procedure sends a standard HTTP status code to the client. This procedure must come before any htp.print
or htp.prn
calls so that the status code is returned as part of the header, rather than as "content data".
This function generates either preformatted tables or HTML tables (depending on the capabilities of the user's browser) from database tables. RAW columns are supported, but LONG RAW columns are not. References to LONG RAW columns will print the result `Not Printable'. In this function, cattributes is the second, rather than the last, parameter.
DEPTNO | DNAME | LOC |
---|---|---|
10 |
ACCOUNTING |
NEW YORK |
20 |
RESEARCH |
DALLAS |
30 |
SALES |
CHICAGO |
This function converts the owa_util.dateType data type to the standard Oracle database DATE type.
Properties | Definitions |
---|---|
Syntax: |
owa_util.todate(p_dateArray in dateType) return date; |
Parameters: |
p_dateArray - the value to convert. |
Generates |
A standard DATE. |
This procedure returns information (in the form of output parameters) about the PL/SQL code unit that invoked it.
|
Copyright © 2001 Oracle Corporation. All Rights Reserved. |
|