Re: dbload
Posted in 1999
Topics: General Discussion
>This is a newbie question. I am using the dbload utility. I am creating
>the command or .ctl file and want the path of the file using an
>environment variable. If I type: FILE "/path/filename" this works, but
>it does not work using an environment variable(ex. FILE "$NAME"). This
>is a pretty basic question, but would appreciate any help.
Did you export the FILE environment variable?
HTH.
--
"I'll Be Back"
Obnoxio
************************************************
Sane? Hell, if I was sane, why would I be here?
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
Obnoxio The Clown wrote:
> >This is a newbie question. I am using the dbload utility. I am
> >creating the command or .ctl file and want the path of the file
> >using an environment variable. If I type: FILE "/path/filename"
> >this works, but it does not work using an environment variable
> >(ex. FILE "$NAME").
>
> Did you export the FILE environment variable?
More significantly, where did the manual say that environment
variables are accepted anywhere in the DB-Load command file?
Answer: nowhere, because DB-Load ignores the possibility that
$FILE might mean anything other than a file with a 5-character
name.
So, you have to get inventive. In some circumstances, I'd use
a shell here-document to create the command file. In others,
I'd use the sqlreload command that comes as an alias for sqlcmd
in the SQLCMD package available at the IIUG web-site. There are
undoubtedly other methods; some are relatively simple (sed, awk),
and others are harder (Perl, Tcl, using /dev/stdin or /dev/fd/0).
--
Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN
#include <disclaimer.h>