Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If -Then Statement

Status
Not open for further replies.

edtx

Technical User
Dec 2, 2014
1
US
Hi,

I am pretty new working with SSIS, I was not sure if this is the right place to post a question, If it is not please forgive beforehand.
I have a store procedure that needs to be converted into an ETL package. The snippet of code that I am trying to deal with goes like this

LANGUAGE NZPLSQL AS
BEGIN_PROC
DECLARE
maxtrans integer ;
newtrans integer ;
BEGIN

IF SP_CHK_IF_TABLE_EXISTS('MY_TABLE_NAME')
THEN
maxtrans := NVL(MAX(transactionid),0) FROM 'MY_TABLE_NAME';
ELSE
maxtrans = 123456789;
END IF;
Basically it calls an existing SP to check if the table exists in the DB.
If it does it gets the Max transaction ID
If it does not assigns the maxtrans(transID)
Due to new management, we are migrating existing ETL that did some the work at a SP level and putting some of the work load into our ETL server.

Any help will be greatly appreciated and again, if I am in the wrong place I’d appreciate if you guys can direct me to the right forum

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top