Executes a PL/SQL stored procedure that uses the OWA packages to generate XML content, and includes the resulting XML.
XSQL Syntax
<xsql:include-owa>
PLSQL
</xsql:include-owa>
Examples
The following example executes a stored procedure:
<xsql:include-owa>
my_package.my_procedure({@dname});
</xsql:include-owa>
The following example executes PL/SQL statements in an anonymous block:
<xsql:include-owa>
BEGIN
my_package.my_procedure({@dname});
my_other_package.another_procedure;
END;
</xsql:include-owa>
This example executes the stored procedure OwaExample.Validate
and print validation errors back to the XSQL file:
<xsql:include-owa>
OwaExample.Validate('{@param1}','{@param2}');
</xsql:include-owa>
Here is the stored procedure OwaExample.Validate that performs the validation:
CREATE OR REPLACE PACKAGE OwaExample IS
PROCEDURE validate( a varchar2, b varchar2);
END;
/
CREATE OR REPLACE PACKAGE BODY OwaExample IS
PROCEDURE validate( a varchar2, b varchar2) IS
BEGIN
HTP.P('<Status>');
IF SUBSTR(a,1,1) <> 'A' THEN
HTP.P('<Error>First argument has to
start with "A"</Error>');
END IF;
IF SUBSTR(b,1,1) <> 'B' THEN
HTP.P('<Error>Second argument has
to start with "B"</Error>');
END IF;
HTP.P('</Status>');
END;
END;
/
Description
The <xsql:include-owa> tag executes a PL/SQL stored procedure
that uses the OWA packages to generate XML content, and includes the resulting
XML. Use the OWA panel to enter the required PL/SQL code. This tag is typically
used to print tagged data back to the XSQL file.
The <xsql:include-owa> tag has no attributes.