Can't get data from Essbase - olap

I'm new at OLAP services.
I want to get data from Essbase using olap4j.
I'm sending this request:
SELECT {[Year].[Jan]} on COLUMNS from [Demo.Basic]
and get an error that database Basic does not exist:
XMLA provider gave exception:
<SOAP-ENV:Fault>
<faultcode>
XMLAnalysisError.1051032
</faultcode>
<faultstring>
<![CDATA[Cannot open cube view. Essbase Error(1051032): Database Basic does not exist]]>
</faultstring>
<faultactor>
XML for Analysis Provider for Essbase
</faultactor>
<detail>
<Error Description="Cannot open cube view. Essbase Error(1051032): Database Basic does not exist" ErrorCode="1051032" HelpFile="" Source="XML for Analysis Provider for Essbase ">
</Error>
</detail>
</SOAP-ENV:Fault>
Actually this database exists and works (http://grab.by/AqKU).
Also my code works fine with other OLAP services (e.g. Mondrian).
Can you please help me with this issue? Thanks!

Are you writing the MDX code yourself? You might try a couple of variants on the syntax:
SELECT ({[Measure]}) ON COLUMNS FROM Demo.Basic
WHERE ([Year].[Jan], [Location].[Seattle], [Scenario].[Actual])
Don't worry about the specific members I used here, but in particular you might try moving the FROM clause to after ON COLUMNS and try not using the brackets.

Related

Formula field in Databand of Fast-report

I'm Using Fast-report as the reporting tool in my latest project, where I'm new to this tool. Now I'm finding an issue while trying to do a multiplication in the data-band of fast-report like [SampleData1.Qty]*[SampleData1.Unit_Price].
My data source is SQL Server and passing the data to the On the render the Report throws an exception,
Can I know how to do operations on the Text?
Regards
Raghu

OpenJpa2.0 How to map Oracle sys.XMLTYPE column to String

I changed Change in persistence.xml
I also changed column definition (columnDefinition="XDB.XMLType") for xml fields
I checked OpenJpa(http://openjpa.208410.n2.nabble.com/Oracle-XMLType-fetch-problems-td6208344.html) site and IBM (http://www.ibm.com/support/knowledgecenter/SS7J6S_7.5.0/com.ibm.wsadapters.jca.jdbc.doc/env/doc/rjdb_problemsolutions.html)
My env is OpenJpa 2.0 and WAS 7
its throwing exception
org.apache.openjpa.persistence.PersistenceException: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "SYS.XMLTYPE", line 169
Please suggest without changing OpenJpa2.0 as its part of IBM WebSphere Application Server V7.0 how can i handle sys.XMLTYPE data, i am migrating my application from db2 to Oracle in same environment.
Writing XML data can be tricky some times! Getting the correct drivers and things defined properly can have its challenges. I can not say exactly what you need to do given the lack of info on your domain model and such, but let me give some general things to look for. First, there is an XML test in the OpenJPA test framework if you want to make reference to it. It can be seen publicly here:
https://apache.googlesource.com/openjpa/+/refs/heads/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/oracle/
Or, another test using an "XMLValueHandler" (likely this is beyond the scope of what you are looking for):
https://apache.googlesource.com/openjpa/+/refs/heads/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/query/
Second, (stating the obvious) I assume you have a column in Oracle defined as "XMLTYPE". Also, I see you are using schema SYS. I'm sure you are aware but this is a system/admin schema......just for sanity sake you might want to first get things running using a non-system/admin schema just so we don't get hung up with any issues with your OpenJPA client not having the correct permissions.
Next, you need the following definition:
#Lob #Basic
#Column(name = "ANXMLCOLUMN", columnDefinition="XMLCOLUMN XMLType")
private String anXMLString;
The #Lob I think will be necessary if you are using data greater than 4000 chars (this was mentioned in one of the comments). To start I'd use a very small set of data (a couple characters), once that works, then experiment with > 4k.
Next, make sure to use the correct JDBC driver. The last time I experimented with an XMLType I used the Oracle JDBC 11.2.0.2 driver.
Finally, you might need to use the property "openjpa.jdbc.DBDictionary" with value "oracle(supportsSetClob=true,maxEmbeddedClobSize=-1)". Again, experiment with this AND look at the OpenJPA documentation on these properties to determine if they are necessary in your scenario. I think the supportsSetClob=true will only be necessary for older version (pre-2.2.x) of OpenJPA. You might also need to use property "openjpa.jdbc.SchemaFactory" with value "native". I would suggest you first try without either or these two properties. If that doesn't help, then experiment with these two properties. I know this is vague, but I don't know what your DDL or domain model looks like so I have to keep in vague.
Thanks,
Heath Thomann

Using SQL Server 2012 Geography Data Type with ASP.Net - DataReader.GetFieldType(x) returned null

I've written an ASP.Net 4 Application which has been working perfectly. However, I decided to make use of the new Geography Data Type in Sql Sever 2012. This worked perfectly on my local machine but fails when I upload.
I get there error "DataReader.GetFieldType(9) returned null." when doing a usual "select * FROM Table" query on a table that contains one of these datatypes.
I have searched the various threads regarding adding a reference to the Microsoft.SqlServer.Types.dll into my project and changing Copy Local to true. However I am getting the same error.
I run the database and the web server on two separate servers so I don't think there are any assemblies on the web server unless I upload them with my project.
Am I missing any other assemblies that are needed? or any other settings?
I've taken days trying to solve this and uploading variouse libraries. Any help would be appreciated.
msdn
When the compatibility level is 100 or below in SQL Server 2012 then the geography data type has the following restrictions:
•Each geography instance must fit inside a single hemisphere. No spatial objects larger than a hemisphere can be stored.
•Any geography instance from an Open Geospatial Consortium (OGC) Well-Known Text (WKT) or Well-Known Binary (WKB) representation that produces an object larger than a hemisphere throws an ArgumentException.
•The geography data type methods that require the input of two geography instances, such as STIntersection(), STUnion(), STDifference(), and STSymDifference(), will return null if the results from the methods do not fit inside a single hemisphere. STBuffer() will also return null if the output exceeds a single hemisphere.
From what I can tell you will at least need SQL Server installed locally when you initially add the reference. If you can I would try and install SQL Express locally first (you do not need to use it just install it) and then try your code again to see if that is the problem.
References:
DataReader.GetFieldType returned null
http://blogs.bing.com/maps/2013/08/05/advance-spatial-queries-using-entity-framework-5/
Edit:
I am more familiar with using spatial types via the entity framework. It seems if you want to use them directly you need to use a nuget package in order to get the required DLLs into the project. From the Microsoft ADO.NET blog page
SqlServerSpatial110.dll – This is a native assembly so it cannot be added as a project reference.
References:
Microsoft ADO.NET Blog
http://blogs.msdn.com/b/adonet/archive/2013/12/09/microsoft-sqlserver-types-nuget-package-spatial-on-azure.aspx
Relevant SO Questions
'Microsoft.SqlServer.Types' version 10 or higher could not be found on Azure
https://gis.stackexchange.com/questions/382/how-can-i-use-sql-servers-spatial-types-from-a-net-application
Spent heaps of time on this, adding references as well, but I found a workaround i want to share.
Should work fine on asp.net as well.
I use the following query to parse me the string representation of the object:
DECLARE #result geography;
SELECT #result = area FROM news WHERE id LIKE #id ;
SELECT ..., #result.STAsText() as area FROM news WHERE id LIKE #id;
And in the asmx (c#) webservice i retrieved my SQLGeography with a parser method:
row["area"].ToString()
After that you can use a parser method to retrieve the SQLGeography object.
/// <summary>
/// Converts a String into an sql geography object.</summary>
/// <param name="pText">The string representation of the sql geography object. </param>
public static SqlGeography GetGeographyFromText(String pText)
{
SqlString ss = new SqlString(pText);
SqlChars sc = new SqlChars(ss);
try
{
if (pText.Contains("POINT"))
{
return SqlGeography.STPointFromText(sc, 4326);
}
return SqlGeography.STPolyFromText(sc, 4326);
}
catch (Exception ex)
{
return SqlGeography.STMPolyFromText(sc, 4326);
throw ex;
}
}
Hope it helps anyone!
In the end I couldn't get it to work as it does on my development machine and I don't want to install Visual Studio or SQL Server Express on the web server so instead I just removed all the queries where I did "SELECT * FROM Table" and the error went away. It still let me do my calculations using the geography field, but doesn't like you trying to show it on the screen. Thanks for all your help!

Unexpected token Error while creating view that uses pivot

I'm not able to create view in oracle through a select query that uses PIVOT function
It gives the following error.I'm not able to understand what's the problem.Please help
Refer to the image at the following address for error snapshot.The error can be seen at
following address"https://www.dropbox.com/s/sq98mvfourobo7w/Error.PNG"
I can't see your item from work (dropbox is blocked), but I ran across this issue using the create view wizard in sql developer: it would throw out an error for an unexpected token ! PIVOT.
The workaround was to simply use CREATE OR REPLACE FORCE VIEW from the SQL worksheet and avoid the wizard.

How to enable Content Delivery Loggin

How to enable content delivery logging in Tridion 2011 sp1. We have .net version of content delivery. After installation of content delivery we changed logback file present in our application folder (D:\Inetpub\MyPortal\bin\config), below is the setting in logback xml
<property name="log.history" value="7"/>
<property name="log.folder" value="D:\tridion\log"/>
<property name="log.level" value="DEBUG"/>
After doing the change we reset the IIS. But we don't see any log file at above location.
Reason why we want to check log file is.
We have implemented content filter mechanism. In which we are using various Query Criteria like ItemSchemaCriteria, CustomMetaKeyCriteria, KeywordCriteria.
Somehow for some filters results are not displayed, though we have component present in broker database. How to check exactly what query is getting fired when filter mechanism is executed on page.
Note : At location d:\Tridion\log\ We can see files like cd_core.2012-10-25,cd_monitor.2012-10-25, cd_deployer.2012-10-25,cd_transport.2012-10-25 but these files are old we need today's log. (04-11-2012)
More inputs on issue :
We found that when we add cirteria for Category that time results are not coming.
KeywordCriteria FilterCategory5303Criteria0= new KeywordCriteria("FilterCategory","Administrative");
Criteria[] filterCatCriteria5303 = {FilterCategory5303Criteria0};
Criteria filterCatOrCriteria5303 = CriteriaFactory.Or(filterCatCriteria5303);
mainCriteria5303 =CriteriaFactory.And(mainCriteria5303, filterCatOrCriteria5303);
In CUSTOM_META table in broker db we have entry for 2 component.
KEY_NAME = "FilterCategory" and KEY_STRING_VALUE="Administrative"
If you're using:
<property name="log.folder" value="D:\tridion\log"/>
then it's expected that you'll get no logging. Logback expects either double backslashes or simple (fwd)slashes. Example:
<property name="log.folder" value="D:\\tridion\\log"/>
or
<property name="log.folder" value="D:/tridion/log"/>
Further more, if you want to see what (JPQL) query Tridion creates for you from your Broker query then you need to set the logging to TRACE and to search in your logs for the following:
TRACE JPAQueryDAO - Broker Query generated:
This will give you an impression about the final SQL query generated in the end.
My last remark is about the KeywordCriteria and how you're using it. You should know that KeywordCriteria does not relate in any way to the CUSTOM_META table. For queries related to that table you should use the criterias called "CustomMeta***Criteria"
Probably, in your case you need to use:
new CustomMetaValueCriteria(new CustomMetaKeyCriteria("FilterCategory"), "Administrative");
Hope this helps.
Cheers,
Daniel.
Whenever a Broker Query doesn't give me the results I expect, I head towards the MSSQL Query Profiler to see what actually happens on the database level.
I documented this process in an article on the Tridion practice wiki: http://code.google.com/p/tridion-practice/wiki/TroubleshootBrokerQueryGeneration .
A quick summary of the steps:
start the MSSQL Query Profiler
start a new Trace
filter the trace on database name
reload your page, so the query fires
find the query in the Profiler
copy the query into a better tool and reformat it
Once you reach step 6, it is often somewhat clear why there are no results. I often end up then modifying the SQL to give the results that I'm looking for. And from that I modify the Criteria to generate that SQL, which can at times be a challenge.

Resources