Executing Informix dbaccess in a Windows background environment



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:



1) Make sure that the system command is not trying to run
something that is not in your path or that is not applicable to the
environment.

2) Make sure that you have provided a user-id and password when
connecting to the database server. The database server must have the
user's password in order to execute a command on behalf of that user.

3) On Windows platforms, make sure the following Advanced User
Rights have been assigned to user "informix":

a) Act as part of the operating system;

b) Increase quotas;

c) replace a process level token



Conditions 1 & 2 were fulfilled, but no amount of fiddling with
ownership and access rights on the folders helped, although we have not
consciously implemented conditions 3a, b & c. Please help, as I am not
familiar with this part of Windows.



Up until now our tests have been carried out interactively, and entering
the password is not a problem. To accomplish this automatically, we
tried to run a '.bat' file in the style of the following Unix script,
hoping to connect to the database in non-menu mode:



dbaccess - - <<\!

connect to 'dcs_ctr' user 'informix'

'pw01'

q

c

'exp'

r

e

e

!





In the above script, 'pw01' is the hard-coded user password, and 'exp'
refers to an sql script, 'exp.sql', that uses the 'unload' function to
extract the data from the database. The single letters in the script
activate dbaccess menu commands.



Upon invoking this script an error was returned in the first line
indicating that '<<' was unexpected. In Unix, '<<!' means "take input
from the lines that follow in the script up to a line containing '!' ".
Please help me establish the Windows equivalent of this instruction.





Thanks

David Reed



Relevant Pages

  • RE: Problem running a 4GL program with an stored procedure
    ... EXECUTE PROCEDURE test; ... INFORMIX 11.50 running on Linux RED HAT ... script set the appropriate environment variables prior to running ... Did you add $INFORMIXDIR/bin to the PATH environment within the script? ...
    (comp.databases.informix)
  • Re: script "chaining"
    ... If a task would take too long to run while attached to the browser, the current system writes the data to a database file. ... The daemon checks that file every 10 seconds and executes the task, writing the data back to database. ... If you take the A out of LAMP you can write a php script like a bash script or a perl script and execute it. ...
    (comp.lang.php)
  • Re: File upload permissions
    ... The database is for agendas, minutes and audio of various city meetings. ... The script then updates the database. ... You say, the "and run it" part isn't true if it's not inside the document tree (and if it is inside the document tree, that's incredibly ... If your webserver is set up correctly, it won't execute .txt, .pdf, etc. files. ...
    (comp.lang.php)
  • Re: Permission denied
    ... This script is a little different that others ... I've written in that it inserts records into a database table. ... the error above when I execute it on a server. ... permissions. ...
    (microsoft.public.windows.server.scripting)
  • Re: what word will stop everything after it in a SQL script?
    ... That will only work if your entire script does not have a GO statement ... > Need smaller SQL2K backup files? ... >> Suddenly it wants to execute everything on the screen. ... >> and I don't want to specify a real database name. ...
    (microsoft.public.sqlserver.programming)