Long DataType - Oracle datatype not presently supported

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
chinek
Participant
Posts: 75
Joined: Mon Apr 15, 2002 10:09 pm
Location: Australia

Long DataType - Oracle datatype not presently supported

Post by chinek »

Hi,

We built a new job to access an Oracle 7 database table that has a column with the LONG datatype. From DS Manager I used the Plugin to Import the metadata and the metadata suggest a LONGVARCHAR.
So I used this in the job. The metadata for that column does not provide a Length. So I gave it a value of 4200.
When I ran the job , it aborted with an Oracle error "Oracle datatype not presently supported" ?

What should I used for a LONG datatype in a DS Job ? Please advise.

Thanks.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You have to retrieve it using a VARCHAR data type. A big VARCHAR. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
chinek
Participant
Posts: 75
Joined: Mon Apr 15, 2002 10:09 pm
Location: Australia

Post by chinek »

Thanks for your quick reply and help!!

If that is the case then DS Manager is "wrong" in picking LongVarChar
as the datatype when one imports the metadata.
Is this fixed in v7 ?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Nope. I'm running 7.0.1 and it still works like that.
-craig

"You can never have too many knives" -- Logan Nine Fingers
1stpoint
Participant
Posts: 165
Joined: Thu Nov 13, 2003 2:10 pm
Contact:

Clob

Post by 1stpoint »

I recently had issues with the Long datatype as well. We ended up using CLOB instead because there are alot of restrictions with Long in oracle.
1stpoint
Participant
Posts: 165
Joined: Thu Nov 13, 2003 2:10 pm
Contact:

a big VARCHAR

Post by 1stpoint »

Since DS/OCI Stage does not support LongVarChar, I specified a Varchar with a length of 9,999,999. Will the CLOB be truncated if the length is longer? Is it possible to specify an <unlimited> size?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: a big VARCHAR

Post by chulett »

1stpoint wrote:Since DS/OCI Stage does not support LongVarChar, I specified a Varchar with a length of 9,999,999.
Have you tried running a job with these settings and does Oracle mind? For 9i, max varchar2 length is 4K from what I recall and there isn't any way to declare it as unlimited in size in DataStage.

And yes, if the actual size exceeds what you have configured it to be it will be truncated - and you'll get a lovely little message to that effect: "OCI has fetched truncated data".
-craig

"You can never have too many knives" -- Logan Nine Fingers
1stpoint
Participant
Posts: 165
Joined: Thu Nov 13, 2003 2:10 pm
Contact:

interesting

Post by 1stpoint »

has anyone reported this as a bug?
It's a problem with both ORAOCI8 and ORAOCI9I plugins.
1stpoint
Participant
Posts: 165
Joined: Thu Nov 13, 2003 2:10 pm
Contact:

Found this in Knowledge base

Post by 1stpoint »

Topic:
Oracle LONG DataTypes not supported in DataStage OCI plug-in.

Product: DataStage
Release: 2.2
Date Entered: 10/31/1997 Fixed in Release:
Date Closed:

Full Description:
Oracle LONG DataTypes not supported in DataStage
OCI plug-in stage.

Resolution:
None given.

Workaound Provided:
None given.
Apparently this was reported back in 1997. Why hasn't this been fixed on ORAOCI?
anyone?
1stpoint
Participant
Posts: 165
Joined: Thu Nov 13, 2003 2:10 pm
Contact:

Update

Post by 1stpoint »

Ascential support has entered an enhancement request for the ORAOCI9 plugin to support long datatypes.
raviyn
Participant
Posts: 57
Joined: Mon Dec 16, 2002 6:03 am

Re: Update

Post by raviyn »

Does Ascential now support the LONG,CLOB,BLOB Character fields ??

If no then is there any work around available for this ...

Thanks
Ravi

1stpoint wrote:Ascential support has entered an enhancement request for the ORAOCI9 plugin to support long datatypes.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Example:

Code: Select all

SELECT CAST(CLOB_column AS VARCHAR2(4000)) FROM Table;
Declare the data type in DataStage as VarChar with precision 4000.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
raviyn
Participant
Posts: 57
Joined: Mon Dec 16, 2002 6:03 am

Post by raviyn »

I tried using the CAST operator on the Long Data Type but it is giving inconsistent data type error . So should I be first converting the LONG to a CLOB object and then use the CAST command in Oracle to acheive the results ?
ray.wurlod wrote:Example:

Code: Select all

SELECT CAST(CLOB_column AS VARCHAR2(4000)) FROM Table;
Declare the data type in DataStage as VarChar with precision 4000.
raviyn
Participant
Posts: 57
Joined: Mon Dec 16, 2002 6:03 am

Post by raviyn »

I found a way out while pulling this data from the source i have given the datatype at the source as VarBinary 100000 and extracting the data and Loading the data as Longvarchar Field . The job ran without any warnings and the data looks good.
raviyn wrote:I tried using the CAST operator on the Long Data Type but it is giving inconsistent data type error . So should I be first converting the LONG to a CLOB object and then use the CAST command in Oracle to acheive the results ?
ray.wurlod wrote:Example:

Code: Select all

SELECT CAST(CLOB_column AS VARCHAR2(4000)) FROM Table;
Declare the data type in DataStage as VarChar with precision 4000.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes, mine was only an example, showing how you would do it with a CLOB. Trying to CAST a LONG as VARCHAR is not appropriate, so it's good to see that you worked out that a large enough VARBINARY was an appropriate cast.
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