Re: Executing SQL in the Background?
Posted in 2000
Obnoxio The Clown wrote:
>
> 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 &
Isn't that the same as:
dbaccess dbname script1 &
dbaccess dbname script2 &
dbaccess dbname script3 &
dbaccess dbname script4 &
dbaccess dbname script5 &
?
Cheers,
--
Mark.
+----------------------------------------------------------+-----------+
| Mark D. Stock mailto:mdstock@mydas.freeserve.co.uk |//////// /|
| http://www.informix.com http://www.informixhandbook.com |///// / //|
| http://www.iiug.org +-----------------------------------+//// / ///|
| |This email will self-destruct in |/// / ////|
| |10 sec. If you received this email |// / /////|
| |in error, sorry about the mess. |/ ////////|
+----------------------+-----------------------------------+-----------+