I have an Execute SQL task (SQL 2008) where I'm using two SSIS variables to interact with an Oracle database:
DECLARE ParamTest number; TempOutputRun varchar(255);
ParamTest := ?;
TempOutputRun := ?;
BEGIN
IF ParamTest = 0 THEN
SELECT CAST(OUTPUT_RUN_ID AS VARCHAR(15)) AS OUTPUT_RUN_ID FROM GL_EXTRACT_STATUS WHERE STATUS='NEW' ORDER BY OUTPUT_RUN_ID ASC;
ELSE
SELECT TempOutputRun AS OUTPUT_RUN_ID FROM DUAL;
END IF
;
END;
I'm getting the error ORA-01008 on execution and I'm not sure why. Both variables have values, and are set to the correct datatypes with Parameter Names in mapping of 0 and 1 respectively. The ELSE part of this statement should be the one tripped by the current conditions I'm testing under.
Anyone have any ideas? I'm stumped (and quite frustrated, to be perfectly honest).
Thanks!
Valkyrie