13.01.2013 Views

OpenEdge Data Management: DataServer for Microsoft SQL Server

OpenEdge Data Management: DataServer for Microsoft SQL Server

OpenEdge Data Management: DataServer for Microsoft SQL Server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 3: RDBMS Stored Procedure Details<br />

As previously noted in Table 20, you can pass data types in the RUN<br />

STORED-PROCEDURE statement using the PARAM phrase. Table 21 lists issues that occur<br />

when you pass certain data types as parameters.<br />

Table 21: Argument data types <strong>for</strong> stored procedures<br />

<strong>OpenEdge</strong> MS <strong>SQL</strong> <strong>Server</strong> data source<br />

DECIMAL<br />

INTEGER<br />

INT64<br />

Note these stored procedure points:<br />

The <strong>Data</strong><strong>Server</strong> converts each of these data types in the<br />

schema image to the equivalent default <strong>OpenEdge</strong> data type as<br />

follows:<br />

• DECIMAL=DECIMAL(default), or Float<br />

• INTEGER=INTEGER<br />

• INT64=BIGINT<br />

However, you can use the <strong>Data</strong> Dictionary to update the data<br />

type and <strong>for</strong>mat in<strong>for</strong>mation in the field property sheet <strong>for</strong> the<br />

parameter.<br />

CHAR The data source represents this type as a VARCHAR parameter.<br />

Its size cannot exceed the VARCHAR size limit <strong>for</strong> the associated<br />

data source. If the VARCHAR parameter exceeds this limit, it<br />

causes an error.<br />

DATE If you pass a DATE data type as an input parameter and use it<br />

in an equality test, the test might fail. In this case, use<br />

DATEPART() or DATEDIFF() in the Transact-<strong>SQL</strong> of your native<br />

stored procedure to isolate parts of the date structure <strong>for</strong> which<br />

you might want to test.<br />

DATETIME You can specify a DATETIME data type in a temp table used to<br />

receive results from a stored procedure using the<br />

LOAD-RESULT-INTO phrase.<br />

MEMPTR You can specify a MEMPTR data type in a Param phrase as an<br />

INPUT or an OUTPUT parameter to receive results from a<br />

corresponding BLOB data type parameter to or from a RUN<br />

STORED-PROCEDURE statement.<br />

LONGCHAR You can specify a LONGCHAR data type in a Param phrase as an<br />

INPUT or an OUTPUT parameter to receive results from a<br />

corresponding CLOB data type parameter to or from a RUN<br />

STORED-PROCEDURE statement.<br />

• Input and output parameters are displayed as fields.<br />

• Stored procedures called from within <strong>OpenEdge</strong> applications cannot return<br />

Boolean values to LOGICAL data types.<br />

• If you are running several stored procedures, run them serially and process all the<br />

results from one stored procedure and close the procedure be<strong>for</strong>e you run a<br />

second one. By default, the <strong>Data</strong><strong>Server</strong> allows one active request <strong>for</strong> running a<br />

stored procedure. It is not necessary to specify the PROC-HANDLE phrase when<br />

procedures are run serially.<br />

122 <strong>OpenEdge</strong> <strong>Data</strong> <strong>Management</strong>: <strong>Data</strong><strong>Server</strong> <strong>for</strong> <strong>Microsoft</strong> <strong>SQL</strong> <strong>Server</strong>

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

Saved successfully!

Ooh no, something went wrong!