Tuesday, March 22, 2016

[nQSError: 13015] You do not have the permission to set the value of the variable

Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 13015] You do not have the permission to set the value of the variable 'As_Of_Date'.



Solution :
 Go to properties of session variable all check the option "Enable everyone to set value"

Follow the below steps :

1. Open Administration Tool. Go to Manager > Variables.

2. Select System or Non-System variable (depends on type of your variable) under the Session  from left pane. Then the corresponding variables will be listed on right pane.



3. Right click on the variable(for which your getting error in presentation service when you tried to change its value) and select properties.

4. check the option "Enable everyone to set value" (by default this option is unchecked) and click OK.



Now, check the request in presentation service. Log out from that session and again login to presentation services and the same report.

Sunday, March 20, 2016

OBIEE Using a MSSQL stored procedure as datasource with parameters

If our stored procedure uses a variable:
[code]
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:        Kartheek Dachepalli
-- Description:  This procedure returns Account details from Account dimension
-- =============================================
ALTER PROCEDURE sp_dim_Accounts   
@UserName varchar(50) = 'me'
AS
BEGIN
    SET NOCOUNT ON;
    SELECT     dim_Account_ID, Account_Code, Account_Name, @UserName as USERNAME
FROM         dim_Accounts_tab
END
GO
[/code]
You can add the variable by using the VALUEOF() procedure:
 image
@VARIABLENAME = N’VALUEOF(NQ_SESSION.VARIABLE_NAME)’

OBIEE Using a MSSQL stored procedure as datasource

A MSSQL stored procedure can return a table. You can use this table as a normal datasource in your repository.
Let’s  create a basic procedure
[code]
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:        Kartheek Dachepalli
-- Description : This procedure returns Account details from Account dimension
-- =============================================
CREATE PROCEDURE sp_dim_Accounts   
AS
BEGIN
    SET NOCOUNT ON;
    SELECT     dim_Account_ID, Account_Code, Account_Name
FROM         dim_Accounts_tab
END
GO
[/code]
In the repository create a new table:
image
Make the type stored procedure:
image
Add the columns manually: If we select 'Stored Proc' as table type we need to add columns with data types as shown below.
image
Add the execute script:
while adding the execute code please select your technology. Here I selected sql server 2012 as my database version is 2012.
image
EXEC [DATABASE_NAME].[SCHEMA_NAME].[PROCEDURE_NAME]
You will see that the table symbol has changed:
image
You can now join it as a normal table to the rest of your model.