Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Optional (ignored) parameters in stored procedures (PL/SQL)? How to?
Hi,
State is a parameter of the function. When it's NULL, we don't need to query for it.
Is there a way to replace this peace of code:
.
.
IF (state IS NOT NULL) THEN
OPEN resultCursor FOR
SELECT UMET_ID
FROM T_UM_BASE WHERE UMBS_MEMB = memberId AND UMBS_OBJ_STT = state;
FROM T_UM_BASE WHERE UMBS_MEMB = memberId;
This may work in MSSQL but doesn't work in Oracle:
OPEN resultCursor FOR
SELECT UMET_ID
FROM T_UM_BASE
WHERE UMBS_MEMB = memberId
AND UMBS_OBJ_STT = COALESCE(state, UMBS_OBJ_STT);
Any help?
Thanks Received on Fri Jan 09 2004 - 09:16:47 CST
![]() |
![]() |