Is something like this an acceptable compromise for the users:
SQL> @c:\temp\what_the_user_runs
what table name are you after TE
old 2: if '&&1' = 'MISSING' then
new 2: if 'TE' = 'MISSING' then
PL/SQL procedure successfully completed.
old 3: where tname like '&&1%'
new 3: where tname like 'TE%'
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
TEXT_TAB TABLE
TEST_XML TABLE
TEST_VIEW VIEW
TEST_TAB_X TABLE
TEST_STATS TABLE
TEST_RANK TABLE
TEST_FLUSH TABLE
TESTEMP TABLE
TEACHER TABLE
9 rows selected.
SQL> @c:\temp\what_the_user_runs
what table name are you after
old 2: if '&&1' = 'MISSING' then
new 2: if 'MISSING' = 'MISSING' then
begin
*
ERROR at line 1:
ORA-20000: You didnt supply a parameter
ORA-06512: at line 3
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Advanced Analytics
and Real Application Testing options
what_the_user_runs.sql
======================
set define '&'
accept xxx char default MISSING prompt 'what table name are you after '
@@my_real_script &&xxx
my_real_script.sql
==================
whenever sqlerror exit
begin
if '&&1' = 'MISSING' then
raise_application_error(-20000,'You didnt supply a parameter');
end if;
end;
/
whenever sqlerror continue
select *
from tab
where tname like '&&1%';
Cheers,
Connor