Progress
SQL-92
Guide and Reference
Calling Stored Procedures
Once a stored procedure is created and stored in the database, any application or other stored procedure can execute it by calling it. You can call stored procedures from ODBC applications, JDBC applications, ESQL-92 applications, or directly from the SQL-92 Explorer.
EXAMPLEThis example shows an excerpt from an ODBC application that calls a stored procedure (order_parts) using the ODBC syntax { call procedure_name ( param ) }:
Executing a stored procedure involves the following general steps:
- The application calls the stored procedure through its native calling mechanism. The previous example uses the ODBC call escape sequence.
- Progress SQL-92 retrieves the compiled bytecode form of the procedure and submits it to the Java Virtual Machine for execution.
- For every SQL statement in the procedure, the Java Virtual Machine calls Progress SQL-92.
- Progress SQL-92 manages the interaction of the stored procedure with the database and execution of the SQL statements, and returns any result to the Java Virtual Machine.
- The Java Virtual Machine returns result (output parameters and result sets) of the procedure to Progress SQL-92, which in turn passes them to the calling application.
Figure 5–2 illustrates the steps in executing a stored procedure.
Figure 5–2: Executing Stored Procedures
![]()
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |