Re: Help with Table export and backups...
Posted in 1999
Jack,
You don't state your platform, but on UNIX, try a shell script:
dbaccess dbname<<!
UNLOAD TO "${1}"
SELECT * FROM tab
WHERE col = ${2}!
Note: Ensure ! is on its own line.
Then run script with the database as the first argument and a value as the
second.
Run it from cron if you want it scheduled regularly.
Chris
"Bruce Robertson" <br@leith.walk.co.uk> on 07/07/99 14:43:19
Please respond to "Bruce Robertson" <br@leith.walk.co.uk>
To: informix-list@iiug.org
cc: (bcc: Chris West/Finance/MEDAS)
Subject: Re: Help with Table export and backups...
While I can't remember exactly how to do it this might help.
dbaccess can run SQL form the command line. You could use that.
Hope that helps.
Jack Murphy <jmurphy@fore.com> wrote in message
news:7lvgik$hj5$1@shell.fore.com...
> Hi All,
>
> I would really appreciate your help on this problem that I have.
>
> I need to create a script that will export tables to delimited text files
on
> a disk at regular intervals.
>
> My problems are these:
> 1). I assume that UNLOAD will do this for me but how can I pass it a file
> name to use to export the data to?
>
> 2). Can I write a stored procedure that I can run from the command line
that
> can take as parameters things like a filename, directory to store it in,
and
> number of records to export?
>
> I have never really done anything like this before and any help woulr be
> much appreciated,
>
> Thanks.
>
>
>