1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| do
{
msg_len = 0;
if (msg) memcpy(msg + msg_len, "", 1); // An empty string selects the non-prepared statement named.
msg_len += 1;
if (msg) memcpy(msg + msg_len, query, strlen(query));// Query string to analyse.
msg_len += strlen(query);
if (count > 0 && paramtypes)
{
if (msg) sql_put_int(sizeof(int16), count, msg + msg_len); // Number format codes following parameters.
msg_len += sizeof(int16);
for (i=0; i<count; i++)
{
if (msg)sql_put_int(sizeof(int32), paramtypes[i], msg + msg_len);// Object ID of the data type of the parameter.
msg_len += sizeof(int32);
}
}
else
{
if (msg) sql_put_int(sizeof(int16), 0, msg + msg_len); // Many types of data specified parameter.
msg_len += sizeof(int16);
}
if (msg)
{
msg[msg_len] = '\0';
msg_len++;
break;
}
msg_len++;
msg = (char *) malloc(msg_len);
}
while (msg); |
Partager