Oracle Query error in Datastage

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
just4u_sharath
Premium Member
Premium Member
Posts: 236
Joined: Sun Apr 01, 2007 7:41 am
Location: Michigan

Oracle Query error in Datastage

Post by just4u_sharath »

QUERY
Select col1, col2..col18, Null as col9 from .... where.... in Oracle enterprise stage. and for the attribute 16--sql type is varchar and length is 150. when i run this the error i get is

"main_program: Fatal Error: Caught ORCHESTRATE exception in main program: APT_ParseError: In field "ATTRIBUTE16": Parsing parameters "max=0" for schema type "string": Max length must be positive, got: "0"
Expected ";", got: <eof>, line 20
Expected ";", got: <eof>, line 20
Error parsing schema: Expected ")", got: <eof>, line 20"
the attribute16 is 19th column

Why it is taking length as ZERO eventhough i assigned as 150. Please Explain.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In which column in the Columns grid did you specify the 150? This error usually arises from having a VarChar column with its Precision left empty.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dspxlearn
Premium Member
Premium Member
Posts: 291
Joined: Sat Sep 10, 2005 1:26 am

Post by dspxlearn »

Can you check if it runs in 3rd party querying tools like Toad/sql navigator ?
I guess, it is always better to run your SQL in them before running it in Datastage.

In this way, you can get rid of datastage error atleast.
Thanks and Regards!!
dspxlearn
just4u_sharath
Premium Member
Premium Member
Posts: 236
Joined: Sun Apr 01, 2007 7:41 am
Location: Michigan

Oracle Query error in Datastage

Post by just4u_sharath »

I have tested the code in toad. its fine. But it is not working from datastage.ITs schema is
ATTRIBUTE16, VARCHAR, LENGTH=150, NUllABLE
its not a key column and there is nothing under scale
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Post by vinothkumar »

Use CAST function in your SELECT statement.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Oracle Query error in Datastage

Post by chulett »

just4u_sharath wrote:I have tested the code in toad. its fine. But it is not working from datastage.
This "test" bothers me as it doesn't really mean anything other than to show that your SQL - whether it be select or update or whatever - is syntactically correct. Toad doesn't care what kind of fields you are returning the values into while DataStage does. Quite a bit.

If this is coming from a schema file, post it. Sounds like it is not quite kosher.
-craig

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