Icon edb_freecachedstmts

Frees any cached SQL statements for the specified open database.

Syntax
edb_freecachedstmts(<ConnectionHandle>, [<DatabaseName>])

<ConnectionHandle> =

Handle of connection returned by edb_connect function

<DatabaseName> =

Name of open database that contains cached SQL statements to free

Returns
TRUE if successful, or FALSE if there are any errors

Usage
The edb_freecachedstmts function is used to free any cached SQL statements for the specified open database. If a database is not specified, then any cached SQL statements in the open databases for the connection will be freed. Please see the Buffering and Caching topic for more information on caching SQL statements.

<?php

// The following script connects to an ElevateDB
// Server and database, executes a series of queries,
// and then calls the edb_freecachedstmts() and
// edb_freecachedprocs() functions to free any cached
// SQL statements and functions/procedures.  This is for
// example purposes only - you would not normally do
// this because it defeats the the purpose of the
// SQL statement and function/procedure caching.

$con = edb_connect("type=remote;charset=Ansi;address=127.0.0.1;"+
                   "uid=Administrator;pwd=EDBDefault;database=Test;"+
                   "stmtcachesize=32;proccachesize=32");
if (!$con)
  {
  die("Could not connect: " . edb_errmsg());
  }

edb_execsql($con,"SELECT * FROM customer WHERE State='FL' AND "+
                 "TotalOrders(CustNo) > 10");
edb_execsql($con,"SELECT * FROM customer WHERE State='NY' AND "+
                 "TotalOrders(CustNo) > 10");
edb_execsql($con,"SELECT * FROM customer WHERE State='CA' AND "+
                 "TotalOrders(CustNo) > 10");

edb_freecachedstmts($con);
edb_freecachedprocs($con);

edb_disconnect($con);
?>
Image