# 9. SQL Procedure Language Guide

Chapter Contents | Prev | Next
Keyword Search:
www.openlinksw.com
docs.openlinksw.com
Book Home
Contents
Preface
SQL Procedure Language Guide
General Principles
Scope of Declarations
Data Types
Handling Result Sets
Result Sets and Array Parameters
Exception Semantics
Virtuoso/PL Syntax
CREATE ASSEMBLY Syntax - External Libraries
CREATE PROCEDURE Syntax - External hosted procedures
Asynchronous Execution and Multithreading in Virtuoso/PL
Performance Tips
Procedures and Transactions
Distributed Transaction & Two Phase Commit
Triggers
Character Escaping
Virtuoso/PL Scrollable Cursors
Virtuoso PL Modules
Handling Conditions In Virtuoso/PL Procedures
Procedure Language Debugger
Row Level Security

## 9.4. Handling Result Sets

A single Virtuoso procedure may produce multiple result sets, each with different result columns. A normal procedure produces one empty result set, only returning a possible return value and values of output parameters to the application.

The result_names() predefines variables to be used in a result set to follow. The variables must be previously declared, from which the column data types are ascertained. This assigns the meta data but does not send any results. The result() function sends its parameters as a single row of results. These parameters should be compatible with those in the previous result_names(). The end_results() function can be used to separate multiple result sets. The result_names() can then be used to alter the structure of the next result set.

The result_names() call can be omitted if the application already knows what columns and their types are to be returned.

See Also:

result(), result_names(), end_result()

Previous Data Types | Chapter Contents | Next Result Sets and Array Parameters