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
Related
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
Two questions
How to check file exists or not before EXTRACT?
we have scenario where new inputs file is generated every day for catalog data. we need to merge new input with d-1 file. before merge we what to make sure that new input file exists at source location
does u-sql supports try...catch block?
Regarding checking if a file exists. We recently released a compile-time IF statement that indeed can check for partition existence (and other objects such as files and tables are on the roadmap).
Once that feature is released (still one or two refreshs out at the time of this answer) it may look something like (syntax subject to change):
IF FILE.EXISTS("/mydir/myfile.csv") THEN
#data = EXTRACT ... FROM "/mydir/myfile.csv" USING ...;
...
#jobstate = SELECT * FROM (VALUES("job completed")) AS T(status);
ELSE
#jobstate = SELECT * FROM (VALUES("file not ready. Job not executed.")) AS T(status);
END;
OUTPUT #jobstate TO "/jobs/myjobstate.csv" USING Outputters.Csv();
You will be able to provide the name as a parameter as well. Please let me know if that will work for your scenario.
An other alternative is to use the file set syntax, especially if you want to use a dynamic value to determine the process. That would simply create an empty rowset:
#data = EXTRACT ..., date DateTime
FROM "/mydir/{date:yyyy}/{date:MM}/{date:dd}/data.csv"
USING ...;
#data = SELECT * FROM #data WHERE date == DateTime.Now.AddDays(-1);
... // continue processing #data that is empty if yesterday's file is not yet there
Having said that, you may want to check of your job orchestration framework (such as ADF) may be a better place to check for existence before submitting the job in the first place.
As to the try catch block: U-SQL itself is a script-level optimizable, declarative language where the plan gets generated and optimized at runtime over the whole script. Thus providing a dynamic TRY-CATCH is currently not available, since it would severely impact the ability to optimize the script (e.g., you cannot move predicates or column pruning outside of a try-catch block). Also TRY/CATCH can lead to some very hard to understand and debug code, especially if it is used to mimic procedural workflows in an otherwise declarative environment.
However, you can use try/catch inside your C# functions without problems if you need to catch C# runtime errors.
FILE.EXISTS() always returns True when executed locally. However, it works when executing against Azure Data Lake.
Tried MSDN example and the following returns True, True
DECLARE #filepath_good = "/Samples/Data/SearchLog.tsv";
DECLARE #filepath_bad = "/Samples/Data/zzz.tsv";
#result =
SELECT FILE.EXISTS(#filepath_good) AS exists_good,
FILE.EXISTS(#filepath_bad) AS exists_bad
FROM (VALUES (1)) AS T(dummy);
OUTPUT #result
TO "/Output/FileExists.txt"
USING Outputters.Csv();
I have Microsoft Azure Data Lake Tools for Visual Studio version 2.2.5000.0
I am having a hard time with this one and I assume it is something I am missing as always.
I am using Visual Studio Web Express 2012. I have installed Report Builder and Report Viewer 11. I have created a generic report file in the report builder as I can not seem to view any designer view in Visual Studio. Not the issue. I am pulling data from my SQL database as usual and populate a dataset. All is fine from here. I can not seem to get the data to show in the report view but can not figure out what I am missing. I have looked everywhere on the web as well as Stack specifically. I have used some of the sample codes and have gotten the report to now show up but still no data. Any help would be great.
I create a generic report file in report builder. No fields, no title etc., just the generic report. This may be my issue but I can not seem to figure out what I am missing.
On my page load I populate the dataset as always with no problem as I can display the data in a label etc.
I add the report viewer to my page and add the following code to the page load after the dataset fill. I also noted that you must use if page.postback = false as Ajax seems to not like it otherwise and just seems to loop and continue loading forever.
I have tried many different code ideas but found I finally got the report to load (again no data) with the following.
rv1.Reset()
rv1.LocalReport.DataSources.Clear()
Dim rds As New ReportDataSource("DataSet1", tempDS.Tables(0))
rv1.LocalReport.ReportPath = Server.MapPath("\tests\test.rdl")
rv1.LocalReport.DataSources.Add(rds)
rv1.LocalReport.Refresh()
Again this is VB.Net webpage. What am I missing? Thanks in advance.
Did you bind the datasource? Sorry if i'm wrong, but in C# asp.net you need to bind the datasource after using an atribution.
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!
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.