My group used a function like this in our error conditions for the ref
cursors that would normally contain real data.  Just assign your ref cursor
to null_recordset in your exception block.

TYPE ref_whatever  IS REF CURSOR;

FUNCTION null_recordset
      RETURN ref_whatever
   IS
      ref_null             ref_whatever;
      c_nullstr   CONSTANT VARCHAR2 (1) := NULL;
   BEGIN
      OPEN ref_null FOR
         SELECT c_nullstr
           FROM DUAL
          WHERE 1 = 2;
      RETURN (ref_null);
   END null_recordset;

-----Original Message-----
From: Steve Ray [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 17, 2005 2:10 PM
To: CF-Talk
Subject: Re: Problem with Oracle stored proc result


> 2) if the user doesn't have the appropriate privs, raise an error in 
> the proc, and catch that with cftry/cfcatch in coldfusion. Since you 
> can assign an error number and message (RAISE_APPLICATION_ERROR in 
> pl/sql) which will then be available to your cf code through cfcatch.
> message, you can distinguish between a security error and an other 
> database error.

Thanks for everyone's ideas. We've gone with raising an error in the stored
proc, and handling it in CFTRY/CFCATCH. That's working well.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:224634
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to