![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
|
On Jun 27, 12:17 pm, slawek_k <slawek.korde... (AT) t-online (DOT) 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 |
#4
| |||
| |||
|
|
On Jun 27, 2:56 pm, scottishpoet <drybur... (AT) yahoo (DOT) com> wrote: On Jun 27, 12:17 pm, slawek_k <slawek.korde... (AT) t-online (DOT) 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 |
#5
| |||
| |||
|
|
On Jun 28, 4:05 am, slawek_k <slawek.korde... (AT) t-online (DOT) de> wrote: On Jun 27, 2:56 pm, scottishpoet <drybur... (AT) yahoo (DOT) com> wrote: On Jun 27, 12:17 pm, slawek_k <slawek.korde... (AT) t-online (DOT) 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 |
#6
| |||
| |||
|
|
-----Original Message----- From: informix-list-bounces (AT) iiug (DOT) org [mailto:informix-list- bounces (AT) iiug (DOT) org] On Behalf Of slawek_k Sent: Friday, June 29, 2007 4:57 AM To: informix-list (AT) iiug (DOT) org Subject: Re: SQL error = -668 ISAM error = -127 On Jun 28, 5:49 pm, "Art S. Kagel" <art.ka... (AT) gmail (DOT) com> wrote: On Jun 28, 4:05 am, slawek_k <slawek.korde... (AT) t-online (DOT) de> wrote: On Jun 27, 2:56 pm, scottishpoet <drybur... (AT) yahoo (DOT) com> wrote: On Jun 27, 12:17 pm, slawek_k <slawek.korde... (AT) t-online (DOT) 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 (AT) iiug (DOT) org http://www.iiug.org/mailman/listinfo/informix-list |
#7
| |||
| |||
|
|
On Jun 27, 2:56 pm, scottishpoet <drybur... (AT) yahoo (DOT) com> wrote: On Jun 27, 12:17 pm, slawek_k <slawek.korde... (AT) t-online (DOT) 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 ! |
#8
| |||
| |||
|
|
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. |
|
system "environ >/tmp/environ.out"; end procedure; SQL[1730]: execute procedure sys(1); |
#9
| |||
| |||
|
|
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... (AT) earthlink (DOT) net, jleff... (AT) us (DOT) ibm.com Guardian of DBD::Informix v2007.0226 --http://dbi.perl.org/ |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |