Cognos 8 set query band

General

Cognos 8 set query band

Hi everyone,

I normally dont have to post on here as this forum is a wealth of information. I just havent managed to find a solution for one specific toothache that seems to require surgery...

Has anyone managed to set query banding within Cognos 8? There is a requirement to be able to track a Cognos user via query bands within DBQL and without getting a masters degree in Cognos, I havent spotted the exact place where this can be achieved (I suspect it is a simple case of parameterizing session level info in framework manager but my knowledge of Cognos is so limited that I dont even know where you set framework manager parameters).

It doesnt specifically need to have the ability to execute multi-statement requests (although this is second prize - nobody wants to rewrite thousands of SQL statements to include setting query bands but if this is the only way then so be it...), a more elegant solution would be to have this implemented somewhere at a more central level which would have the effect of automatically populating any statements already done.

Any ideas?

2 REPLIES

Re: Cognos 8 set query band

We are doing this through the session commands in the Cognos data source connection.  The open session command should look something like this.

<commandBlock>                                                       

     <commands>

          <sqlCommand>

               <sql>

                    set role {Desired Role};

               </sql>

          </sqlCommand>

     </commands>

        <commands>                                               

          <sqlCommand>                         

               <sql>

                    SET QUERY_BAND=#sq('{UserID Argument}')# FOR SESSION;

               </sql>

          </sqlCommand>

     </commands>

</commandBlock>

Each SQL command needs to be in it's own Command block.  Hope this helps.

Re: Cognos 8 set query band

Refer to the 8.4/10.x manuals on connnection command blocks. Similar examples shown in the Teradata Orange book on query banding.

http://publib.boulder.ibm.com/infocenter/c8bi/v8r4m0/index.jsp?topic=/com.ibm.swg.im.cognos.rdm_cr.8...