trying to create a function that if there is a value then I want to return 'X' but if no value I have to create an empty string with a space kinda like RPAD(' ',1,' ') or something like that
create or replace FUNCTION CHECK_SOLE_PROPRIETOR(polN
br IN VARCHAR2, cov_effdt IN DATE)
--ENDORSE_ID is a NUMBER when there is No value it looks like the pic below
SELECT ENDORSE_ID into v_EndorseID from ENDORSE where POLNBR = polNbr AND COV_EFFDT= cov_effdt AND ENDORSE_CD_NBR = '290307';
WHEN NO_DATA_FOUND THEN
WHEN VALUE_ERROR THEN
WHEN OTHERS THEN
When there is a value from the Select statement being run by itself with variables set that I know have a EndorseID it returns but if there is no Value it doesn't have any value displayed so I don't know what Im doing?
I would accept returning varchars 2, I don't care, but I need to evaluate the empty value so I can set its value to ' ' or 'X' if there is a return value.
Now, when I know there is a value that should be returned it is returning 0 e verytime regardless now...