[轉]Updating Session Variables through GO URL

newknight發表於2014-01-13

Oracle BI EE 10.1.3.3.2 – Updating Session Variables through GO URL

Posted by Venkatakrishnan J on February 28, 2008

Another excellent feature that i had wanted to blog about for sometime was pointed out by Swapan of the BI EE forums today here. If you had gone through my previous blog entry here, i would have shown you how to go about updating the session variables from within Answers. Also, i had blogged about one of the usage of updating session variables yesterday here. Now, if you notice the actual update happens through the SET VARIABLE clause in the prefix of the Answers SQL. But say when you want to integrate BI Answers to an external application using GO URL, you would not be able to use presentation variables. So, we would be needing a capability to update the session variable via some URL parameters. If you are not sure what i mean, lets start with creating a simple session variable called DSN which would be set by an initblock via row-wise initialization.

      

Now, lets go to answers and create a simple report which would just display the session variable using the below formula

CASE WHEN 1=0 THEN “Dimension – Flag”.IGNORE_RATE_FLAG ELSE VALUEOF(NQ_SESSION.DSN) END

      

Now, open another browser and use the below GO URL to see the above report.

http://localhost:9704/analytics/saw.dll?Go&nquser=Administrator&nqpassword=Administrator&Path=/shared/Paint%20Demo/GO%20URL%20-%20Vary%20Session%20Variable/Report&Options=rmf

      

Now, if you notice, the value of the session variable remains constant (ORCL in my case). Now, the question is how do we make this value change by passing values through the GO URL. In order to do that, go to {OracleBIData}web and open the instanceconfig.xml using a text editor. Between the ServerInstance tags enter the below set of tags

 





Generally the Auth tag is used for SSO impersonation. But in this case, we are adding one more set of tags UserIdPassword which tell the BI Server that one is using normal authentication. Also, the Param name tag accepts the name of the actual Session variable (NQ_SESSION.DSN in our case). Source=”url” tells the BI Server that we are passing the value to this variable via URL and the name of the parameter would be DSN.

Save the file after entering the above. Restart presentation services. Now, use the below GO URL

http://localhost:9704/analytics/saw.dll?Go&nquser=Administrator&nqpassword=Administrator&Path=/shared/Paint%20Demo/GO%20URL%20-%20Vary%20Session%20Variable/Report&Options=rmf&DSN=Test

Again, what we are doing in the GO URL is we are assigning Test as the value to the DSN variable which in turn assigns it to the DSN session variable. Now, you should see that the report value would have changed.

      

A very important feature and is not documented.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10009036/viewspace-1069866/,如需轉載,請註明出處,否則將追究法律責任。

相關文章