SqlPlus,表空间参数,转义点字符

SqlPlus, tablespace parameter, and escaping the dot character

我有一个需要作为进程链的一部分执行的 Sqlplus 脚本,其目的是摆脱两个用户定义的对象:

myscript.sql

def tablespaceName=&1

drop type &tablespaceName.my_user_tab;
commit;
drop type &tablespaceName\.my_user_type;
commit;
/

执行:Sqlplus myDbUser/myDbPassword@myDbSID @myscript.sql TESTTABLESPACE

Sqlplus 引擎以某种方式丢失了将表空间与对象名称分隔开的点字符:

old   1: drop type &tablespaceName.my_user_tab
new   1: drop type TESTTABLESPACEmy_user_tab
drop type TESTTABLESPACEmy_user_tab
*
ERROR at line 1:
ORA-04043: object TESTTABLESPACEMY_USER_TAB does not exist

如何让 Sqlplus 接受点并停止从脚本中删除它?

First of all, you don't need commit/rollback for DDLs.

并避开点点滴滴。只需使用双点。

drop type &tablespaceName..my_user_tab;

来自Doc

If you wish to append characters immediately after a substitution variable, use a period to separate the variable from the character.