|
Query analyzer scripts now have support for 4 new client side commands which allow you to execute a
stored procedure with local variables binded to the parameters. This allows for the execution of
procedures with OUT parameters. The commands include print, println, variable and executecallableQuery.
Client side commands are identified by a dot at the beginning of the command line, and multiple
commands can be executed within one batch statement. The schema browser now contains object scripting for
procedures and functions that include "EXECUTE" and "EXECUTE BIND". The script EXECUTE will generate the
appropriate code needed to execute the object according to the database procedural language (ie. PL/SQL, T-SQL).
The EXECUTE BIND will generate the appropriate Aqua Data Studio client side commands to execute the object.
To easily generate the needed client commands to execute a procedure or function, you may browse in the
schema browser to locate the procedure or function and right-click on the object to select "EXECUTE BIND" from
the Script Object menus.
.println [.print]
Syntax:
.println { <variable_name> | 'text value' }[, ... n]
Example:
.println ' Results:', OUTVAR
.variable
Syntax:
.variable <variable_name>, datatype [, value]
Example:
.variable INVAR, NUMBER, 0
.variable OUTVAR, NUMBER, 0
.variable INOUTVAR, DATE, '2005-01-01 12:00:00 AM'
.executeCallableQuery
Syntax:
.executeCallableQuery 'parameter_name<datatype,{in | out | inout}>[, ... n]', <LINE_BREAK>
{ CALL <PROCEDURE_NAME>( ? { , ? ... } ) }
or ...
{ ? = CALL <PROCEDURE_NAME>( ? { , ? ... } ) }
Example:
.executeCallableQuery 'INVAR<NUMBER,in>,OUTVAR<NUMBER,out>,INOUTVAR<DATE,inout>',
BEGIN
SCOTT.FULL_PROCEDURE(?, ?, ?);
END;
|