Re: Things I didn't know about Oracle column aliases

  • From: "Jonathan Lewis" <jonathan@xxxxxxxxxxxxxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 14 Dec 2011 10:38:05 -0000

I think Tanel Poder wrote a blog note some time ago about the way Oracle 
tokenizes text incrementally in a way that let's you get away with omitting 
spaces, but sometimes surprises you.  The 123456789FA can be explained by 
this - Oracle keeps reading until tokenization fails, so it reads up to the 
F and finds that the A would cause a tokenization error, so it stops at the 
F.  The next token is therefore the A - which is legal if it is treated as 
a column alias.

(Found the reference: 
http://blog.tanelpoder.com/2011/01/10/is-this-valid-sql-syntax/)

Regards

Jonathan Lewis
http://jonathanlewis.wordpress.com
Oracle Core:
http://www.apress.com/9781430239543

----- Original Message ----- 
From: "Norman Dunbar" <oracle@xxxxxxxxxxxxxxx>
To: <oracle-l@xxxxxxxxxxxxx>
Sent: Wednesday, December 14, 2011 9:44 AM
Subject: Things I didn't know about Oracle column aliases


I knew you could do this:

SQL> select 1234567890 as abc from dual;

        ABC
----------
1234567890


--
//www.freelists.org/webpage/oracle-l


Other related posts: