Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
JDBC connection with Oracle Failing
RiF
I have been developing BIRT reports for an MRP system. I am using BIRT designer 4.2.2, and the Oracle 11g JDBC files.<br />
<br />
As a simple test, I am trying to perform a listagg and pivot operation using Oracle, and reporting in BIRT. I cannot use the BIRT pivot tables, as OOTB it does not handle string agregations. My sample data is taken from the HR user/tablespace of Oracle 11g XE.<br />
<br />
The query being used is:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
SELECT *
FROM
(SELECT Departments.Manager_Id,
job_id,
department_name
FROM Employees,
Departments
WHERE Employees.Department_Id = Departments.Department_Id
) pivot(listagg(job_id,', ')
within GROUP (
ORDER BY job_id) FOR department_name IN (
'Administration' AS Admin,
'Marketing' AS marketing,
'Purchasing' AS purchasing,
'Shipping' AS Shipping)
)
</pre>
<br />
Which successfully executes in Oracle SQL Developer.<br />
<br />
But when tested in BIRT, on using Preview Results, I get a 'Java heap Space' error.<br />
<br />
Decreasing the SQL to <br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
SELECT *
FROM
(SELECT Departments.Manager_Id,
job_id,
department_name
FROM Employees,
Departments
WHERE Employees.Department_Id = Departments.Department_Id
) pivot(listagg(job_id,', ') within GROUP (
ORDER BY job_id) FOR department_name IN (
'Marketing' AS marketing,
'Purchasing' AS purchasing,
'Shipping' AS Shipping)
)
</pre>
<br />
Successfully previews. Removing any one of the PIVOT groups successfully executes. But with all four (or more) does not execute.<br />
<br />
The problem seems to be that Oracle is producing very wide fields, which the JDBC connector cannot handle.<br />
<br />
Can you please advise a suitable solution??<br />
<br />
Thanks in advance.
Find more posts tagged with
Comments
kclark
Can you post the full error please?
RiF
I have resolved this issue.<br />
<br />
The cause is definitely the size of the record being returned via JDBC and Oracle.<br />
<br />
The issue was resolved by the judicious use of <br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>cast(field_name to varchar2(128))</pre>
<br />
depending on the anticipated results. The listagg and other string functions always produce a CLOB field of 4001 characters wide. Even if only one string is LISTAGG'ed. <br />
<br />
Using <br />
<pre class='_prettyXprint _lang-auto _linenums:0'>SUBSTR</pre> or <pre class='_prettyXprint _lang-auto _linenums:0'>TRIM</pre> may decrease the length of the SQL result, but the field still remains a CLOB field.<br />
<br />
I have tested various JVM settings within my Tomcat/birt web application, and by using the cast function, I was able to reduce the JVM settings to 128MB, which fits well with the MRP web server's settings.<br />
<br />
Thanks to those who looked at this post.
Deros
<a class='bbc_url' href='
http://www.birt-exchange.org/org/forum/index.php/topic/29168-increase-memory-usage-with-birt-4-2-2/page__fromsearch__1'>seems
familiar to me</a><br />
<br />
so try to set the &RowFetchSize in the ODA Data Set to 10
RiF
Your suggestion works well - I have removed all the varchar2(****) functions, so the SQL is closer to standard.
Thanks again.