Is there a function in PL/SQL to show a variable's exact type, like the DUMP function in SQL?
I've tried the following
DECLARE
l_variable INTEGER := 1;
BEGIN
DBMS_OUTPUT.PUT_LINE (DUMP (l_variable));
END;
But it gives the following error:
PLS-00204: function or pseudo-column 'DUMP' may be used inside a SQL statement only
as you should notice, DUMP is an overloaded function. it has 3 overloads.
So you can simulate the same thing within your code.
the above code may not work properly but should give you the idea how to deal the problem.
I hope that this will fulfil your requirements.
Note; you can put these functions in a Package and use them accordingly.
You can create this function using PL/Scope. But it won't work with anonymous blocks, and you'll need to reference the variable as a string.
Example: