6 Replies Latest reply on Jun 16, 2017 4:43 AM by Egor Larin

    Set the order for Initial SQL commands for IBM DB2

    Egor Larin

      Hello folks!


      We have couple of issues while running Initial SQL from TD to IBM DB2.

      We have DB level security on DB2 db.


      How to run one initial command before other?



      set session authorization [TableauServerUser];

      set current schema [TableauServerUser];


      For Business Objects "we" implemented as follow order:

      call procbobj.set_acctstr('@Variable('UNVNAME')', '@Variable('DOCNAME')');  ->  (UNVNAME / DOCNAME is to used for Workload Manager)

      call procbobj.set_location ('@Variable('LAAC')';  ->  Need to be commit statement   (LAAC -> Local access Awarness Control means for example if you are in Germany only German Data is visible, If you are in CH only CH Data is visible)

      set session authorization @variable('BOUSER');  ->  Like we integrated in Tableau

      set current schema @variable('BOUSER');  ->  Will be used if we get Security views for the Objects.


      And we tried that in TD:


      set session authorization [TableauServerUser];

      set current schema [TableauServerUser];



      So TD shows up that:


      So here we are not sure why this happen. So the statement in the customized SQL is the select on connect_uplex.

      Why the select comes now on the Top instead below?


      For DB2 you need in the "Unit of Work" FIRST set session before any other statement should run.

      https://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.db2.luw.sql.ref.doc/doc/r0011139.html (IBM Info)

      How to run Initial SQL queries one after another?


      Looking forward for any advise.