Closed. This question is not reproducible or was caused by typos . It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 days ago.
Improve this question
What happens is that I have this ORA-01722 error despite verifying that my tables have only numeric values but it does not identify it problem what I want is to create a function that adds any column of a query with two tables
create table empleado1(
cod varchar2(5) not null,
nombre varchar2(15) not null,
sueldo FLOAT not null
);
create table empleado2(
cod varchar2(5) not null,
nombre varchar2(15) not null,
sueldo FLOAT not null
);
insert into EMPLEADO1 (COD,NOMBRE,SUELDO) values ('00001','Ricardo',100);
insert into EMPLEADO1 (COD,NOMBRE,SUELDO) values ('00002','Jorje',100);
insert into EMPLEADO2 (COD,NOMBRE,SUELDO) values ('00001','Freeman',100);
insert into EMPLEADO2 (COD,NOMBRE,SUELDO) values ('00002','Pepe',100);
CREATE FUNCTION SF_PRE1 (columna FLOAT)
RETURN FLOAT
AS
total FLOAT;
BEGIN
SELECT SUM(columna) INTO total
FROM empleado1
INNER JOIN empleado2 ON empleado1.sueldo = empleado2.sueldo;
RETURN total;
END;
SELECT SF_PRE1('sueldo')
FROM dual;
this is the code
1条答案
按热度按时间imzjd6km1#
That function doesn't make much sense as
columna
column in any of those tableswhere
condition (why are you passing a parameter, then?)float
, why are you passing a string ('sueldo'
) to it?Something that compiles (but I have no idea whether it does what you wanted):