Teju Teju - 6 months ago 11
SQL Question

dropping a schema with a badly chosen name in sql

How to drop a schema which has a an additional space in its name? When listing out the schemas it shows up as

BABBLER GROUP
. But when trying to drop (
sys as sysdba
) using
drop user BABBLER GROUP CASCADE;
it shows error.

enter image description here

Answer

Use quotes; e.g. drop user "BABBLER GROUP" CASCADE

The same is true for any object with a space in its name.

NB: Per commments here: http://stackoverflow.com/a/13798120/361842 Some tools aren't compatible with this feature; SQL Plus should be.

Oracle documentation on the same here: https://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements008.htm

Comments