Unix Shell - Calling DB2 statement through a unix shell

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > February 2007 > Calling DB2 statement through a unix shell





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Calling DB2 statement through a unix shell
Justin

2007-02-13, 1:17 pm


I am looking to execute a DB2 command in the background through
shell .

Shell script:

db2 -tvf updatecust.sql &

Within updatecust.sql, it established a connection to the db and
executes an update statement. Using the & causes the statement to
fail. I have tried quotes and the exec statement.

Error: DB21018E A system error occurred. The command line processor
could not continue processing.

Removing the &, and the script runs as expected.

Thanks.

Dan Mercer

2007-02-13, 7:18 pm


"Justin" <kfwolf@hotmail.com> wrote in message news:1171392512.438278.307810@k78g2000cwa.googlegroups.com...
:
: I am looking to execute a DB2 command in the background through
: shell .
:
: Shell script:
:
: DB2 -tvf updatecust.sql &

Try:

db2 +p -tvf updatecust.sql > updatecust.log &

Dan Mercer

:
: Within updatecust.sql, it established a connection to the db and
: executes an update statement. Using the & causes the statement to
: fail. I have tried quotes and the exec statement.
:
: Error: DB21018E A system error occurred. The command line processor
: could not continue processing.
:
: Removing the &, and the script runs as expected.
:
: Thanks.
:


Justin

2007-02-15, 1:19 pm


Thanks for the suggestion. Found a work-around by creating a function
in the shell script and calling the function in the background "&"

On Feb 13, 3:56 pm, "Dan Mercer" <damer...@comcast.net> wrote:
> "Justin" <kfw...@hotmail.com> wrote in messagenews:1171392512.438278.307810@k78g2000cwa.googlegroups.com...
>
> :
> : I am looking to execute a DB2 command in the background through
> : shell .
> :
> : Shell script:
> :
> : DB2 -tvf updatecust.sql &
>
> Try:
>
> DB2 +p -tvf updatecust.sql > updatecust.log &
>
> Dan Mercer
>
> :
> : Within updatecust.sql, it established a connection to the db and
> : executes an update statement. Using the & causes the statement to
> : fail. I have tried quotes and the exec statement.
> :
> : Error: DB21018E A system error occurred. The command line processor
> : could not continue processing.
> :
> : Removing the &, and the script runs as expected.
> :
> : Thanks.
> :



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com