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

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

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

Examples<br />

Contents<br />

Example 3–1: Passing a SELECT statement as a parameter . . . . . . . . . . . . . . . . . . 3–12<br />

Example 3–2: Using the send-sql-statement with<br />

the LOAD-RESULT-INTO option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–12<br />

Example 3–3: A stored procedure with multiple result sets,<br />

output parameters, and a single return value . . . . . . . . . . . . . . . . . . . 3–15<br />

Example 3–4: Return status example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–16<br />

Example 3–5: Passing parameters by name using the PARAM option . . . . . . . . . . . 3–16<br />

Example 3–6: pcust stored procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–17<br />

Example 3–7: Returning database results into the proc-text-buffer<br />

and results conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–17<br />

Example 3–8: First view created in your MS <strong>SQL</strong> <strong>Server</strong> data source . . . . . . . . . . . . 3–19<br />

Example 3–9: Second view created in your MS <strong>SQL</strong> <strong>Server</strong> data source . . . . . . . . . 3–19<br />

Example 3–10: Result set of pcust - typed buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–19<br />

Example 3–11: Procedure handles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–20<br />

Example 3–12: Joining stored procedure results with other database tables . . . . . . . . 3–20<br />

Example 3–13: RUN STORED-PROC statement with<br />

the LOAD-RESULT-INTO phrase . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–21<br />

Example 3–14: Multiple temp-tables in a prepared state . . . . . . . . . . . . . . . . . . . . . . . 3–26<br />

Example 3–15: Temp-table code technique . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–26<br />

Example 3–16: Basic execution of a stored procedure using<br />

LOAD-RESULT-INTO functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–27<br />

Example 3–17: Using an existing dynamic temp-table<br />

without the TEMP-TABLE-PREPARE ( ) method . . . . . . . . . . . . . . . . 3–27<br />

Example 3–18: Using an existing dynamic temp-table<br />

with the TEMP-TABLE-PREPARE ( ) method . . . . . . . . . . . . . . . . . . . 3–28<br />

Example 3–19: Calling a stored procedure and using the EXTENT phrase . . . . . . . . . 3–28<br />

Example 3–20: Calling an enhanced stored procedure<br />

with a single temp table and the send-sql-statement . . . . . . . . . . . . . . 3–29<br />

Example 3–21: Use of a PROC-STATUS phrase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–29<br />

Example 3–22: Trapping errors within a procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–30<br />

Example 3–23: Trapping errors using LOAD-RESULT-INTO . . . . . . . . . . . . . . . . . . . . 3–30<br />

Example 3–24: Expected ABL behavior—ROWID value of a temp-table buffer . . . . . . 3–33<br />

Example 3–25: ABL Query filling a Pro<strong>Data</strong>Set temp-table . . . . . . . . . . . . . . . . . . . . . 3–34<br />

Example 3–26: Using the LOAD-RESULT-INTO technique<br />

to populate the underlying Temp-Table of a Pro<strong>Data</strong>Set . . . . . . . . . . . 3–35<br />

Example 3–27: Use the LOAD-RESULT-INTO technique with BEFORE-FILL<br />

method to fill the temp-table(s) of a Pro<strong>Data</strong>Set . . . . . . . . . . . . . . . . . 3–37<br />

Contents–9

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

Saved successfully!

Ooh no, something went wrong!