n_opentx(), n_duptx(), n_closetx() - SQL interface

SYNOPSIS

TX *n_opentx(SERVER *se);
TX *n_duptx(SERVER *se,TX *tx);
TX *n_closetx(SERVER *se,TX *tx);


DESCRIPTION
These functions provide an alternative to n_texis(). They allow the same style of SQL statements via n_settx(), but maintain the connection to the database for performing multiple queries without constant reopens. This improves the efficiency of executing multiple statements against the same database.

n_opentx() opens the database specified in the last call to n_setdatabase(). It returns a valid TX pointer on success or TXPN on failure. TXPN is an alias for (TX *)NULL.

n_duptx() creates a new TX pointer to the same database as a currently valid handle. This saves much of the overhead of opening a new connection to the database. The returned handle is a clean TX handle, and will not have a copy of the SQL statement from the copied handle. It returns a valid TX pointer on success or TXPN on failure. TXPN is an alias for (TX *)NULL.

n_closetx() closes the previously opened database. It always returns TXPN.

SQL statements are setup and executed with n_settx(), n_runtx(), and n_gettx().


SEE ALSO

n_settx(), n_runtx(), and n_gettx()


Copyright © Thunderstone Software     Last updated: Dec 10 2018
Copyright © 2019 Thunderstone Software LLC. All rights reserved.