Question Importing to a temp table confusion

Tracy Hall

New Member
Hi, I am very new to Progress and just when I feel like some of this is sinking in, Progress throws me a curve ball.

Basically I need to pull in two text files into temp tables and put some stuff from the second one into a third temp table with the first text file data for output.

All that looping and stuff I have not gotten to yet. I have inputted and imported and if I display inside the repeat I see all my data in the fields just fine. If I loop through the temp table outside the repeat, and display I see the last value.

I have read about making a temp table global, but it does not like how I am doing it and I cannot find a good example. I have also seen making the stream global and I saw an example and did it like that and Progress barked at me for that.

I may have been reading about export when I saw this, but I tried skip at the end of the import. Of course I got an error for that.

DEFINE STREAM s-input.
DEFINE STREAM s-input2.
INPUT STREAM s-input FROM C:\NAA\rsrinventory-new.txt.
INPUT STREAM s-input2 FROM C:\NAA\attributes-all.txt.

DEFINE TEMP-TABLE ttProd
FIELD ......

DEFINE TEMP-TABLE ttAttr
FIELD ......

REPEAT:

IMPORT STREAM s-input DELIMITER ";" ttProd.* bunch of fields *.
END.

REPEAT:
IMPORT STREAM s-input2 DELIMITER ";" ttAttr.* bunch of fields *.
END.

INPUT CLOSE.
FOR EACH ttProd NO-LOCK:
DISPLAY ttProd.field1.
END.

I am sure it is something simple, but I don't want to be stuck in the house all weekend trying to figure it out. I need to get the other part done so I can at least enjoy a relaxing Sunday.

Thanks for any insight you can provide.

Tracy o_O
 

Stefan

Well-Known Member
Please put code inside [ code ] tags.

You need to CREATE your temp-table record before IMPORTing (inside the loops, so one record is created per import).
 

Tracy Hall

New Member
Please put code inside [ code ] tags.

You need to CREATE your temp-table record before IMPORTing (inside the loops, so one record is created per import).


Ah, I am sorry about the [ code ] tags. I am new to that too. I should have thought about that from experience posting on our wiki.

Stefan, you my friend are awesome!! Thanks!

I would have been looking everywhere else and never realizing that was it. :confused:

Thank you, thank you, thank you! :)
 
Top