IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
Expand all | Collapse all

DBQuery using multiple SQL statements

  • 1.  DBQuery using multiple SQL statements

    Posted 07/10/14 01:01 AM

    Originally posted by: TarakN


    Hello All,

    My requirement is i need to execute multiple SQL staements in one DBQuery function. Can I do that.

    I am having some 20 SQL statements which i need to execute in one DB query when i wrote the function it is not giving expected results. I tried another way also by writing 20 SQL statements and working fine but my worry is map is executing 20 times and connecting DB all the 20 times and their might be a performance issue.

    Could someone throw a light on this.

     

    Regards,

    Tarak.

     

     

     


    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 2.  Re: DBQuery using multiple SQL statements

    Posted 07/10/14 05:49 PM

    Originally posted by: Arun Ramamurthy


    You could try something as below:

    Dblookup(
    Begin
    <SQL_stmnt1>;
    <SQL_Stmnt2>;
    End;
    ,
    "-MDQ <MDQ> -DBNAME <dbname> " )

    example:

    VALID(

         DBLOOKUP("Begin insert into <table1> values(a,b);insert into tabl2 values(a,b); end;" ,"-MDQ <mdqname> -DBNAME <dbname> -T")

            ,FAIL("DB failed"))

     

    This may work depending on the driver I guess , not sure. Also I am not sure if this would work for select statements.

    Or you could try putting all the sql statements in a stored procedure and call the stored procedure from the WTX map rule.
     


    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange