flat file extracts
Posted in 2000
An Oracle DBA using dbaccess on Informix 7.2 (Solaris) to UNLOAD a table to a flat file wanted to suppress chatter like "Database selected" and "50 row(s) unloaded" in the log, asking for an equivalent of SQL*Plus's -s / set feedback off. Replies said dbaccess has no such switch: just redirect output to /dev/null (losing error messages too), and pointed to Informix's online docs. Others suggested sqlcmd (from the IIUG FTP site, with sqlunload/sqlreload) as a better batch-mode tool. The poster was satisfied.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Server Administration, Migration, Import/Export & Data Conversion
I am normally a Oracle DBA and developer, but I have a need to do some
extremely basic work with an Informix database.
As near as I can determine the version of Informix I'm dealing with is
7.2 and it is running on a Sun Ultra-5 workstation.
Basically what I'm doing is this:
dbaccess mydb <<-sqlEOF >extract.log 2>&1
unload to mydata.dat select lname,fname from userssqlEOF
It works fine. My data is extracted and it appears in the data file the
way I want. However, the log file that gets created contains messages
like "Database selected" "50 row(s) unloaded" and "Database closed". I
don't care about these messages. I'd like to eliminate them. With
Oracle's sqlplus I would do a combination of using -s on the command
line and "set feedback off" inside the script to turn off extraneous
messages. Is there any equivalent to this with dbaccess?
Beyond that, does anyone know of a url where I can find documentation on
dbaccess so that I don't have to ask questions like this here unless I
get really stuck on some issue?
Hi!
Use /dev/null as a destination for the log, if you don't care about it.
For documentation try: www.informix.com
HTH
Michael
Walter T Rejuney wrote:
> I am normally a Oracle DBA and developer, but I have a need to do some
> extremely basic work with an Informix database.
>
> As near as I can determine the version of Informix I'm dealing with is
> 7.2 and it is running on a Sun Ultra-5 workstation.
>
> Basically what I'm doing is this:
>
> dbaccess mydb <<-sqlEOF >extract.log 2>&1
> unload to mydata.dat select lname,fname from users> sqlEOF
>
> It works fine. My data is extracted and it appears in the data file the
> way I want. However, the log file that gets created contains messages
> like "Database selected" "50 row(s) unloaded" and "Database closed". I
> don't care about these messages. I'd like to eliminate them. With
> Oracle's sqlplus I would do a combination of using -s on the command
> line and "set feedback off" inside the script to turn off extraneous
> messages. Is there any equivalent to this with dbaccess?
>
> Beyond that, does anyone know of a url where I can find documentation on
> dbaccess so that I don't have to ask questions like this here unless I
> get really stuck on some issue?
Walter T Rejuney wrote:
>
> I am normally a Oracle DBA and developer, but I have a need to do some
> extremely basic work with an Informix database.
Good to have you with us.
>
> As near as I can determine the version of Informix I'm dealing with is
> 7.2 and it is running on a Sun Ultra-5 workstation.
>
> Basically what I'm doing is this:
>
> dbaccess mydb <<-sqlEOF >extract.log 2>&1
> unload to mydata.dat select lname,fname from users> sqlEOF
>
> It works fine. My data is extracted and it appears in the data file the
> way I want. However, the log file that gets created contains messages
> like "Database selected" "50 row(s) unloaded" and "Database closed". I
> don't care about these messages. I'd like to eliminate them. With
> Oracle's sqlplus I would do a combination of using -s on the command
> line and "set feedback off" inside the script to turn off extraneous
> messages. Is there any equivalent to this with dbaccess?
>
I would recommend something like this:
dbaccess mydb <<-sqlEOF >/dev/null 2>&1
unload to mydata.dat select lname,fname from users
sqlEOF
Of course, that would send the entire log to oblivion. Hopefully you
wouldn't want to trap errors or anything like that.
> Beyond that, does anyone know of a url where I can find documentation on
> dbaccess so that I don't have to ask questions like this here unless I
> get really stuck on some issue?
Some basic documentation could be found at
http://www.informix.com/answers/english/pids73.htm; however, feel free
to post here anytime. There is a wide range of Informix experience
here, from the newbie to the long-term Informix DBA. Enjoy!!
--
John Carlson
Informix DBA
WHSmith USA
#include std_disclaimer.h /* These are my opinions, not my company's
opinion */
Michael Krzepkowski wrote:
>
> Hi!
>
> Use /dev/null as a destination for the log, if you don't care about it.
>
> For documentation try: www.informix.com
>
> HTH
>
> Michael
>
> Walter T Rejuney wrote:
>
> > I am normally a Oracle DBA and developer, but I have a need to do some
> > extremely basic work with an Informix database.
> >
> > As near as I can determine the version of Informix I'm dealing with is
> > 7.2 and it is running on a Sun Ultra-5 workstation.
> >
> > Basically what I'm doing is this:
> >
> > dbaccess mydb <<-sqlEOF >extract.log 2>&1
> > unload to mydata.dat select lname,fname from users> > sqlEOF
> >
> > It works fine. My data is extracted and it appears in the data file the
> > way I want. However, the log file that gets created contains messages
> > like "Database selected" "50 row(s) unloaded" and "Database closed". I
> > don't care about these messages. I'd like to eliminate them. With
> > Oracle's sqlplus I would do a combination of using -s on the command
> > line and "set feedback off" inside the script to turn off extraneous
> > messages. Is there any equivalent to this with dbaccess?
> >
> > Beyond that, does anyone know of a url where I can find documentation on
> > dbaccess so that I don't have to ask questions like this here unless I
> > get really stuck on some issue?
Found all sorts of good documentation on the Informix web site - I'm
starting to get a better feel for how to use dbaccess now. I still wish
it were as robust as Oracle's sqlplus, but my needs are pretty simple in
this case.
Thanks everyone for all your help.
...................................................
...................................................
...................................................
...................................................
...................................................
...................................................
...................................................
...................................................
...................................................
...................................................
...................................................
...................................................
...................................................
...................................................
...................................................
...................................................
...................................................
...................................................
...................................................
...................................................
...................................................
...................................................
...................................................
...................................................
...................................................
v
Hi Walter,
> Found all sorts of good documentation on the Informix web site - I'm
> starting to get a better feel for how to use dbaccess now. I still wish
> it were as robust as Oracle's sqlplus, but my needs are pretty simple in
> this case.
what's not robust in dbaccess?
Wile
"Wile E. Coyote" wrote:
>
> Hi Walter,
>
> > Found all sorts of good documentation on the Informix web site - I'm
> > starting to get a better feel for how to use dbaccess now. I still wish
> > it were as robust as Oracle's sqlplus, but my needs are pretty simple in
> > this case.
>
> what's not robust in dbaccess?
dbaccess is OK for interactive use, but for batch mode it is not easy to
use.
However this is not much of a problem since we have "sqlcmd".
He really should download and compile "sqlcmd" from
ftp://ftp.iiug.org/pub/informix/pub/sqlcmd-55.tar.gz.
This comes with utilities sqlunload, sqlreload etc.
Hi David,
David Stes wrote:
>
> "Wile E. Coyote" wrote:
> >
> > Hi Walter,
> >
>
> dbaccess is OK for interactive use, but for batch mode it is not easy to
> use.
>
> However this is not much of a problem since we have "sqlcmd".
I ever use dbaccess in batch mode. Do I miss some features? I feel
not, but I will have a look on sqlcmd.
Wile