Storing a text file into ORACLE database

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
naren6876
Participant
Posts: 233
Joined: Mon Feb 07, 2005 7:19 pm

Storing a text file into ORACLE database

Post by naren6876 »

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.
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Re: Storing a text file into ORACLE database

Post by loveojha2 »

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.
Success consists of getting up just one more time than you fall.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

How would you do it without DataStage? That method may be easier and faster than using DataStage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply