"Unrecognized SQL statement" - UNION ALL

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
SBSA_DW2
Premium Member
Premium Member
Posts: 37
Joined: Fri Jul 25, 2008 1:24 am

"Unrecognized SQL statement" - UNION ALL

Post by SBSA_DW2 »

Hi there

Is there a known issue when using UNION ALL in the teradata API stage? We have a piece of code:

SELECT BLAH, BLAH2 UNION ALL
SELECT BLAH3, BLAH4 UNION ALL...
(45 UNION ALL statements)

that returns a fatal error "Unrecognized SQL statement". We've removed the UNION ALL statements (leaving us with a bland looking SELECT statement and it works.

Any known issues with the Teradata API (Or any API for that matter), and UNION ALL?

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

Post by chulett »

You'd probably have to contact your official support provider to see if there are any known issues. Could it be something I've seen before in other stages, a 'length' issue where some of the sql is getting truncated thus making it invalid? How long is your combined union?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

What happens if you have only one UNION ALL ? Did you try UNION ?

You can see loads of hits for terdata union all. Google for information.
SBSA_DW2
Premium Member
Premium Member
Posts: 37
Joined: Fri Jul 25, 2008 1:24 am

Post by SBSA_DW2 »

turns out there was a syntax error or something that caused the error to appear! :oops:
Post Reply