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

Create successful ePaper yourself

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

DYNAMIC_FUNCTION<br />

E<strong>SQL</strong> elements and statements<br />

Contains the character-string code for the statement (as specified in the <strong>SQL</strong><br />

standard). For dynamic <strong>SQL</strong> statements only (as indicated by EXECUTE or EXECUTE<br />

IMMEDIATE in the COMMAND_FUNCTION item).<br />

ROW_COUNT<br />

The number of rows affected by the <strong>SQL</strong> statement.<br />

Example The GET DIAGNOSTICS example extracts header information about the last <strong>SQL</strong> statement<br />

executed. The information is assigned to host variables that are defined in the DECLARE SECTION<br />

of an embedded <strong>SQL</strong> program, as shown in the following example:<br />

Syntax<br />

GET DIAGNOSTICS :num = NUMBER, :cmdfunc = COMMAND_FUNCTION ;<br />

The GET DIAGNOSTICS statement itself does not affect the contents of the diagnostics area. This<br />

means applications can issue multiple GET DIAGNOSTICS statements to retrieve different items<br />

of information about the same <strong>SQL</strong> statement.<br />

Related statements<br />

GET DIAGNOSTICS EXCEPTION, WHENEVER<br />

GET DIAGNOSTICS EXCEPTION<br />

Retrieves information about the execution of the previous <strong>SQL</strong> statement from the <strong>SQL</strong><br />

diagnostics area. The diagnostics area is a data structure that contains information about the<br />

execution status of the most recent <strong>SQL</strong> statement. Specifically, GET DIAGNOSTICS EXCEPTION<br />

extracts information about the <strong>SQL</strong> statement as a whole from the <strong>SQL</strong> diagnostics area’s detail<br />

component.<br />

The detail area contains information for a particular condition (an error, warning, or success<br />

condition) associated with execution of the last <strong>SQL</strong> statement. The diagnostics area can<br />

potentially contain multiple detail areas corresponding to multiple conditions generated by the<br />

<strong>SQL</strong> statement described by the header. The <strong>SQL</strong> diagnostics area currently supports only one<br />

detail area.<br />

Note: The GET DIAGNOSTICS statement extracts header information.<br />

GET DIAGNOSTICS EXCEPTION number<br />

:param = detail_info_item<br />

[, :param = detail_info_item ] , ... ;<br />

EXCEPTION number<br />

Specifies that GET DIAGNOSTICS EXCEPTION extracts detail information. number specifies<br />

which of multiple detail areas GET DIAGNOSTICS extracts. Currently, number must be the<br />

integer 1.<br />

335

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

Saved successfully!

Ooh no, something went wrong!