Page 1 of 1

Oracle Query error in Datastage

Posted: Thu Dec 27, 2007 2:24 pm
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.

Posted: Thu Dec 27, 2007 2:46 pm
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.

Posted: Thu Dec 27, 2007 2:56 pm
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.

Oracle Query error in Datastage

Posted: Thu Dec 27, 2007 8:18 pm
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

Posted: Wed Oct 12, 2016 4:53 am
by vinothkumar
Use CAST function in your SELECT statement.

Re: Oracle Query error in Datastage

Posted: Wed Oct 12, 2016 6:11 am
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.