CASE not working [message #250455] |
Tue, 10 July 2007 01:39 |
vinayakawasthi
Messages: 4 Registered: July 2005
|
Junior Member |
|
|
hi all,
I have the following query which is giving error. Can someone put some thoughts:
select 'Step '||tas.STEP_NUMBER||':'|| tasd.DESCRIPTION,tas.STEP_STATUS_CODE,
tarfe.REQUEST_NUMBER, tarfe.STATUS "Request Status",
tasd.NAME,
CASE
WHEN tasd.NAME='LINE_MANAGER' THEN NULL
WHEN tasd.NAME='ROLE_APPROVER' THEN
SELECT tard.APPROVER_ID
FROM VW_AP_PARSE_REQUEST_OVERVIEW vpro, TBL_AP_ROLE_DEFAULT tard
WHERE vpro.REQUEST_NUMBER=tarfe.REQUEST_NUMBER
AND vpro.ROLE_ID=tard.ROLE_ID
WHEN tasd.NAME='HR_APPROVER' THEN
SELECT tard.APPROVER_ID
FROM TBL_AP_APPROVER taa, TBL_AP_POPULATION_APPROVER tapa
WHERE taa.APPROVER_ID=tapa.APPROVER_ID
AND tapa.POPULATION_CODE='HR'
WHEN tasd.NAME='GMB_GEB_APPROVER' THEN
SELECT tard.APPROVER_ID
FROM TBL_AP_APPROVER taa, TBL_AP_POPULATION_APPROVER tapa
WHERE taa.APPROVER_ID=tapa.APPROVER_ID
AND tapa.POPULATION_CODE='GEB_GMB'
END approver_id
FROM TBL_AP_STEP tas,
TBL_AP_STEP_DEFINITION tasd,
TBL_AP_STEP_STATUS tass,
TBL_AP_REQUEST_FROM_EMPLOYEE tarfe
WHERE tas.PROCESS_DEFINITION_NUMBER=tasd.PROCESS_DEFINITION_NUMBER
AND tas.STEP_DEFINITION_NUMBER=tasd.STEP_DEFINITION_NUMBER
AND tarfe.REQUEST_NUMBER=tas.REQUEST_NUMBER
AND tarfe.REQUEST_NUMBER=197
this gives "ORA-00936: missing expression"
Please help me.
|
|
|
|
|
|
|