Function prepare

Submit an SQL command to the server to be compiled into a prepared statement.

The result of a successful outcome will be a statement handle - an ID - for the prepared statement, a count of the parameters required for excution of the statement, and a count of the columns that will be present in any result set that the command generates. Thes values will be stored in in the Command struct.

The server will then proceed to send prepared statement headers, including parameter descriptions, and result set field descriptions, followed by an EOF packet.

Prototype

Prepared prepare(
  Connection conn,
  string sql
);

Throws

MySQLException if there are pending result set items, or if the server has a problem.

Authors

Copyright

License