I'm working on a solution where several SQL and PL/SQL scripts are being run together, in a batch of sorts, via SQL*Plus.
I'm declaring SET ECHO OFF;
and SET ECHO ON;
at relevant points in the scripts so as to output relevant code.
Currently the output looks something like this:
SQL> DECLARE
2 ct number := 0;
3 ctChanges number := 0;
4
5 BEGIN
6 select count(*) into ct from ...
7 (...rest of code block...)
"some specific status message"
Commit executed.
We keep this output as a run-log in our build-environment, but can also access it as a plain text file.
One downside of this format however, is that if I'd like to copy a certain section of the code and run it again in an IDE (like Toad or SQL Developer), it's hard to exclude the line numbers.
Is it possible to tell SQL*Plus to output the code as above, but without including the line numbers?
You can use options sqlnumber
and sqlprompt
:
set sqlprompt ''
set sqlnumber off
SET SQLN[UMBER] {ON|OFF}
SET
SQLNUMBER
is not supported in iSQL*PlusSets the prompt for the second and subsequent lines of a SQL command or PL/SQL block.
ON
sets the prompt to be the line number.OFF
sets the prompt to the value ofSQLPROMPT
.
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