23.10.2012 Views

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CREATE PROCEDURE<br />

Syntax<br />

16<br />

CREATE PROCEDURE [ owner_name.]procname<br />

( [ parameter_decl [ , ... ] ] )<br />

[ RESULT ( column_name data_type [ , ... ] ) ]<br />

[ IMPORT<br />

java_import_clause ]<br />

BEGIN<br />

java_snippet<br />

END<br />

parameter_decl<br />

This is the syntax for parameter_decl:<br />

Syntax<br />

owner_name<br />

procname<br />

{ IN | OUT | INOUT } parameter_name data_type<br />

Specifies the owner of the procedure. If the name is different from the user name of the<br />

user executing the statement, then the user must have DBA privileges.<br />

Names the stored procedure. DROP PROCEDURE statements specify the procedure name<br />

defined here. <strong>SQL</strong> also uses procname in the name of the Java class that it creates from the<br />

Java snippet.<br />

IN | OUT | INOUT<br />

Specifies whether following parameter declaration is input, output, or both.<br />

Calling applications pass values for input parameters in the CALL statement or CALL escape<br />

sequence.<br />

Stored procedures assign values to output parameters as part of their processing.<br />

INOUT parameters have both a value passed in and receive a new value during procedure<br />

processing.<br />

parameter_name data_type<br />

Names a parameter and associates an <strong>SQL</strong> data type with it. The data type must be one<br />

supported by OpenEdge.<br />

RESULT ( column_name data_type [ , ... ] )<br />

Specifies columns in the result set the procedure returns. If the CREATE PROCEDURE<br />

statement includes this clause, the Java snippet must explicitly insert rows into the result<br />

set using the Java class <strong>SQL</strong>ResultSet.<br />

Note that the column_name argument is not used in the body of the stored procedure.<br />

Instead, methods of the Java classes refer to columns in the result set by ordinal number,<br />

not by name. The IMPORT keyword must be uppercase and on a separate line. The body is

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!