Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Re-Using Variables in SQL Server Data Pump ??

arnziearnzie Member Posts: 2
Hi, Im an SQLServer newbie, so please forgive the simplicity of this post. When creating a Transform Data Task Data-Pump, just using an SQL Query and Copy Columns ( not ActiveX, want to keep this as simple as possible ) to source data from Oracle, is it possible to store the variable passed in through InputGlobalVariableNames in a internal variable, so that i can just pass it in once instead of for everytime i use it ?

For example, if i have a query that uses the same data multiple times :

SELECT * from TABLE
WHERE start_date = ?
AND end_date = ?
AND close_date = ?
AND open_date = ?

currently I have to pass in "DATE";"DATE";"DATE";"DATE" to InputGlobalVariableNames....

I want to be able to only pass in this variable once, store it, and then re-use it, just like how you can when using an Execute SQL Task, as below

BEGIN
DECLARE @date VARCHAR(8)
SET @proc_dte = ? --- DATE
SELECT * from TABLE
WHERE start_date = @proc_dte
AND end_date = @proc_dte
AND close_date = @proc_dte
AND open_date = @proc_dte
END

so that I only have to pass in "DATE" once in the InputGlobalVariableNames...obviously it doesnt like using this syntax when in a DataPump SQL Query...

Can anyone please help ?

Thanks,
Adam
Sign In or Register to comment.