[comp.databases] reading flat files in Informix

scotto@crash.cts.com (Scott O'Connell) (11/30/89)

I have a need to read in prepared text files with Informix 4GL.  The
application is to prepare a document with Word Perfect and save it
in ASCII format.  Here's an example of what I need to do:

Have a saved WP document with keywords in the document.  Have Informix
open the file and read each line into text_line (ARRAY[67] OF CHAR(85))
until the end of file is reached.

Here's what I was thinking, knowing what I know of the Informix functions
in C (read: not much):

CALL read_in_file(<filename>) RETURNING text_line[1], text_line[2], ...,
  ..., text_line[67]

Then, I could parse each text_line for keywords in 4GL.  It would be
even better if I could do something like:

CALL open_text_file(<filename>)

WHILE NOT text_line[a][1,7] = "**END**"
  CALL read_line(<filename>) RETURNING text_line[a]
  LET a = a + 1
END WHILE

CALL close_text_file(<filename>)

I guess another way to do it would be create a table, load the flat
file in line-by-line and get to the data that way.  I guess that's an
option. 

I'm not a C programmer (although I'm starting to learn), but even if I
was, I think I'd still have problems trying to make this work.  

Thanks

P.S. Are there any BBS's geared towards Informix programmers?
-- 
Scott O'Connell		UUCP: {nosc, ucsd, hplabs!hp-sdd}!crash!ipars!scotto
			ARPA: crash!ipars!scotto@nosc.mil
			INET: scotto@ipars.cts.com

sullivan@aqdata.uucp (Michael T. Sullivan) (11/30/89)

