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 -> How does one call a function as a 'one-liner' ?

How does one call a function as a 'one-liner' ?

From: Chris Ermlich <cermlich_at_swri.edu>
Date: 2000/03/22
Message-ID: <sdiilbablul134@corp.supernews.com>#1/1

Hi folks,

I'm having a problem calling a function as a one-line statement. The function is part of a package to validate proper user ID and password. It returns logical 1 or 0 (valid or invalid user ID/Password).

The following PL/SQL statement works fine: set serveroutput on
begin

    if ( check_password.is_valid( 'scott', 'tiger' ) ) then

        dbms_output.put_line( 'scott/tiger is valid' );     else

        dbms_output.put_line( 'scott/tiger is NOT valid' );     end if;
end;

However, I have a third party application (Netegrity SiteMinder) that allows only a one-line statemant as part of an ODBC setup, e.g.: Query_IsAuthenticated=EXECUTE check_password.is_valid( 'scott', 'tiger' )

This statement won't work since check_password.is_valid() is not a procedure but a function. I need a function in order to return a value.

The following statement:
Query_IsAuthenticated=select check_password.is_valid( 'scott', 'tiger' ) from dual;
will result in the error message:
ORA-06571: Function IS_VALID does not guarantee not to update database. That makes sense since the function itself uses embedded procedures which will temprarily alter data and therefore violate the Oracle purity levels. Therefore, I can't apply the PRAGMA RESTRICT_REFERENCES option within the package.

Does anyone know if there is another way to call a function as a one line statement?
Any help would be greatly appreciated.

Chris :-)
cermlich_at_swri.edu Received on Wed Mar 22 2000 - 00:00:00 CST

Original text of this message

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