Re: Data type problem
Posted in 1997
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Data Types & Schema Design, Migration, Import/Export & Data Conversion, Platform-Specific Issues
Peter,
My knowledge of 4GL is non-existant HOWEVER, The cheapest and
dirtiest
way to unload a table (although it may take a long time) is:
1. Generate a new form. This lays out the fields in the order they
appear in the table.
2. Query and Escape. This gets ALL records.
3. Do an "Output" and follow the directions to create the file
"x.out"
output "Current list"
using "Unload format"
This will create a pipe separated file with uneven field length. This
is suitable
for inport to another version of Informix or other program allowing "pipe"
separated
data format. This is NOT suitable for import to IBM AS/400 or System 36
which
usually demands fixed field/record length.
----------------------------
Solution 2
Use Query language to create the one line query as you described for
4GL.
This works in the basic Query language in all versions (as far as I know).
----------------------------
Solution 3
If you require fixed length field/record output, Generate a report on
the table.
Using the "report to file" output option, this should give your information
in "record" format. If you need a separator character, you will need to
edit this report to put
a "pipe" or whatever character between every field name manually. Alter
the
"output every row" to be
output
on every row
print field1, "|", field2, "|" etc
The field names can be on multiple lines as long as each line ends with
the comma.
Hope this helps
Robert Butram
Butram System Engineering
Peter Wiley <peter@prospect.anprod.csiro.au> wrote in article
<EFMCIx.IvC@news.nsw.CSIRO.AU>...
> In article <3403FD11.F6FA2B5E@informix.com> "Mark D. Stock"
<mdstock@informix.com> writes:
> >Jonathan Leffler wrote:
> >>
> > > >From: "Kemlo" <abm62@dial.pipex.com>
> > > >Date: 26 Aug 1997 21:10:33 GMT
> > > >X-Informix-List-Id: <news.42144>
> > > >
> > > <SNIP>
> > >
> > > >I understand that there is a utility called "unload" which will
> > > export the
> > > >database in ASCII . My 4GL RDS package does not have this. Does
> > > anyone
> > > >know where I could get this utility.
> > >
> >> There's nothing called 'unload' as a program. There is an UNLOAD
> >> statement
> >> which can be embedded in an I4GL program:
> >>
> >> UNLOAD TO "tablename.unl" SELECT * FROM TableName> >>
> >> Repeat ad nauseam for each table in the database. If you still have
> >> the AIX
> >> system, you can use this to do the unloading. Given that you're
> >> working with
> >> a 1.1 I4GL, you probably do not have dbexport available, which does
> >> this job
> >> automatically.
> >
> >I don't think 4GL 1.10/2.10 HAD an UNLOAD command either. This could be
> >a
> >problem also.
>
> UNLOAD existed in ISQL back in 1989 with the 2.10 SE engine, maybe
> earlier. It didn't appear in R4GL until release 4.00. I remember having
to
> use ISQL or write reports to unload data back then.
>
> Best bet is to resurrect the AIX box, unload the data to ASCII using a
> tedious set of reports and then reload it. If you can't do that because
> the box is defunct....maybe someone here has one available.
>
> This pack rat still has a 1989 PC Informix dev system sitting in the book
> case.
>
> Peter Wiley
>
>