Subject Re: Can you run an sql script from php?
Author willogibbo
Thanks, Lester, very helpful.

One thing I can't figure is how you handle creating a trigger or
stored procedure with an sql statement i.e. where you have semi colons
in the body of what you're creating. Also how do you cope with the
'SET TERM' top and tail?


--- In, Lester Caine <lester@l...> wrote:
> willogibbo wrote:
> > Is it possible to run an sql script from php?
> >
> > I know that queries and stored procedures can be (ibase_execute,
> > ibase_query etc..), but I was wondering if there is any way to run an
> > sql script e.g. a script that creates tables, procedure, triggers
> >
> > I suspect the answer is no. I saw, on this forum, a post from Nigel
> > Weeks, back in April 2005 that included a "script runner", namely a
> > method of breaking a script up into its constituent queries and
> > running those sql statements sequentially.
> >
> > If running scripts is not possible, can you put DDL script (say that
> > creates a generator with its associated auto-increment trigger) into a
> > form of sql that can be "run" from php?
> There is no 'native' 'ibase_script', but to be honest there does not
> need to be, Since there are many tools that will handle all sorts of
> inputs which can then be run in ibase_execute. Nigels code is an
> example. I use the datadict element of ADOdb to build and update
> databases, that works quite nicely. I only have to 'shell out' to isql
> to create a blank database if it does not exist.
> So yes you can do anything you want in the SQL to manage your database
> so you can sequence them from a php script. Another example of doing it
> is in ibWebAdmin, which has a script window as one of it's functions.
> --
> Lester Caine
> -----------------------------
> L.S.Caine Electronic Services
> Treasurer - Firebird Foundation Inc.