Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / Informix Topics / May 2008

Tip: Looking for answers? Try searching our database.

Problem running a 4GL program with an stored procedure

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
roger.camargo@gmail.com - 21 May 2008 23:12 GMT
We had a system that used STORED PROCEDURES(Launched via an ODBC
connection) to execute 4GL programs that generate TXT files (data
delimited with "|") that were loaded then into another program.

We have migrated to the new INFORMIX 11.50 and when we try to run the
stored procedures there is an error produced:

Error: The system command cannot be executed or it exited with a non-
zero status. (State:S1000, Native Code: FFFFFD64)

The stored procedure that we create is:

CREATE PROCEDURE test()
SYSTEM 'fglgo /disco2/bexe/sgfreversiones.4gi';
END PROCEDURE;

And we execute it:
EXECUTE PROCEDURE test();

Information on our previous system:
INFORMIX 9.4 running on a Sun SOLARIS

and now:
INFORMIX 11.50 running on Linux RED HAT

Any hints and help would be appreciated

Roger Camargo
Cochabamba - Bolivia
Paul Watson (Oninit) - 22 May 2008 05:41 GMT
> We had a system that used STORED PROCEDURES(Launched via an ODBC
> connection) to execute 4GL programs that generate TXT files (data
[quoted text clipped - 22 lines]
>
> Any hints and help would be appreciated

This is probably the environment

Drop the fglgo line into a script and run the script. Within the script
you can set a 'good' environment or just add a 'set -x' to see the errors

Cheers
Paul
scottishpoet - 23 May 2008 11:44 GMT
> roger.cama...@gmail.com wrote:
> > We had a system that used STORED PROCEDURES(Launched via an ODBC
[quoted text clipped - 33 lines]
>
> - Show quoted text -

As Paul says this is likely environemnt related

the fglgo needs to know INFIRMIXDIR etc of the rds software

replace the fglgo in the stored procedure with a script and in the
script set the appropriate environment variables prior to running the
fglgo statement

You may want to export the stored procedure from the "old" system as
this would have had to implement a similar solution
roger.camargo@gmail.com - 23 May 2008 14:32 GMT
> > roger.cama...@gmail.com wrote:
> > > We had a system that used STORED PROCEDURES(Launched via an ODBC
[quoted text clipped - 46 lines]
>
> - Mostrar texto de la cita -

As scottishpoet suggested it is the exported one from the "old" system
that is currently executed.

To know if the enviroment was the correct I made this SP :

CREATE PROCEDURE sgftest()
SYSTEM 'echo $INFORMIXDIR > informixdir.txt';
SYSTEM 'echo $INFORMIXSERVER > informixserver.txt';
SYSTEM 'echo $ONCONFIG > onconfig.txt';
END PROCEDURE;

and when I executed I checked the files generated and they had the
correct values, that shows that the enviroment is correct.

Now I'll try to make an script and then execute this script with an
SP, but I'm afraid that the result will be the same, the script would
be like this:

test.sh
#!/bin/sh
export INFORMIXDIR=/home/informix
export INFORMIXSERVER=segunda
export ONCONFIG=onconfig.segunda
fglgo /disco2/bexe/roger/sgfreversiones.4gi

then I'll create an SP

CREATE PROCEDURE test()
SYSTEM 'sh test.sh;
END PROCEDURE;

This would be correct or  I need to modify my script, maybe add
something more or delete something?

Thanks for your help.
roger.camargo@gmail.com - 23 May 2008 14:44 GMT
On 23 mayo, 09:32, "roger.cama...@gmail.com" <roger.cama...@gmail.com>
wrote:

> > > roger.cama...@gmail.com wrote:
> > > > We had a system that used STORED PROCEDURES(Launched via an ODBC
[quoted text clipped - 84 lines]
>
> - Mostrar texto de la cita -

I did exactly as I said in the previous entry and the same error
message happened when I executed the SP.

Error: The system command cannot be executed or it exited with a non-
zero status. (State:S1000, Native Code: FFFFFD64)

Executing the script directly from command line works as expected.

The sgfreversiones.4gl is like this (maybe there is something wrong
with it):

database tbase
define
    t1 record like adaud.*,
    g_spool char(20),
    l_argu char(60),
    ### DATOS DE LA TABLA ###
    fecha date,
    horatransaccion char(8),
    horaautorizacion char(8),
    horareversion char(8),
    inicusuariorever char(3),
    inicusuarioautor char(3),
    tipotransac char(70),
    monto like adaud.adaudimpo,
    cliente char(50),
    ### DATOS DE LA TABLA ###
    fdia date,
    cfdia char(10),
    fini date,
    cfini char(10),
    x char,
    tipocambio like gbhtc.gbhtctcof,
    tcof like gbpmt.gbpmttcof
main
    let g_spool="sgfreversiones.txt"
    start report sgfreversiones to g_spool
    select gbpmtfdia into fdia from gbpmt
    select gbpmttcof into tcof from gbpmt
    let cfdia=fdia
    let cfdia=cfdia clipped
    let cfini="01/",cfdia[4,10]
    let cfini=cfini clipped
    let fini=cfini
    declare curs cursor for
    select * from adaud
    where adaudfpro between fini and fdia
    foreach curs into
        t1.*
        error "Procesando el numero de autorizacion: ...",t1.adaudnaut
        call nulos()
        select gbhtctcof into tipocambio from gbhtc
        where gbhtcfech=t1.adaudfpro
        if tipocambio is null then
            let tipocambio=0
        end if
        let fecha=t1.adaudfpro
        let horatransaccion=t1.adaudshor
        let horaautorizacion=t1.adaudahor
        let horareversion=null # no puedo relacionar esta hora
        let inicusuariorever=t1.adaudsusr
        let inicusuarioautor=t1.adaudausr
        let tipotransac=t1.adaudglos
        if t1.adaudcmon=1 then
            let monto=t1.adaudimpo/tipocambio
        else
            let monto=t1.adaudimpo
        end if
        select gbagenomb into cliente from gbage
        where gbagecage=t1.adaudcage
        output to report sgfreversiones()
    end foreach
end main
report sgfreversiones()
output
    page length 1
    top margin 0
    bottom margin 0
    left margin 0
    right margin 0
format
on every row
    print
fecha,"|",horatransaccion,"|",horaautorizacion,"|",horareversion,
    "|",inicusuariorever,"|",inicusuarioautor,"|",tipotransac,"|",
    monto,"|",cliente
end report
function nulos()
    let fecha=null
    let horatransaccion=null
    let horaautorizacion=null
    let horareversion=null
    let inicusuariorever=null
    let inicusuarioautor=null
    let tipotransac=null
    let monto=null
    let cliente=null
    let tipocambio=null
end function

Any more hints? Maybe the output of the 4gl program is terminating the
program when running via an SP?
mosserp@wellsfargo.com - 27 May 2008 22:17 GMT
> -----Original Message-----
> From: informix-list-bounces@iiug.org [mailto:informix-list-
[quoted text clipped - 112 lines]
>
> Executing the script directly from command line works as expected.

<< snipped >>

Did you add $INFORMIXDIR/bin to the PATH environment within the script?

HTH,
Paul M.
scottishpoet - 28 May 2008 10:46 GMT
Its been a while, as well as PATH you may also need LD_LIBRARY_PATH
(or whatever the rquivalent is on your OS) You need it for 4Gl, not so
sure about RDS
Superboer - 28 May 2008 10:58 GMT
> Its been a while, as well as PATH you may also need LD_LIBRARY_PATH
> (or whatever the rquivalent is on your OS) You need it for 4Gl, not so
> sure about RDS

i would:

CREATE PROCEDURE test()
SYSTEM '/realpath_to_yourscript/test.sh > /tmp/nonexistingfilemakesure
2>&1;
END PROCEDURE;

in /tmp/nonexistingfilemakesure there should be the real reason why it
fails.

Superboer.

way fast=http://www.clipjes.nl/clip/nederlands/n/normaal_-
_oerend_hard.html
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.