List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:March 20 2002 2:48pm
Subject:Re: C API Question
View as plain text  
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

Thread
C API QuestionJavier20 Mar
  • Re: C API QuestionPaul DuBois20 Mar
    • Loop ProblemLance Prais20 Mar
      • important questionLance Prais20 Mar
      • Re: Loop ProblemArjen Lentz20 Mar
RE: C API QuestionKenneth Hylton20 Mar
RE: Important questionWalt Weaver20 Mar