COM_STMT_PREPARE
Prepares a statement on the server.
Not all statements can be prepared. See PREPARE for a list of statements that can be prepared.
Implemented by
Fields
- int<1> 0x16 COM_STMT_PREPARE header
- string<EOF> SQL Statement
Example
1F 00 00 00 16 53 45 4C 45 43 54 20 2A 20 46 52 .....SELECT * FR 1F 4D 20 74 65 73 74 5F 62 69 6E 64 5F 72 65 73 OM test_bind_res 75 6C 74 ult
COM_STMT_PREPARE response
If anything goes wrong, the server will send an ERR_Packet. If the command succeeds, different packets will be received:
- COM_STMT_PREPARE_OK
- if number of parameters (count of '?' placeholders) > 0
- for each parameter:
- if !DEPRECATE_EOF eof_packet
- if prepared statement returns result set and number of result set columns > 0
- for each column:
- if !DEPRECATE_EOF eof_packet
COM_STMT_PREPARE_OK
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.