How can I dump out the body of a function or a procedure when using sqlplus to connect to an oracle database?
Oracle SQLPlus Export To CSV Using SPOOL Command SQLPlus is an interface to query the data present in Oracle DB. It is available in the form of a command-line tool and a Windows-based GUI tool. The SPOOL command will be used to perform Oracle SQLPlus export to CSV data.
@@ (double at sign) Runs a script. This command is similar to the @ (at sign) command It is useful for running nested scripts because it looks for the specified script in the same path as the calling script. / (slash) Executes the SQL command or PL/SQL block.
A stored procedure does not have a return value but can optionally take input, output, or input-output parameters. A stored procedure can return output through any output or input-output parameter.
To run a stored procedure in SQLPlus the command is something like this. SQL> EXECUTE procedure_name('passed_value');
select
text
from
user_source
where
type = 'PROCEDURE'
and
name='YOURPROCEDURENAME'
order by
line;
Use:
SELECT us.name,
us.type,
us.text
FROM USER_SOURCE us
WHERE us.type IN ('PROCEDURE', 'FUNCTION')
ORDER BY name, line
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With