At 11:35 +0000 3/20/02, Javier wrote:
>Hi,
>
>I have a text file , with several MySQL instructions (CREATE TABLE, INSERT,
>SET @var, etc.).
>
> I want to execute all these instructions from a C program , using the API.
>
>It is possible to use the function mysql_query(), to execute all the
>instructions contained in the file in a single call to this function? , Can
>I execute several MySQL instructions in one only call to mysql_query()
>function?
No. Not for the C API, or for any API. The client-server protocol
requires that you issue a single query at at time.
But there's nothing to stop you from writing a utility function that
takes all the statements and issues them. Then you just call *that*
function once.
And remember that you don't include a terminating semicolon on the
statements when you use an API.
>
>If it is possible, which is the best way to do this?
>
>Thanks in advance
>
>Javier Diaz
>IT Developer