Unrecognised SQL Stament Error in Teradata API Stage

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
kpavan2004
Participant
Posts: 9
Joined: Sun Oct 19, 2008 7:09 am

Unrecognised SQL Stament Error in Teradata API Stage

Post by kpavan2004 »

Hi ,

I am using User Defined SQL while extracting data from Teradata Table . In the sql i am using aggregate funtion max(). When i run the job i am getting the error message "Unrecognised SQL statement" . Can't we use aggregate funtions in Teradata API Stage?. Or Else do we need to use aggregate stage to calculate Max()? The same query is working fine in Teradata SQL Assistant. Could anyone please help on this?

Query:
SELECT MAX(COL1) FROM TABLE
Pavan
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Try:

SELECT MAX(COL1) as COL1 FROM TABLE

And see if that helps. Make sure the "as" column alias matches the name you've given the column in the stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kpavan2004
Participant
Posts: 9
Joined: Sun Oct 19, 2008 7:09 am

Post by kpavan2004 »

chulett wrote:Try:

SELECT MAX(COL1) as COL1 FROM TABLE

And see if that helps. Make sure the "as" column alias matches the name you've given the column in the stage.
Thanks very much Chulett. It solved my problem. :D
Pavan
Post Reply