Hi all,
How can i load a text file into an ORACLE database as a column?
I would be grateful if anyone could shed some light on this.
Thanks in advance.
Storing a text file into ORACLE database
Moderators: chulett, rschirm, roy
Re: Storing a text file into ORACLE database
Read the Sequential file as one column, use a transformer with a stage variable.
In your stage variable's derivation append the contents of the rows of the sequential file like:
Stage_Var=Stage_Var : Seq_File.Col01
Write the contents of the stage variable to a Hashed file having one column as key (put hardcoded value in the derivation for this column) and other non key column will have the stage variable in its derivation. (you could also use the aggregator stage with Last derivation option instead of the Hashed File).
After every write the previous row would get over written since its of the same key.
The last row is your entire file's contents, write the content's of the Hashed File to the target table.
Hope this is what you are looking for.
In your stage variable's derivation append the contents of the rows of the sequential file like:
Stage_Var=Stage_Var : Seq_File.Col01
Write the contents of the stage variable to a Hashed file having one column as key (put hardcoded value in the derivation for this column) and other non key column will have the stage variable in its derivation. (you could also use the aggregator stage with Last derivation option instead of the Hashed File).
After every write the previous row would get over written since its of the same key.
The last row is your entire file's contents, write the content's of the Hashed File to the target table.
Hope this is what you are looking for.
Success consists of getting up just one more time than you fall.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: