RE: Executing Informix dbaccess in a Windows background environment
Posted in 2007
>From: "David Reed" <david.reed@tollink.co.za>
>Our main objective is to execute an Informix stored procedure that will
>export daily data from selected date-dependant database tables to disc
>files in a specified folder. This should be done in a Windows
>environment. We have tested a prototype procedure using a 'System' call
>to create an sql script file each day, and to execute it using dbaccess.
>(We used this method because SPL does not support the UNLOAD function.
>We keep getting error -668, which seems to mean that the user does not
>have permission to create the output file (which is strange because it
>has no trouble creating a trace file). The explanation for error -668
>is:
>
The first question that comes to mind is why do this from a stored
procedure?
First, I'm going to assume that the PC has the Informix engine local to it.
If the Informix engine is not on the windows environment, you're screwed.
What you're looking to do would be easier in any of the following
languages...
1) C/C++
2) Java
3) 4GL
4) Python
5) Ruby
Note: Each has its issues.
1) C/C++ requires that you have a C compiler for the windows environment.
2) A bit more complex than a scripting language, however, everything is
downloadable and *free*.
(JDBC is your *friend* :-)
3) If you're running IDS under Windows (ick), do you have 4GL? And a C
compiler? Same restrictions of C/C++, however 4GL is easier than ESQL/C
4) Python would require some sort of adaptor. Rumor has it that there's some
more Informix support from IBM on this, coming *soon*. I believe that there
is an adaptor somewhere in public source, so this may be a viable option.
5) Ruby's adaptor is available now from RubyForge. IBM is releasing their
own shortly. Ruby is definitely something to look in to.
If you're going to use any of these languages, you would best build some
sort of framework that you can re-use for your scripts.
Also, if the Informix engine isn't local, these scripts will still work for
you...
HTH
-G
_________________________________________________________________
Get a preview of Live Earth, the hottest event this summer - only on MSN
http://liveearth.msn.com?source=msntaglineliveearthhm