With double quotes (almost) everything goes…

3

After you have read the blog posts the websites of Sergio Leunissen, Eddie Awad  or the "Ask Mr. Ed" website, you may wonder, if that was all you could do with those "magic" double quotes…
Probably not, I know of at least one other neat "trick" you can do with it…

Ever tried the following?

SQL> create user "=:Marco:=" identified by "Username is Invalid";

You won’t make life easy though, because now you will have to use the double quotes to login as follows:

SQL> connect "=:Marco:="/"Username is Invalid"

And if you want to connect via an extra [ENTER], than you must not to forget also to type in your double quotes…

....

 
While testing: I saw, that you can go a "whitespace to far". 

 

One is allowed to create very strange users, but not always does this also mean that you can login.

This "feature" has been there for a long time. I used it as a "gimmick" in Oracle 7.1, and in the times that this feature wasn’t so known, to mask the contents of my tables for other people. Using double quotes also makes your typing case-sensitive and in my Oracle 7 days, this was not (commonly) known.

You won’t make your life easy though. Ever tried to drop a table as described in Sergio’s post (what if you forgot the amount of spaces you used ;-).

Of course one could find the amount of used whitespace with a replace statement, replacing all whitespaces with for instance a "1".

I learned about this feature by looking into Oracle 7 dump files (a thing you normally should NOT do, you could corrupt your dump file) by using notepad and noticed the double quotes around every object in DDL statements. 

A while ago I also tested this "feature" on Oracle 4.1 and even with the software of those times, it works and maybe not in the extent it can be used with the software of today, but nevertheless.

Creating a table "   …test 1…" ("TABLE" number)… 

  

 Inserting a number into table "   …test1…"

 

 Trying to create a table like Sergio with a name consisting of 4 whitespaces… 

 

 

 

Marco 

Smiley

Share.

About Author

Marco Gralike, working for AMIS Services BV as a Principal Oracle Database Consultant in the Netherlands, has experience as a DBA since 1994 (Oracle 6). Marco is also eager and skillful in other fields, like Operating System Administration and Application Servers, mainly to find working, performing solutions. Marco has been specializing in Oracle XMLDB, since 2003, focusing on his old love, database administration and performance. He is an Oracle XMLDB enthusiast ever since. He is also a dedicated contributor of the Oracle User Group community, helping people with their steep XMLDB learning curve. To this purpose, Marco also devoted his personal blog site to XMLDB and other Oracle issues. Marco is a member of the OakTable network and an Oracle ACE Director (specialization Oracle XMLDB).

3 Comments

  1. What about using this feature in datafile naming (and try to see what Oracle does or does not accept, and what the OS does or does not accept…)
    ;-)

  2. This is in the same category as ending your script with:

    roll roll roll your boat;

    instead of:

    rollback;

    A nice feature to play around with other peoples heads ;)