user-defined sql queries-teradata stage is destination

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
ssunda6
Participant
Posts: 91
Joined: Tue Sep 19, 2006 9:32 pm

user-defined sql queries-teradata stage is destination

Post by ssunda6 »

Hi All,

Can we write user-defined queries in a teradata stage when teradata stage is acting as destination.

I dint find any option as such, but will it be possible if we install any plug-ins?

Thanks and regards,
ssunda
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

what kind of queries you talking about? All types of actions that can be possible to a destination is available in the stage. Insert, delete, upsert.

what exactly you want to do?
ssunda6
Participant
Posts: 91
Joined: Tue Sep 19, 2006 9:32 pm

by default-it is auto-generated query

Post by ssunda6 »

Hi KrazyKoolRohit,

In the teradata stage, we have options insert,append etc.

But by default, the query is auto-generated.

If I want the following operation to be done,

insert into emp_table(empno_dim,empname,email) values (empnoseq.nextval,empname,email).

empnoseq is a sequencer, how can we mention that sql query in teradata stage. Thats what I meant , when I said user-defined sql query.
Any info regarding this would be helpful

regards,
ssunda
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

Where are you trying to generate empnoseq? in teradata? This will be like running a stored proc which cannot be done through this stage. you can use a general ODBC connection to run this wuery on teradata.

I dont have the access to parallel installation right now. so dont take my word for granted.
rwierdsm
Premium Member
Premium Member
Posts: 209
Joined: Fri Jan 09, 2004 1:14 pm
Location: Toronto, Canada
Contact:

Re: user-defined sql queries-teradata stage is destination

Post by rwierdsm »

ssunda6 wrote:Can we write user-defined queries in a teradata stage when teradata stage is acting as destination.
Hi ssunda,

What type of TD stage are you using?

If it's the enterprise stage, you can specify on your 'Properties' tab, in the 'Connection' branch a 'DB Options Mode' property. Set this to 'User-defined' and you can enter a user defined SQL.

If it's the MultiLoad stage, on the 'MultiLoad' tab change 'Load Type' to 'Custom'. This will enable the 'Custom' tab on the 'Script' tab. You can put custom SQL in the 'Custom Script', press the 'Generate Sample' button to get a sample. View the help for this screen for more info.

All of this assumes, of course, that you are using the Parallel edition as your profile suggests.

Rob W
Rob Wierdsma
Toronto, Canada
bartonbishop.com
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

Yes, you can use Teradata API stage plugin.... if you don't have it get it from ascential and register the plugin..
ssunda6
Participant
Posts: 91
Joined: Tue Sep 19, 2006 9:32 pm

Post by ssunda6 »

Thanks for the replies. I will check with the options and update you again.

regards,
ssunda.
Post Reply