Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Howard asked for an Informix equivalent of Oracle's "@" command to run a script from within SQL. Replies noted SQL itself can't launch shell scripts, so the usual approach is to drive SQL scripts from a shell script or a language like Perl/Python/Ruby. More specific answers: in dbaccess you can shell out from a .sql file using the '!' prefix (e.g. ! echo "Hello"), and on the server side a stored procedure can use the SYSTEM command to run a script present on the server. Marco Greco also suggested his SQSL scripting tool.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Hello all,
Quick question for you here,
If I am running a piece of SQL, is it possible to run a script from
within the SQL.....in oracle I know you would use the "@" so what
would you use in Informix?
Thanks in advance.
Cheers,
Howard
On Tue, 2007-10-23 at 13:04 +0000, howie.lfc@googlemail.com wrote:
> Hello all,
>
> Quick question for you here,
>
> If I am running a piece of SQL, is it possible to run a script from
> within the SQL.....in oracle I know you would use the "@" so what
> would you use in Informix?
As far as I know it's not possible to run shell scripts from SQL (if
that's what you mean). The canonical solution is to make one shell
script from which you run SQL scripts and other commands/scripts, or use
a programming language such as Python or Perl.
--
Carsten Haese
http://informixdb.sourceforge.net
↪ replying to howie.lfc@googlemail.com
Marco Greco — — source: Usenet: comp.databases.informix
howie.lfc@googlemail.com wrote:
> Hello all,
>
> Quick question for you here,
>
> If I am running a piece of SQL, is it possible to run a script from
> within the SQL.....in oracle I know you would use the "@" so what
> would you use in Informix?
>
> Thanks in advance.
>
> Cheers,
>
> Howard
have a look at SQSL (see my sig) it will do that and much more
--
Ciao,
Marco
______________________________________________________________________________
Marco Greco /UK /IBM Standard disclaimers apply!
Structured Query Scripting Language http://www.4glworks.com/sqsl.htm
4glworks http://www.4glworks.com
Informix on Linux http://www.4glworks.com/ifmxlinux.htm
Hi,
not knowing oracle and their "@", I'm not sure what
exactly you are trying to achieve ...:
- running a shell script locally (on client machine)?:
Depends on the client you use as it is interpreting
the SQL. E.g. with dbaccess you can use the '!', like
in the following 3-line SQL script "hello.sql":
select name from sysdatabases; ! echo "Hello, world\\!"
select name from sysdatabases;
which you then run with the command:
dbaccess sysmaster hello.sql
- running a shell script on the server machine?:
I think you can do that by using a stored procedure
and the "system ..." command.
Of course the shell script must be present on the
server machine.
Regards,
Martin
--
Martin Fuerderer
IBM Informix Development Munich, Germany
Information Management
IBM Deutschland GmbH
Chairman of the Supervisory Board: Hans Ulrich Märki
Board of Management: Martin Jetter (Chairman), Rudolf Bauer, Christian
Diedrich, Christoph Grandpierre, Matthias Hartmann, Thomas Fell, Michael
Diemer
Corporate Seat: Stuttgart, Germany; Reg.-Gericht: Amtsgericht Stuttgart,
HRB-Nr.: 14 562 WEEE-Reg.-Nr. DE 99369940
informix-list-bounces@iiug.org wrote on 23.10.2007 15:04:31:
> Hello all,
>
> Quick question for you here,
>
> If I am running a piece of SQL, is it possible to run a script from
> within the SQL.....in oracle I know you would use the "@" so what
> would you use in Informix?
>
> Thanks in advance.
>
> Cheers,
>
> Howard
>
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
On Oct 23, 8:24 am, Carsten Haese <cars...@uniqsys.com> wrote:
> On Tue, 2007-10-23 at 13:04 +0000, howie....@googlemail.com wrote:
>
> As far as I know it's not possible to run shell scripts from SQL (if
> that's what you mean). The canonical solution is to make one shell
> script from which you run SQL scripts and other commands/scripts, or use
> a programming language such as Python or Perl.
or Ruby ;-)
Your privacy choices
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.