1
I’m trying to create a function in the oracle, but I’m having a hard time creating her return.
CREATE OR REPLACE function simple_function(
state VARCHAR2,
city_id NUMBER)
RETURN VARCHAR2
IS ret VARCHAR2(255);
BEGIN
SELECT 'XXX ' || state || ' - ' || city_id INTO ret FROM DUAL;
RETURN ret;
END;
When I try the simplified version, it works
CREATE OR REPLACE function simple_function(
state VARCHAR2,
city_id NUMBER)
RETURN VARCHAR2
BEGIN
RETURN 'That''s All Folks!';
END;
I saw some documentations, and I don’t know what I’m doing wrong about the return variable. There are some similar functions in the system, and they work, but the return is NUMBER, What I need is a return VARCHAR2, I don’t know if there’s any differential to this case.
In the parameter you are passing state and this using the variable Uf, which is not declared.
– Confundir
@Confuse Sorry, I was translating to post on stackoverflow, but I thought it would be simpler if you post here. the nomenclature is the same in my example. If you run the example, with the same variables, the error will be the same.
– Michel Ayres