SYNOPSISTX *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 ALSOn_settx(), n_runtx(), and n_gettx()