Exporting files with fixed length records.
Posted in 1997
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Migration, Import/Export & Data Conversion, Platform-Specific Issues
I am trying to export data using UNLOAD TO <file> SELECT ... in an SQL statement such that it produces a fixed length record i.e. all fields maintain a fixed length across all records.(I need the fastest method) 1.The first problem I encountered was in SELECTing all the required fields: the spaces at the end of char(n) entries were ignored, truncating the value. This can be overcome by concatenating the fields (using || between fieldnames). This produces an additional problem: 2.Fields which are null make the whole concatenated string null. In particular I have datetime year to minute fields which can be null, and these need to be replaced by a string of spaces. I am using Online 7.1, HP-UX9.0/ AIX3.2.5 with Hyperscript Tools (legacy informix tool which has some ESQL functions but is interpreted I think). I can code the solution in Hyperscript Tools but with 900,000 records this would be very slow. Is there a fast way using SQL / Stored Procedures ? I don't have access to 4GL. Any help would be appreciated. -- ----------------------------------------------------- | Jason Lightfoot EMail jason@aesop.co.uk | | AESOP Ltd Voice 44 1772 200380 | | PTMC, Marsh Lane Fax 44 1772 200404 | | Preston. PR1 8UD | | England | -----------------------------------------------------