A transfer of handle to database connection between ESL scripts may be done by RPC procedures. In declaration of RPC procedure, you have to tag the parameter that represents the handle to database connection by enumerated type DB_HANDLE. An algorithm is contingent on the existence of database connection. If handle to database connection is an invalid value or it points to missing database connection, the algorithm ends with error.
The enumerated type DB_HANDLE is INT.
RPC procedure declaration:
RPC PROCEDURE ProcName [([IN] DB_HANDLE _db_handle[,_db_handle2, ...] [IN] DB_HANDLE _db_handle3]...)] ;actions END ProcName |
_db_handle that can be transferred between ESL scripts is created by these actions: DB_CONNECT, PG_DISCONNECT, SQL_CONNECT, DB_TRANS_OPEN.
Notes:
INT _db_handle _db_handle := 5 CALL [objIdent] INSERT (_db_handle) ON procIdent |
****************** ; ESL script that is called RPC PROCEDURE InsertToDB(DB_HANDLE _handle) ..... END InsertToDB *************** ; ESL script that is calling INT _db_handle CALL[...] InsertToDB(_db_handle) ASYNC ON .... ; after this calling, handle to database connection will terminate in this script, the called ESL script becomes the owner ***************** |
****************** ; ESL script that is called RPC PROCEDURE InsertToDB(IN DB_HANDLE _handle) ..... END InsertToDB *************** ; ESL script that is calling INT _db_handle CALL[...] InsertToDB(_db_handle) ON .... ; after this calling the database connection is terminated in this script, the called ESL script becomes the owner *************** |
****************** ; ESL script that is called RPC PROCEDURE InsertToDB(DB_HANDLE _handle) ..... END InsertToDB *************** ; ESL script that is calling INT _db_handle CALL[...] InsertToDB(_db_handle) SYNC ON .... ; after this calling, ESL script, that is calling, is till the owner of database connection *************** |