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

Home -> Community -> Usenet -> c.d.o.server -> Re: work around?

Re: work around?

From: Chris Forbis <chrisforbis_at_yahoo.com>
Date: 25 Sep 2002 13:49:33 -0700
Message-ID: <f2dc430d.0209251249.91242ff@posting.google.com>


Not that I have tried this but could you not do something like:

(If it is a proc)

Do a try exception block around the query. I could guess if a bind varible is not defined it would fail and do the excpetion (an should have some error code) Then ID that error code in the when clause and do the same query with your default value?

Seems like a mess but not sure why it would not work (but again, I have not tried it yet)

carolek_at_ix.netcom.com (Carole Kaufman) wrote in message news:<72330e0d.0209241244.46cd728c_at_posting.google.com>...
> We have a 3rd Party application, where 1/2 of it allows on-line
> querying and the other half handles scheduled queries and distributes
> the results.
>
> The application has a key word, :APPUSER, which defines who the user
> is who is doing the on-line queries and is decoded by the application
> and written out to an auditing table. However, the scheduled query
> program does not recognize this key word, so it gets passed directly
> to Oracle without decoding, resulting in 'not bound' error messages.
> We don't necessarily want scheduled queries to be audited, but we
> definitely don't want the error messages.
>
> Can anyone recommend a way to write 1 script n PL/SQL that will work
> in both environments?
>
> ie,
>
> INSERT into Query.Query_Audit (User_Cd, User_Database_Id_Cd,
> Database_Name, Query_Name, Query_Start_Tstamp) Values (:APPUSER, User,
> 'DWH-PROD', 'DP_BLANK', SYSDATE)
>
> if the query application decodes :APPUSER, great, but if not, Oracle
> will know to substitute a default value and not cough up an error?
>
> Thanks,
>
> Carole
Received on Wed Sep 25 2002 - 15:49:33 CDT

Original text of this message

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