With double quotes (almost) everything goes…

Marco Gralike 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:

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

3 thoughts on “With double quotes (almost) everything goes…

  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 😉

Comments are closed.

Next Post

EJB 3.0 Java Persistence API - "Refresh After Insert": Using EntityListeners to absorb the effects from Database Triggers

Facebook0TwitterLinkedinWhile preparing an article for JDJ as well as a presentation for Oracle Open World next week, I finally got round to finding a proper solution for a challenge I set myself during the JavaPolis 2005 University presentation by Mike Keith on EJB 3.0 Java Persistence API: how do I […]