Reading date data from Oracle

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
bala_135
Premium Member
Premium Member
Posts: 156
Joined: Fri Oct 28, 2005 1:00 am
Location: Melbourne,Australia

Reading date data from Oracle

Post by bala_135 »

Hi,

I have loaded a field(Eg:-2006-07-21) into the Oracle(10g) table as

To_date(Field)(I have inserted using an user defined query).

In another job when i try reading it from the loaded table,I am having a problem if i specify that field as date and read it.If i use a timestamp datatype to that field i am able to read it.

I could not even read the field as a string.
I have tried using a To_Char function to the query and read it but its not reading.

The same i have tested using a dynamic RDBMS it data is read if i use a to_char(field) in my query.

Any inputs most appreciated.
Regards,
Bala.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Reading date data from Oracle

Post by chulett »

bala_135 wrote:The same i have tested using a dynamic RDBMS it data is read if i use a to_char(field) in my query.
You're saying that it works using an RDBMS stage but doesn't using some other unnamed stage. To be complete, rather than have people assume they know what the other stage is, how about you give some specifics? Name that stage!

Specific examples of your issue would help too. For example, any Oracle field can be 'read as a string', including date fields. That just gets it for you in the NLS format of the particular instance, so not sure why that would be a problem.

ps. In case you're not aware, the date is not stored as '2006-07-21' in the Oracle DATE field, it is internalized. That's just the format you used to load the data and has no bearing on how you get it back out again. FYI.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply