Delete the data

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
jpraveen
Participant
Posts: 71
Joined: Sat Jun 06, 2009 7:10 am
Location: HYD

Delete the data

Post by jpraveen »

Hi
can i write the Delete SQL directly in ODBC stage
my query is

DELETE FROM imp_ProviderFacility FROM imp_ProviderFacility
inner join
( SELECT DISTINCT mosg.StateCode, mosg.PCPGroup, pf.PRVDR_FAC, rtrim(pf.PRVDR_FAC_LONG_NAME) 'PRVDR_FAC_LONG_NAME'

FROM
mo_SpecialistGroups AS mosg
INNER JOIN HCP.dbo.PROVIDER_FACILITY AS pf ON mosg.PCPGroup = pf.PRVDR_GRP

WHERE
pf.END_EFF_DATE Is Null) A
On A.StateCode=imp_ProviderFacility.StateCode
and A.PRVDR_FAC_LONG_NAME=imp_ProviderFacility.PRVDR_FAC_LONG_NAME
and A.PCPGroup =imp_ProviderFacility.PRVDR_GRP
and A.PRVDR_FAC=imp_ProviderFacility.PRVDR_FAC.

thers is INNER JOIN in it.

i am taking the Source and Target Same Table(imp_ProviderFacility)
and i had written this SQL in Upsert mode DELETE ONLY.
am i doing right ot not?

Thanks,
Praveen
Last edited by jpraveen on Thu Sep 09, 2010 6:15 am, edited 1 time in total.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

INNER JOIN is perfectly OK, but you need at least one parameter marker so that a value can be passed from DataStage to trigger the SQL.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jpraveen
Participant
Posts: 71
Joined: Sat Jun 06, 2009 7:10 am
Location: HYD

Post by jpraveen »

Hi
can you tell me briefly what is menat by parameter marker,for the below query what are the changes i should made?
i am taking all the columns from source table and just i am writing the Delete statement,i had no idea on parameter marker.can anyone expalain on this.

Thanks
Praveen
Post Reply