Monks, I can't say how frustrated I am. I spent nearly the whole day to get Oracle running, and migrating a table from Access to said database, because I ran into a "cannot open more tables" error in my application that uses the Template-Toolkit and it's DBI plugin.
I have a template that basically looks like
[%
USE oracleDB = DBI
(
"dbi:Oracle:SOMEDB", "someuser", "somepassword"
)
-%]
<vdx_data>
[%- FOREACH kasse = oracleDB.query( 'SELECT DISTINCT foo, bar FROM myt
+able ORDER BY foo, bar' ) %]
<vknr V="[% kasse.FOO %]">
<zp_kv V="[% kasse.BAR %]"/>
</vknr>
<vorgang_liste>
[%- FOREACH vorgang = oracleDB.query( "SELECT * FROM mytable WHERE F
+OO = $kasse.FOO AND BAR = $kasse.BAR" ) %]
<vorgang>
<vdx_abrechnungsbereich V="[% vorgang.ABC %]"/>
<gkv_konto V="[% vorgang.DEF %]"/>
</vorgang>
[%- END %]
</vorgang_liste>
[%- END %]
</vdx_data>
As you can see it first selects and groups some key fields from the table, outputs them and then makes a subquery for those keys and outputs more details for them in a inner loop. This runs smooth and very fast until Oracle reaches some kind of inner limit and chokes with an error:
DBI error - DBI prepare failed: ORA-01000: maximum open cursors exceed
+ed (DBD ERROR: OCIStmtExecute/Describe)
(The actual error message in english may differ. I translated it from german.)
So how can I close/reuse a cursor? Is there another way to achieve this?
P.S.
This example is simplified. In reality there are more than one inner loop and they are nested.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.