From article <792@crash.cts.com>, by scotto@crash.cts.com (Scott O'Connell):
> I have a need to read in prepared text files with Informix 4GL.  The

I was about to respond to this article with something along the lines
of filters and using RDSQL's "load" command when something made me look
in the 4gl manual.  I find out there is no "load" command and there is
no "unload" command in 4gl, unlike SQL.  Am I missing something here?
If I'm not, I'm going to be very upset.
-- 
Michael Sullivan          uunet!jarthur.uucp!aqdata!sullivan
aQdata, Inc.              aqdata!sullivan@jarthur.claremont.edu
San Dimas, CA

scotto@crash.cts.com (Scott O'Connell) (12/01/89)

Something I didn't mention (hey, *I* knew what I wanted :-) was that the
parsing of lines for keywords was to add DB information.

SELECT * FROM customers WHERE MONTH(last_sale) < MONTH(TODAY-1)

Dear <contact>, $ Add customers.contact1

Because you're a valued customer .... we are concered that...
you last purchase <last_purch_date>...

-- 
Scott O'Connell		UUCP: {nosc, ucsd, hplabs!hp-sdd}!crash!ipars!scotto
			ARPA: crash!ipars!scotto@nosc.mil
			INET: scotto@ipars.cts.com

bgolden@infmx.UUCP (Bernard Golden) (12/01/89)

In article <1989Nov29.233548.14714@aqdata.uucp> sullivan@aqdata.uucp (Michael T. Sullivan) writes:
>From article <792@crash.cts.com>, by scotto@crash.cts.com (Scott O'Connell):
>> I have a need to read in prepared text files with Informix 4GL.  The
>
>I was about to respond to this article with something along the lines
>of filters and using RDSQL's "load" command when something made me look
>in the 4gl manual.  I find out there is no "load" command and there is
>no "unload" command in 4gl, unlike SQL.  Am I missing something here?
>If I'm not, I'm going to be very upset.

You are not missing something; however, LOAD and UNLOAD will be available 
in the next release (4.0), scheduled to be available early next year.
Hope this helps.

-b

dranney@infmx.UUCP (David Ranney) (12/01/89)

In article <1989Nov29.233548.14714@aqdata.uucp> sullivan@aqdata.uucp (Michael T. Sullivan) writes:
>From article <792@crash.cts.com>, by scotto@crash.cts.com (Scott O'Connell):
>> I have a need to read in prepared text files with Informix 4GL.  The
>
>I was about to respond to this article with something along the lines
>of filters and using RDSQL's "load" command when something made me look
>in the 4gl manual.  I find out there is no "load" command and there is
>no "unload" command in 4gl, unlike SQL.  Am I missing something here?
>If I'm not, I'm going to be very upset.

You are sort of correct.  There is no "unload" command in 4gl, but you can
write a short report that acts like unload.  There is no "load" command per-se,
but dbload does the exact same type of thing.  Look in the appendices of your
reference manual for an explanation of dbload.


-------------------------------------------------------------------------------
David Ranney ({!uunet|!pyramid}!infmx!dranney)            Go Brewers!!  please?
             Consequences, schmonsequences; as long as I'm rich.  -- Daffy Duck

Disclaimer:  Informix doesn't pay me enough to write their opinions.
-------------------------------------------------------------------------------

sullivan@aqdata.uucp (Michael T. Sullivan) (12/02/89)

From article <2727@infmx.UUCP>, by bgolden@infmx.UUCP (Bernard Golden):
> In article <1989Nov29.233548.14714@aqdata.uucp> sullivan@aqdata.uucp (Michael T. Sullivan) writes:
>>
>>in the 4gl manual.  I find out there is no "load" command and there is
>>no "unload" command in 4gl, unlike SQL.  Am I missing something here?
>>If I'm not, I'm going to be very upset.
> 
> You are not missing something; however, LOAD and UNLOAD will be available 
> in the next release (4.0), scheduled to be available early next year.
> Hope this helps.

4.0?  What happened to 3.0?  What happened to 2.11?  I have a customer that
just bought 4gl and it was still 2.10{.whatever}.  Who missed what?
-- 
Michael Sullivan          uunet!jarthur.uucp!aqdata!sullivan
aQdata, Inc.              aqdata!sullivan@jarthur.claremont.edu
San Dimas, CA

aland@infmx.UUCP (Dr. Scump) (12/04/89)

In article <1989Dec1.191427.17206@aqdata.uucp> sullivan@aqdata.uucp (Michael T. Sullivan) writes:
>From article <2727@infmx.UUCP>, by bgolden@infmx.UUCP (Bernard Golden):
>> You are not missing something; however, LOAD and UNLOAD will be available 
>> in the next release (4.0), scheduled to be available early next year.
>> Hope this helps.
>
>4.0?  What happened to 3.0?  What happened to 2.11?  I have a customer that
>just bought 4gl and it was still 2.10{.whatever}.  Who missed what?

Actually, 4GL would be version 1.10.something.  

>Michael Sullivan          uunet!jarthur.uucp!aqdata!sullivan

The full SQL product line is being resequenced so that each of the 
products uses the same version numbering.  Here's how to translate:

Product         Current version                     New Version
-------         ---------------                     -----------
C-ISAM              3.10.03K                          4.00
I-SQL               2.10.03K                          4.00
ESQL/C              2.10.03K                          4.00
ESQL/COBOL          2.10.03K                          4.00
ESQL/FORTRAN            -                             4.00
ESQL/Ada                -                             4.00
I-4GL               1.10.03K                          4.00
I-4GL RDS           1.10.03K                          4.00
I-4GL ID            1.10.03K                          4.00
(Std. engine)       2.10.03K         INFORMIX-SE      4.00
I-NET (std. eng.)   2.10.03K         INFORMIX-NET     4.00
I-TURBO             1.10.03K         INFORMIX-OnLine  4.00
I-NET TURBO         1.10.03K         INFORMIX-STAR    4.00

--
    Alan S. Denney  @  Informix Software, Inc.    
         {pyramid|uunet}!infmx!aland                 "I want to live!
   --------------------------------------------       as an honest man,
    Disclaimer:  These opinions are mine alone.       to get all I deserve
    If I am caught or killed, the secretary           and to give all I can."
    will disavow any knowledge of my actions.             - S. Vega

bgolden@infmx.UUCP (Bernard Golden) (12/05/89)

In article <1989Dec1.191427.17206@aqdata.uucp> sullivan@aqdata.uucp (Michael T. Sullivan) writes:
>From article <2727@infmx.UUCP>, by bgolden@infmx.UUCP (Bernard Golden):
>
>4.0?  What happened to 3.0?  What happened to 2.11?  I have a customer that
>just bought 4gl and it was still 2.10{.whatever}.  Who missed what?

No one missed anything.

In an effort to bring our version numbering schemes on various platforms
and products into a more understandable format, we have developed a new
version numbering scheme for the next release.  All products will be brought
up to 4.0 to ensure unique identifiers.  As to 2.11, I am not familiar with
it, so I don't know if it exists.  I tend to think it doesn't.

-b