How to Create a Function in Oracle with Examples
The following function will add a new column called SOME_NEW_COLUMN with a NUMBER datatype to all tables in the current schema. This function does not take any parameters. CREATE OR REPLACE FUNCTION ADD_COLUMN_FUNCTION RETURN INTEGER IS temp_String varchar2(200); temp_Table_Name varchar2(30); CURSOR cursor_User_Tables IS SELECT TABLE_NAME FROM USER_TABLES; BEGIN FOR rec IN cursor_User_Tables LOOP temp_Table_Name := [...]