Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Basic SQL and package question
Yes. An I use it in my where clause, but same "ORA-00904 Invalid
identifier" problem.
I am doing this in Visual C++ 6, Pro*C though.
SELECT
..
FROM
..
WHERE
... AND
.. .AND
F_USER_CAN_SEARCH_IN_CPI(:IndEmergencySearch, INS.CPI_CODE) = 1;
New function:
CREATE OR REPLACE FUNCTION F_USER_CAN_SEARCH_IN_CPI
(
P_EMERGENCY_CODE NUMBER,
P_CPI_CODE NUMBER
)
RETURN NUMBER
IS
V_Result NUMBER;
BEGIN
V_Result := 1;
IF ( P_EMERGENCY_CODE = 0 ) THEN
V_Result :=
Pi_Security.F_USER_CAN_SEARCH_IN_CPI_CODE( P_CPI_CODE );
END IF;
RETURN V_Result;
END;
/
The function works fine if I test it in Toad:
I do this first, to initialize the session:
DECLARE
N NUMBER;
BEGIN
N := Pi_Security.F_Get_User_Cpis('ADMINVO',
'CHVOSPR','PT_GEN_CHVOSPR');
END;
Then this:
SELECT F_USER_CAN_SEARCH_IN_CPI(0, 105) FROM dual
Returns 1 correctly Received on Wed Dec 19 2007 - 16:30:05 CST
![]() |
![]() |