5
I hope to be clear on this issue , I will define in a general way but I believe that enough
1) I create any FUNCTION that returns a VARCHAR, it does not interfere with the return
2) I create a VIEW using this FUNCTION
Result : The field size that uses the FUNCTION in the VIEW is VARCHAR(4000)
Question : Is there any way in FUNCTION that I can specify the return size ?
Code Example :
create or replace FUNCTION EXEMPLO ( pX IN VARCHAR2)
RETURN VARCHAR2 IS
vSAIDA VARCHAR2(6);
BEGIN
--FAZ ALGUMA COISA E OBTEM VSAIDA;
END IF;
RETURN vSAIDA;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN ' ';
END;
CREATE OR REPLACE VIEW V_EXEMPLO
AS
SELECT EXEMPLO('1') SAIDA FROM DUAL;
you want to specify the size of the return in the Function or view?
– Erick Gallani
Thanks for the comment. I wanted VIEW to have a specific size , I could do a CAST in VIEW’s SELECT , but I want to know if you have how to set output in FUNCTION.
– Motta