output format select
Posted in 2003
Topics: General Discussion
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
Mitja Udovc wrote: > 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. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/