Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / Informix Topics / October 2003

Tip: Looking for answers? Try searching our database.

output format select

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mitja Udovc - 30 Oct 2003 08:29 GMT
Hello!

I have to export several tables from informix to sdf text format (all fields
must be specific length, numeric fields must be right justified and
completed with 0 on the left, alphanumeric fields must be left justified and
completed with spaces).

Is it possible to format output using SELECT with some parameters?

Mitja
Jonathan Leffler - 30 Oct 2003 08:57 GMT
> I have to export several tables from informix to sdf text format (all fields
> must be specific length, numeric fields must be right justified and
> completed with 0 on the left, alphanumeric fields must be left justified and
> completed with spaces).

What is SDF text format?  Judging from the description, it is a
fixed-width field layout - with or without delimiters on fields?  What
about record delimiters? Newline?  What about escape conventions?
What about variable length types (VARCHAR - and BYTE and TEXT and so on).

> Is it possible to format output using SELECT with some parameters?

No.  For any of a variety of reasons - depending on your level of
sophistication with DB-Access or ESQL/C programming.

Consider using ACE from Informix-SQL.

You might be able to batter SQLCMD into doing what you need (-F
fixed).  Not sure about the leading zeroes in SQLCMD - you could hack
it easily enough (output.c, array fmt_f); you'd have to decide on how
to integrate it smoothly into the program.

Signature

Jonathan Leffler                   #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/

Ronald Cole - 30 Oct 2003 10:32 GMT
> I have to export several tables from informix to sdf text format (all fields
> must be specific length, numeric fields must be right justified and
> completed with 0 on the left, alphanumeric fields must be left justified and
> completed with spaces).
>
> Is it possible to format output using SELECT with some parameters?

No.  You should probably just unload the tables from dbaccess and feed
them to Perl scripts to do all that reformatting.  If you don't know
Perl, then this is an ideal project to start learning it with.  It
will pay off in spades for you if you have to do a lot of data
reformatting like this.

Another alternative might be to dump the tables to XML and use an XSLT
processor to reformat the data... you, of course, will have to figure
out how to dump the tables to XML (I don't even know if/how Informix
J/Foundation can do that) and code the XSL script (which isn't nearly
as pretty as a Perl script) and feed it all to Xalan.

Signature

Forte International, P.O. Box 1412, Ridgecrest, CA  93556-1412
Ronald Cole <ronald@forte-intl.com>      Phone: (760) 499-9142
President, CEO                             Fax: (760) 499-9152
My GPG fingerprint: C3AF 4BE9 BEA6 F1C2 B084  4A88 8851 E6C8 69E3 B00B

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.