Oracle Stage after SQL

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
wjblack74
Participant
Posts: 1
Joined: Fri Oct 05, 2012 6:37 pm

Oracle Stage after SQL

Post by wjblack74 »

I'm using an Oracle connector and am trying to use one of the incoming columns as part of the after SQL statement within the connector.

Oracle Table being written to: TableA
After SQL table being written to:TableB
Incoming column to be written to TableA and also used in the after SQL table TableB:ColumnA

Since it's an incoming column to the connector does it have to include ORCHESTRATE as part of the name? What is the correct syntax?

Example:
UPDATE TableB SET MyField = ORCHESTRATE.ColumnA
W. Black
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Oracle Stage after SQL

Post by chulett »

wjblack74 wrote:I'm using an Oracle connector and am trying to use one of the incoming columns as part of the after SQL statement within the connector.
You can't. The before and after areas are not aware of nor have any access to data on the link.
-craig

"You can never have too many knives" -- Logan Nine Fingers
wblack
Premium Member
Premium Member
Posts: 30
Joined: Thu Sep 23, 2010 7:55 am

Re: Oracle Stage after SQL

Post by wblack »

OK. if you don't have access to the incoming schema and what you need could be pulled from what you just wrote to TableA could you do something like

Example:
UPDATE TableB SET MyField = (select MAX(ORCHESTRATE.ColumnA) from TableA)
William Black
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or split off a link to an aggregator with that value and then to the second target. Your aggregation method can ensure it only gets one row at the end of the job, if that's what you are trying to do.
-craig

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