Hi guys, looking for suggestions

  • I have asked this question in one of the other forums and one of users pointed this one out. He had a suggestion but wanted to see if someone else has something different to solve this problem.

    Our DW runs on Netezza, connections have been established.

    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 exist it gets the Max transaction ID

    If it does not exist assigns the maxtrans(transID)

    Later down the execution of the package we will use the two variables set at the beginning of the stored procedure

    select

    column,

    max(column) column,

    max(column) column,

    transactionid

    from MYTABLE

    where transactionid > 1234567

    group by transactionid

    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

  • What's your specific question please?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Appears to be "how do i convert this sproc to an SSIS package"?

    Steve.

  • How to change the SP to a SSIS package.

    Establish 2 variables that the SP currently uses in IF statements

    DECLARE

    maxtrans integer ;

    newtrans integer ;

    IF SP_CHK_IF_TABLE_EXISTS('MYTABLE')

    THEN

    maxtrans := NVL(MAX(transactionid),0) FROM MYTABLE;

    ELSE

    maxtrans = 12345678;

    END IF;

    ***builds a bunch of temp tables used to re-create the MYTABLE***

    newtrans := MAX(transactionid) FROM MYTABLE;

    IF newtrans > maxtrans

    THEN

    ELSE

    delete from MYTABLE;

    insert into MYTABLE values ('','','','','','','','','',now(),maxtrans,0,'');

    END IF;

  • How much do you know about SSIS?



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • I am not an expert but can get around just fine.

    I guess I am having a little trouble getting around the concept of variables in this case. I have set other simpler variables for the same package so far that go like this

    If table "x" exist do this

    If table "x" does not exist create temp tables as select "fields" from "tables" ...

    Connections are not a problem.

  • Why not simply query the Netezza system tables for the existence of said table? Set the integer to 1 if it is there and 0 if not.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply