Download View this document as PDF

Transcript
CHAPTER 6
SQLJ Functions and Stored Procedures
The end user need not know whether the procedure being called is a SQLJ
stored procedure or a Transact-SQL stored procedure. They are both invoked
in the same way.
The SQLJ syntax for create procedure is:
create procedure [owner.]sql_procedure_name
([[ in | out | inout ] sql_parameter_name
sql_datatype [( length) |
(precision[, scale])]
[, [ in | out | inout ] sql_parameter_name
sql_datatype [( length) |
(precision[, scale]) ]]
...])
[modifies sql data]
[dynamic result sets integer]
[deterministic | not deterministic]
language java
parameter style java
external name 'java_method_name
[([java_datatype[, java_datatype
...]])]'
Note To comply with the ANSI standard, the SQLJ create procedure command
syntax is different from syntax used to create Sybase Transact-SQL stored
procedures.
Refer to the Reference Manual: Commands for a detailed description of each
keyword and option in this command.
When creating SQLJ stored procedures:
•
The SQL procedure signature is the SQL datatype sql_datatype of each
procedure parameter.
•
When creating a SQLJ stored procedure, do not include an @ sign before
parameter names. This practise is compliant with the ANSI standard.
Sybase adds an @ sign internally to support parameter name binding. You
will see the @ sign when using sp_help to print out information about the
SQLJ stored procedure.
Java in Adaptive Server Enterprise
103