Re: SQL error = -668 ISAM error = -127
Posted in 2007
An ESQL/C program invoked from an SPL procedure via SYSTEM() failed with SQL -668 / ISAM -127, although it ran fine from the command line. Respondents explained that SYSTEM() runs with the server's (oninit) environment, not the user's, so the program lacked LD_LIBRARY_PATH etc.; they advised wrapping the call in a shell script that exports INFORMIXDIR, PATH, LD_LIBRARY_PATH, INFORMIXSERVER, ONCONFIG, and checking file permissions and exit status. The poster confirmed the fix: the server environment had no LD_LIBRARY_PATH, and his wrapper script initially set INFORMIXDIR to the wrong path; correcting it made the program run.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Stored Procedures & SPL, Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL, Networking & sqlhosts Configuration, Platform-Specific Issues, Versions, Editions & End-of-Life
On Jun 27, 2:56 pm, scottishpoet <drybur...@yahoo.com> wrote: > On Jun 27, 12:17 pm, slawek_k <slawek.korde...@t-online.de> wrote: > > > > > Hello everyone, > > > I receive this error if I call my in ESQL-C written program from any > > SPL-procedure with the command "system(/path_to_my_program/ > > my_program)". > > The program works fine if I call it from command line. > > IDS can find all notify libraries to run this program because the > > LD_LIBRARY_PATH is set correctly. > > I have test and change my_program into any OS-command for example > > "ls" . It is works correctly. > > > In the next test I have written my_program with only main function and > > without calls of database etc. Thus it don't work on the database but > > it is compiled with INFORMIX-ESQLC libraries. It is don't work! > > > My question: > > is it not allowed to call any ESQLC-program from SPL procedure ??? > > Why ? > > > My enviroment: > > IDS 9.40 > > Suse Linux 8.2 > > Your ESQL / C program has no environemnt to run in when called direclt > from SPL > > You need a script that sets the environment - PATH, Informixserver, > informixdir , library path etc and then runs the program > > call the script from your SPL procedure Hello scottishpoet, in my last test from yesterday I call my program and the program is only the main function without access to any database. Thus program don't need any environment to database. But I want to adopt your proposal and today I start my program from a script with settings of INFORMIXSERVER,DBSERVERNAME, INFORMIXDIR, LD_LIBRARY_PATH and it is not work. I receive the same error ! Slawek It isn't works
On Jun 28, 4:05 am, slawek_k <slawek.korde...@t-online.de> wrote: > On Jun 27, 2:56 pm, scottishpoet <drybur...@yahoo.com> wrote: > > > > > On Jun 27, 12:17 pm, slawek_k <slawek.korde...@t-online.de> wrote: > > > > Hello everyone, > > > > I receive this error if I call my in ESQL-C written program from any > > > SPL-procedure with the command "system(/path_to_my_program/ > > > my_program)". > > > The program works fine if I call it from command line. > > > IDS can find all notify libraries to run this program because the > > > LD_LIBRARY_PATH is set correctly. > > > I have test and change my_program into any OS-command for example > > > "ls" . It is works correctly. > > > > In the next test I have written my_program with only main function and > > > without calls of database etc. Thus it don't work on the database but > > > it is compiled with INFORMIX-ESQLC libraries. It is don't work! > > > > My question: > > > is it not allowed to call any ESQLC-program from SPL procedure ??? > > > Why ? > > > > My enviroment: > > > IDS 9.40 > > > Suse Linux 8.2 > > > Your ESQL / C program has no environemnt to run in when called direclt > > from SPL > > > You need a script that sets the environment - PATH, Informixserver, > > informixdir , library path etc and then runs the program > > > call the script from your SPL procedure > > Hello scottishpoet, > > in my last test from yesterday I call my program and the program is > only the main function without access to any database. > Thus program don't need any environment to database. > But I want to adopt your proposal and today I start my program from a > script with settings of > INFORMIXSERVER,DBSERVERNAME, INFORMIXDIR, LD_LIBRARY_PATH > and it is not work. I receive the same error ! > > Slawek > > It isn't works Where does the program reside? Is it on the server's host machine or a separate client machine? IDS's SYSTEM command can only run tasks/scripts that reside on the server's host. Also, the execution privileges of the file must include user 'informix'. Art S. Kagel
On Jun 28, 5:49 pm, "Art S. Kagel" <art.ka...@gmail.com> wrote: > On Jun 28, 4:05 am, slawek_k <slawek.korde...@t-online.de> wrote: > > > > > On Jun 27, 2:56 pm, scottishpoet <drybur...@yahoo.com> wrote: > > > > On Jun 27, 12:17 pm, slawek_k <slawek.korde...@t-online.de> wrote: > > > > > Hello everyone, > > > > > I receive this error if I call my in ESQL-C written program from any > > > > SPL-procedure with the command "system(/path_to_my_program/ > > > > my_program)". > > > > The program works fine if I call it from command line. > > > > IDS can find all notify libraries to run this program because the > > > > LD_LIBRARY_PATH is set correctly. > > > > I have test and change my_program into any OS-command for example > > > > "ls" . It is works correctly. > > > > > In the next test I have written my_program with only main function and > > > > without calls of database etc. Thus it don't work on the database but > > > > it is compiled with INFORMIX-ESQLC libraries. It is don't work! > > > > > My question: > > > > is it not allowed to call any ESQLC-program from SPL procedure ??? > > > > Why ? > > > > > My enviroment: > > > > IDS 9.40 > > > > Suse Linux 8.2 > > > > Your ESQL / C program has no environemnt to run in when called direclt > > > from SPL > > > > You need a script that sets the environment - PATH, Informixserver, > > > informixdir , library path etc and then runs the program > > > > call the script from your SPL procedure > > > Hello scottishpoet, > > > in my last test from yesterday I call my program and the program is > > only the main function without access to any database. > > Thus program don't need any environment to database. > > But I want to adopt your proposal and today I start my program from a > > script with settings of > > INFORMIXSERVER,DBSERVERNAME, INFORMIXDIR, LD_LIBRARY_PATH > > and it is not work. I receive the same error ! > > > Slawek > > > It isn't works > > Where does the program reside? Is it on the server's host machine or > a separate client machine? > > IDS's SYSTEM command can only run tasks/scripts that reside on the > server's host. Also, the execution privileges of the file must > include user 'informix'. > > Art S. Kagel Program reside on the IDS-SERVER. It is called with full absolute path and hat 755 permissions. Slawek
Slawek-
As the poet said, when spl executes a system program, the
executed program has no environment by default. Try running a script
that sets your environment and executes your program instead. Maybe
something like this:
cd my_path_name_here
# Set environment for the database
export INFORMIXDIR=/usr/informix
export PATH=$PATH:$INFORMIXDIR/bin export TERMCAP=/usr/informix/etc/termcap
export DBDATE=MDY2
export LD_LIBRARY_PATH=/usr/informix/lib:/usr/informix/lib/esql: export DBCENTURY=C
export ONCONFIG=onconfig
export INFORMIXSQLHOSTS=$INFORMIXDIR/etc/sqlhosts
export INFORMIXSERVER=my_server
my_program_name_here
You will have to modify this to match your $INFORMIXDIR, etc.
--EEM
> -----Original Message-----
> From: informix-list-bounces@iiug.org [mailto:informix-list-
> bounces@iiug.org] On Behalf Of slawek_k
> Sent: Friday, June 29, 2007 4:57 AM
> To: informix-list@iiug.org
> Subject: Re: SQL error = -668 ISAM error = -127
>
> On Jun 28, 5:49 pm, "Art S. Kagel" <art.ka...@gmail.com> wrote:
> > On Jun 28, 4:05 am, slawek_k <slawek.korde...@t-online.de> wrote:
> >
> >
> >
> > > On Jun 27, 2:56 pm, scottishpoet <drybur...@yahoo.com> wrote:
> >
> > > > On Jun 27, 12:17 pm, slawek_k <slawek.korde...@t-online.de>
wrote:
> >
> > > > > Hello everyone,
> >
> > > > > I receive this error if I call my in ESQL-C written program
from
> any
> > > > > SPL-procedure with the command "system(/path_to_my_program/
> > > > > my_program)".
> > > > > The program works fine if I call it from command line.
> > > > > IDS can find all notify libraries to run this program because
the
> > > > > LD_LIBRARY_PATH is set correctly.
> > > > > I have test and change my_program into any OS-command for
example
> > > > > "ls" . It is works correctly.
> >
> > > > > In the next test I have written my_program with only main
function
> and
> > > > > without calls of database etc. Thus it don't work on the
database
> but
> > > > > it is compiled with INFORMIX-ESQLC libraries. It is don't
work!
> >
> > > > > My question:
> > > > > is it not allowed to call any ESQLC-program from SPL
procedure
> ???
> > > > > Why ?
> >
> > > > > My enviroment:
> > > > > IDS 9.40
> > > > > Suse Linux 8.2
> >
> > > > Your ESQL / C program has no environemnt to run in when called
> direclt
> > > > from SPL
> >
> > > > You need a script that sets the environment - PATH,
Informixserver,
> > > > informixdir , library path etc and then runs the program
> >
> > > > call the script from your SPL procedure
> >
> > > Hello scottishpoet,
> >
> > > in my last test from yesterday I call my program and the program
is
> > > only the main function without access to any database.
> > > Thus program don't need any environment to database.
> > > But I want to adopt your proposal and today I start my program
from a
> > > script with settings of
> > > INFORMIXSERVER,DBSERVERNAME, INFORMIXDIR, LD_LIBRARY_PATH
> > > and it is not work. I receive the same error !
> >
> > > Slawek
> >
> > > It isn't works
> >
> > Where does the program reside? Is it on the server's host machine
or
> > a separate client machine?
> >
> > IDS's SYSTEM command can only run tasks/scripts that reside on the
> > server's host. Also, the execution privileges of the file must
> > include user 'informix'.
> >
> > Art S. Kagel
>
> Program reside on the IDS-SERVER. It is called with full absolute path
> and hat 755 permissions.
>
> Slawek
>
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
slawek_k wrote:
> On Jun 27, 2:56 pm, scottishpoet <drybur...@yahoo.com> wrote:
>> On Jun 27, 12:17 pm, slawek_k <slawek.korde...@t-online.de> wrote:
>>> I receive this error if I call my in ESQL-C written program from any
>>> SPL-procedure with the command "system(/path_to_my_program/
>>> my_program)".
>>> The program works fine if I call it from command line.
>>> IDS can find all notify libraries to run this program because the
>>> LD_LIBRARY_PATH is set correctly.
>>> I have test and change my_program into any OS-command for example
>>> "ls" . It is works correctly.
>>> In the next test I have written my_program with only main function and
>>> without calls of database etc. Thus it don't work on the database but
>>> it is compiled with INFORMIX-ESQLC libraries. It is don't work!
>>> My question:
>>> is it not allowed to call any ESQLC-program from SPL procedure ???
>>> Why ?
>>> My enviroment:
>>> IDS 9.40
>>> Suse Linux 8.2
>> Your ESQL / C program has no environemnt to run in when called direclt
>> from SPL
>>
>> You need a script that sets the environment - PATH, Informixserver,
>> informixdir , library path etc and then runs the program
>>
>> call the script from your SPL procedure
>
> Hello scottishpoet,
>
> in my last test from yesterday I call my program and the program is
> only the main function without access to any database.
> Thus program don't need any environment to database.
> But I want to adopt your proposal and today I start my program from a
> script with settings of
> INFORMIXSERVER,DBSERVERNAME, INFORMIXDIR, LD_LIBRARY_PATH
> and it is not work. I receive the same error !
I think a Google search (in groups.google.com and this news group) for
the subject '(ancient history) 668: System command cannot be executed,
255: Not in transaction' will reveal what is happening - the problem isthe exit status of the program. You could probably use alternative
(shorter) searches too - like 'ancient 668'.
It is still possible that you have a real problem, but you should
certainly take a look and see whether that helps you.
If it does not help, then arrange to run whatever program you are using
via a shell script that logs the environment to a file.
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2007.0226 -- http://dbi.perl.org/
Everett Mills wrote:
> As the poet said, when spl executes a system program, the
> executed program has no environment by default.
Not quite true - it has the environment of IDS (the oninit process),
with some values taken from the client (but not all of them).
> Try running a script
> that sets your environment and executes your program instead. Maybe
> something like this:
>
> cd my_path_name_here
>
> # Set environment for the database
> export INFORMIXDIR=/usr/informix
> export PATH=$PATH:$INFORMIXDIR/bin> export TERMCAP=/usr/informix/etc/termcap
> export DBDATE=MDY2
> export LD_LIBRARY_PATH=/usr/informix/lib:/usr/informix/lib/esql:> export DBCENTURY=C
> export ONCONFIG=onconfig
> export INFORMIXSQLHOSTS=$INFORMIXDIR/etc/sqlhosts
> export INFORMIXSERVER=my_server>
> my_program_name_here
>
> You will have to modify this to match your $INFORMIXDIR, etc.
Despite my initial comment, this is sound advice.
For whatever it is worth, I run IDS with an extremely tightly controlled
environment. By the time programs are run I get the following output:
Black JL: sqlcmd -d stores
SQL[1729]: create procedure sys(i integer default 0);
> system "environ >/tmp/environ.out";
> end procedure;
SQL[1730]: execute procedure sys(1);
SQL[1731]: bye;
Black JL: cd /tmp
Black JL: more environ.out
Date: Fri Jun 29 23:37:08 PDT 2007
Machine: black (SunOS 5.10)
User: uid=9508(jleffler) gid=1240(RD)
groups=54324(dbaao),54325(dbsso),54326(dbsa),8714(ccusers),1260(SA)
Directory: /work1/jleffler
Umask: 07
Terminal: not a tty
Limits (soft:hard):
coredump(blocks) unlimited:unlimited
data(kbytes) unlimited:unlimited
file(blocks) unlimited:unlimited
nofiles(descriptors) 256:256
stack(kbytes) 8192:unlimited
time(seconds) unlimited:unlimited
vmemory(kbytes) unlimited:unlimited
Environment:
CLIENT_LOCALE=en_US.8859-1
DBDATE=Y4MD-DBMONEY=$.
DBPATH=//black_11DBTEMP=/tmp
INFORMIXDIR=/usr/informix/10.00.UC5
INFORMIXSERVER=black_11LC_COLLATE=en_US.819
LC_CTYPE=en_US.819
LC_MONETARY=en_US.819
LC_NUMERIC=en_US.819
LC_TIME=en_US.819
ONCONFIG=onconfig.black_11
PATH=.:/work1/jleffler/bin:/u/jleffler/bin:/usr/informix/10.00.UC5/bin:/u/jleffler/solaris/bin:/usr/openssl/v0.9.7/bin:/usr/informix/9.40.UC7/bin:/usr/gnu/bin:/usr/atria/bin:/usr/perl/v5.8.8/bin:/usr/
bin:/usr/python/v2.5/bin:/usr/gdb/v6.2.1/bin:/usr/gnupg/v1.2.6/bin:/usr/gcc/v4.2.0/bin:/usr/tcl/v8.4
.11/bin:/workshop/Studio11/SUNWspro/bin:/usr/ccs/bin:/usr/dt/bin:/usr/openwin/bin:/usr/local/bin:/us
r/sbin:/sbin
PWD=/work1/jleffler
SERVER_LOCALE=en_US.819
SHELL=/usr/bin/ksh
SQLPID=192311320
TZ=US/Pacific
_=/usr/gnu/bin/env
Black JL: asroot -- onstat -g env
IBM Informix Dynamic Server Version 10.00.UC5 -- On-Line -- Up 28
days 04:17:06 -- 31744 Kbytes
Server start-up environment:
Variable Value [values-list]
DBDELIMITER |
DBPATH .
DBPRINT lp -s
DBTEMP /tmp
IFX_LISTEN_TIMEOUT 3
INFORMIXCONCSMCFG /usr/informix/10.00.UC5/etc/concsm.black_11
INFORMIXDIR /usr/informix/10.00.UC5
[/usr/informix/10.00.UC5]
[/usr/informix]
INFORMIXSERVER black_11
INFORMIXTERM termcap
LC_COLLATE en_US.819
LC_CTYPE en_US.819
LC_MONETARY en_US.819
LC_NUMERIC en_US.819
LC_TIME en_US.819
LKNOTIFY yes
LOCKDOWN no
NODEFDAC no
ONCONFIG onconfig.black_11
PATH /usr/bin:/usr/informix/10.00.UC5/bin
SERVER_LOCALE en_US.819
SHELL /usr/bin/ksh
TERM dumb
TERMCAP /etc/termcap
TZ UTC0
Of the variables listed in the 'onstat -g env' output, I set:
IFX_LISTEN_TIMEOUT
INFORMIXDIR
INFORMIXSERVER
ONCONFIG
PATH
SHELL
TZ
(and HOME, which is the same as $INFORMIXDIR; the current directory of
the server is also $INFORMIXDIR, even though the system statement had
switched directory to /work1/jleffler, which is the value of $HOME - and
not the same as ~jleffler, the home directory in /etc/passwd). The
other variables are set by IDS.
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2007.0226 -- http://dbi.perl.org/
On 30 Jun., 08:52, Jonathan Leffler <jleff...@earthlink.net> wrote:
> Everett Mills wrote:
> > As the poet said, when spl executes a system program, the
> > executed program has no environment by default.
>
> Not quite true - it has the environment of IDS (the oninit process),
> with some values taken from the client (but not all of them).
>
>
>
> > Try running a script
> > that sets your environment and executes your program instead. Maybe
> > something like this:
>
> > cd my_path_name_here
>
> > # Set environment for the database
> > export INFORMIXDIR=/usr/informix
> > export PATH=$PATH:$INFORMIXDIR/bin> > export TERMCAP=/usr/informix/etc/termcap
> > export DBDATE=MDY2
> > export LD_LIBRARY_PATH=/usr/informix/lib:/usr/informix/lib/esql:> > export DBCENTURY=C
> > export ONCONFIG=onconfig
> > export INFORMIXSQLHOSTS=$INFORMIXDIR/etc/sqlhosts
> > export INFORMIXSERVER=my_server>
> > my_program_name_here
>
> > You will have to modify this to match your $INFORMIXDIR, etc.
>
> Despite my initial comment, this is sound advice.
>
> For whatever it is worth, I run IDS with an extremely tightly controlled
> environment. By the time programs are run I get the following output:
>
> Black JL: sqlcmd -d stores
> SQL[1729]: create procedure sys(i integer default 0);
> > system "environ >/tmp/environ.out";
> > end procedure;
> SQL[1730]: execute procedure sys(1);
> SQL[1731]: bye;
> Black JL: cd /tmp
> Black JL: more environ.out
> Date: Fri Jun 29 23:37:08 PDT 2007
> Machine: black (SunOS 5.10)
> User: uid=9508(jleffler) gid=1240(RD)
> groups=54324(dbaao),54325(dbsso),54326(dbsa),8714(ccusers),1260(SA)
> Directory: /work1/jleffler
> Umask: 07
> Terminal: not a tty
>
> Limits (soft:hard):
> coredump(blocks) unlimited:unlimited
> data(kbytes) unlimited:unlimited
> file(blocks) unlimited:unlimited
> nofiles(descriptors) 256:256
> stack(kbytes) 8192:unlimited
> time(seconds) unlimited:unlimited
> vmemory(kbytes) unlimited:unlimited
>
> Environment:
> CLIENT_LOCALE=en_US.8859-1
> DBDATE=Y4MD-> DBMONEY=$.
> DBPATH=//black_11> DBTEMP=/tmp
> INFORMIXDIR=/usr/informix/10.00.UC5
> INFORMIXSERVER=black_11> LC_COLLATE=en_US.819
> LC_CTYPE=en_US.819
> LC_MONETARY=en_US.819
> LC_NUMERIC=en_US.819
> LC_TIME=en_US.819
> ONCONFIG=onconfig.black_11
> PATH=.:/work1/jleffler/bin:/u/jleffler/bin:/usr/informix/10.00.UC5/bin:/u/jleffler/solaris/bin:/usr/> openssl/v0.9.7/bin:/usr/informix/9.40.UC7/bin:/usr/gnu/bin:/usr/atria/bin:/usr/perl/v5.8.8/bin:/usr/
> bin:/usr/python/v2.5/bin:/usr/gdb/v6.2.1/bin:/usr/gnupg/v1.2.6/bin:/usr/gcc/v4.2.0/bin:/usr/tcl/v8.4
> .11/bin:/workshop/Studio11/SUNWspro/bin:/usr/ccs/bin:/usr/dt/bin:/usr/openwin/bin:/usr/local/bin:/us
> r/sbin:/sbin
> PWD=/work1/jleffler
> SERVER_LOCALE=en_US.819
> SHELL=/usr/bin/ksh
> SQLPID=192311320
> TZ=US/Pacific
> _=/usr/gnu/bin/env
> Black JL: asroot -- onstat -g env
>
> IBM Informix Dynamic Server Version 10.00.UC5 -- On-Line -- Up 28
> days 04:17:06 -- 31744 Kbytes>
> Server start-up environment:
>
> Variable Value [values-list]
> DBDELIMITER |
> DBPATH .
> DBPRINT lp -s
> DBTEMP /tmp
> IFX_LISTEN_TIMEOUT 3
> INFORMIXCONCSMCFG /usr/informix/10.00.UC5/etc/concsm.black_11
> INFORMIXDIR /usr/informix/10.00.UC5
> [/usr/informix/10.00.UC5]
> [/usr/informix]
> INFORMIXSERVER black_11
> INFORMIXTERM termcap
> LC_COLLATE en_US.819
> LC_CTYPE en_US.819
> LC_MONETARY en_US.819
> LC_NUMERIC en_US.819
> LC_TIME en_US.819
> LKNOTIFY yes
> LOCKDOWN no
> NODEFDAC no
> ONCONFIG onconfig.black_11
> PATH /usr/bin:/usr/informix/10.00.UC5/bin
> SERVER_LOCALE en_US.819
> SHELL /usr/bin/ksh
> TERM dumb
> TERMCAP /etc/termcap
> TZ UTC0
>
> Of the variables listed in the 'onstat -g env' output, I set:
> IFX_LISTEN_TIMEOUT
> INFORMIXDIR
> INFORMIXSERVER
> ONCONFIG
> PATH
> SHELL
> TZ
> (and HOME, which is the same as $INFORMIXDIR; the current directory of
> the server is also $INFORMIXDIR, even though the system statement had
> switched directory to /work1/jleffler, which is the value of $HOME - and
> not the same as ~jleffler, the home directory in /etc/passwd). The
> other variables are set by IDS.
>
> --
> Jonathan Leffler #include <disclaimer.h>
> Email: jleff...@earthlink.net, jleff...@us.ibm.com
> Guardian of DBD::Informix v2007.0226 --http://dbi.perl.org/
Hello,
the problem is solved !
I made two errors.
The first: I have assumed that when the IDS started read the .profile
in its $HOME und set the LD_LIBRARY_PATH correctly.But it doesn't set
environment from
user informix. Followed environment from my IDS
SERVER_LOCALE=en_US.819
SQLPID=1912143896
DBPATH=.SHELL=/bin/bash
INFORMIXDIR=/home/informix
CLIENT_LOCALE=de_de.8859-1DBCENTURY=C
DBMONEY=,EUR
ONCONFIG=onconfig
DBDATE=dmy4.TBCONFIG=onconfig
PATH=/home/informix:/home/informix/bin:/home/bank_tr/sh:.:/home/bank_tr/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/
opt/gnome2/bin:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/java/jre/bin:/opt/
gnome/bin
PWD=/home/bank_tr
DB_LOCALE=de_de.8859-1SHLVL=1
INFORMIXSERVER=idsmarsDBTEMP=/tmp
INFORMIXSQLHOSTS=/home/informix/etc/sqlhosts
No LD_LIBRARY_PATH in environment ! So I follow your suggestion and
started my program from the script but at the same time I made
second error and set INFORMIXDIR to /opt/informix instead to /home/
informix
After I set the correct INFORMIXDIR the program is running !
Thank you for your help!
Slawek