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.

CALL<br />

Syntax<br />

Authorization<br />

Must have AUDIT_ADMIN, AUDIT_ARCHIVE, or AUDIT_INSERT privileges.<br />

Invokes a stored procedure.<br />

proc_name<br />

The name of the procedure to invoke.<br />

parameter<br />

Literal or variable value to pass to the procedure.<br />

Example This example shows an excerpt from an ODBC application that calls a stored procedure<br />

(order_parts) using the ODBC syntax {call procedure_name (param)}:<br />

Authorization<br />

Column constraints<br />

CALL proc_name ( [ parameter ] [ , ... ] );<br />

<strong>SQL</strong>UINTEGER Part_num;<br />

<strong>SQL</strong>INTEGER Part_numInd = 0;<br />

// Bind the parameter.<br />

<strong>SQL</strong>BindParameter (hstmt, 1, <strong>SQL</strong>_PARAM_INPUT,<br />

<strong>SQL</strong>_C_SLONG, <strong>SQL</strong>_INTEGER, 0, 0, &Part_num, 0, Part_numInd);<br />

// Place the department number in Part_num.<br />

Part_num = 318;<br />

// Execute the statement.<br />

<strong>SQL</strong>ExecDirect(hstmt, "{call order_parts(?)}", <strong>SQL</strong>_NTS);<br />

Must have DBA or EXECUTE privileges.<br />

Related statements<br />

CREATE PROCEDURE, DROP PROCEDURE<br />

CALL<br />

Specifies a constraint for a column that restricts the values that the column can store. INSERT,<br />

UPDATE, or DELETE statements that violate the constraint fail. The database returns a constraint<br />

violation error with an <strong>SQL</strong>CODE of -20116.<br />

Column constraints are similar to table constraints, but their definitions are associated with a<br />

single column rather than the entire table.<br />

9

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

Saved successfully!

Ooh no, something went wrong!