How could you obtain the numeric data of a specific table to perform an operation using a stored procedure that returns, for example, the division of these two data into another field in the same table?
How could you obtain the numeric data of a specific table to perform an operation using a stored procedure that returns, for example, the division of these two data into another field in the same table?
Oscar, the simplest thing would be this, you have a table of three fields (FIELD1, FIELD2, DIVISION) and an associated stored procedure would be like this:
PROCEDURE SP_UPD_MITABLA() IS
BEGIN
UPDATE MITABLA
SET CAMPO_DIVISION = (CAMPO1/CAMPO2)
WHERE --ALGUNA LOGICA DE FILTRO
COMMIT;
END;
Obviously, you should be careful that CAMPO2 was never zero or zero for example, to avoid errors.