RE: Executing SQL in the Background?
Posted in 2000
Topics: Server Administration
UNIX:
You can place the sequence of sql statements in a file
with an extension of ".sql". And enter the command:
"dbaccess <file>.sql" as a cron job.
NT
You can use the "at" command of NT to schedule a
task.
-----Original Message-----
From: Peter Wages [mailto:pmwages@shell.cais.net]
Sent: Thursday, December 14, 2000 2:37 PM
To: informix-list@iiug.org
Subject: Executing SQL in the Background?
Is there a way to execute multiple sql statements simultaneously within
dbaccess?
I know one can execute multiple shell scripts which contain sql in the
background . But what if i am removed from UNIX or UNIX is not available to
me?
ciao
p
****************************************************************************
**
Peter Wages
pmwages@cais.com
Work: (703) 741-7436 Home: (703) 528-9569
****************************************************************************
**
On Thu, 14 Dec 2000 16:59:02 -0500, Don Ignacio <dignacio@openratings.com>
wrote:
>
>UNIX:
> You can place the sequence of sql statements in a file
> with an extension of ".sql". And enter the command:
> "dbaccess <file>.sql" as a cron job.
>
OR
nohup dbaccess db_name <file>.sql &
Nebojsa
>NT
> You can use the "at" command of NT to schedule a
> task.
>
>
>
>-----Original Message-----
>From: Peter Wages [mailto:pmwages@shell.cais.net]
>Sent: Thursday, December 14, 2000 2:37 PM
>To: informix-list@iiug.org
>Subject: Executing SQL in the Background?
>
>
>Is there a way to execute multiple sql statements simultaneously within
>dbaccess?
>
>I know one can execute multiple shell scripts which contain sql in the
>background . But what if i am removed from UNIX or UNIX is not available to
>me?
>
>ciao
>p
>
>****************************************************************************
>**
>Peter Wages
>pmwages@cais.com
>Work: (703) 741-7436 Home: (703) 528-9569
>****************************************************************************
>**
Nebojsa Sevo wrote:
> On Thu, 14 Dec 2000 16:59:02 -0500, Don Ignacio <dignacio@openratings.com>
> wrote:
>
> >UNIX:
> > You can place the sequence of sql statements in a file
> > with an extension of ".sql". And enter the command:
> > "dbaccess <file>.sql" as a cron job.
> >
> OR
> nohup dbaccess db_name <file>.sql &
While admirable solutions as far as they go, these answers really
acknowledge Peter's second paragraph and don't address Peter's first
question -- can you achieve the same effect inside a single running copy
of DB-Access.
The answer to that is 'No', because the only way to achieve it would be
with a multi-threaded application, and DB-Access is not multi-threaded.
Neither is SQLCMD, so my usual fallback remedy for the ills of DB-Access
is no help this time.
It's interesting to contemplate how to design the language to express
that two SQL statements should be run in parallel. How would you handle
the errors and output from the two statements?
> >NT
> > You can use the "at" command of NT to schedule a task.
> >
> >-----Original Message-----
> >From: Peter Wages [mailto:pmwages@shell.cais.net]
> >Sent: Thursday, December 14, 2000 2:37 PM
> >
> >Is there a way to execute multiple sql statements simultaneously within
> >dbaccess?
> >
> >I know one can execute multiple shell scripts which contain sql in the
> >background . But what if i am removed from UNIX or UNIX is not available to
> >me?
--
Yours,
Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h>
Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN
"I don't suffer from insanity; I enjoy every minute of it!"
In the year of Our Lord Fri, 15 Dec 2000 23:21:08 GMT, Jonathan Leffler
<jleffler@informix.com> broke a vow of silence to utter:
>Nebojsa Sevo wrote:
>> On Thu, 14 Dec 2000 16:59:02 -0500, Don Ignacio <dignacio@openratings.com>
>> wrote:
>>
>> >UNIX:
>> > You can place the sequence of sql statements in a file
>> > with an extension of ".sql". And enter the command:
>> > "dbaccess <file>.sql" as a cron job.
>> >
>> OR
>> nohup dbaccess db_name <file>.sql &
>
>While admirable solutions as far as they go, these answers really
>acknowledge Peter's second paragraph and don't address Peter's first
>question -- can you achieve the same effect inside a single running copy
>of DB-Access.
>
>The answer to that is 'No', because the only way to achieve it would be
>with a multi-threaded application, and DB-Access is not multi-threaded.
>Neither is SQLCMD, so my usual fallback remedy for the ills of DB-Access
>is no help this time.
>
>It's interesting to contemplate how to design the language to express
>that two SQL statements should be run in parallel. How would you handle
>the errors and output from the two statements?
Well, ignoring errors, how about:
dbaccess dbname <<! # could be from a file too!
!dbaccess dbname script1 &
!dbaccess dbname script2 &
!dbaccess dbname script3 &
!dbaccess dbname script4 &
!dbaccess dbname script5 &
...
?
Blunt and crude, but it might work.
Just like me.