Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Can cursors be cached in Pro*C dynamic sql?
We are trying to reduce soft parses in our app.
So far we've been able to cache cursors in embedded SQL in Pro*C, but
had no success in caching cursors for dynamic sql. Since, in PL/SQL
it's not possible to cache cursors for dynamic sql, I was wondering if
it's possible at all to do in Pro*C, or if there are any workarounds
(session_cached_cursors parameter doesn't help)
Here's a bit of Pro*C code
int Process_data_open_more_options
EXEC ORACLE OPTION (HOLD_CURSOR=YES); EXEC ORACLE OPTION (RELEASE_CURSOR=NO); EXEC ORACLE OPTION (MAXOPENCURSORS=200);
switch (depth) {
case 0:
EXEC SQL PREPARE sql_stmt FROM :select_stmt; EXEC SQL DECLARE my_cursor CURSOR for sql_stmt; EXEC SQL DESCRIBE BIND VARIABLES FOR sql_stmt INTO bind_des; break; case 1: EXEC SQL PREPARE sql_stmt2 FROM :select_stmt; EXEC SQL DECLARE my_cursor2 CURSOR for sql_stmt2; EXEC SQL DESCRIBE BIND VARIABLES FOR sql_stmt2 INTO bind_des; break; case 2: EXEC SQL PREPARE sql_stmt3 FROM :select_stmt; EXEC SQL DECLARE my_cursor3 CURSOR for sql_stmt3; EXEC SQL DESCRIBE BIND VARIABLES FOR sql_stmt3 INTO bind_des; break;
.......
We use Oracle 8.1.7.4 on Solaris 2.7 boxes
remove NSPAM to email
Received on Fri Sep 05 2003 - 10:57:19 CDT