Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> RESTRICT_REFERENCES and DBMS_SQL Catch 22?

RESTRICT_REFERENCES and DBMS_SQL Catch 22?

From: <marckell_at_best.com>
Date: Fri, 11 Jun 1999 18:00:19 GMT
Message-ID: <7jrire$mb7$1@nnrp1.deja.com>


Could someone tell me which one I'm mistaken about, or if there is a workaround:

  1. When creating a PLSQL function, you need to add a RESTRICT_REFERENCES pragma to the package to enforce read-only rights to the function. Otherwise the block won't run (error of "No guarantee it won't write" or something along those lines).
  2. When using RESTRICT_REFERENCES, you can't use DBMS_SQL for inserting variables into SQL statements, as this violates the purity of RESTRICT_REFERENCES. The SQL statement is not known at compile-time, so it won't allow the block to be used.
  3. The only way to create a SQL statement dynamically, which is necessary in my case because the table name is unknown until it's run, is to use DBMS_SQL.

Catch 22.

So my initially simplistic function in which I would pass in the name of a table and return a single value from that table is turning into a ridiculously confusing project, unless someone here can tell me where I'm going wrong.

Oracle 7.33/DEC OSF1 V4

mk

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Fri Jun 11 1999 - 13:00:19 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US