Error in multi-line sql query

Can someone explain whats happening here?

Both are same query, with the only difference of multi-line and single line in SQL Developer.

The query-

SELECT (TO_TIMESTAMP('10/08/2012','DD/MM/YYYY') -NUMTODSINTERVAL(1/(24*25*60*1000),'HOUR')) a FROM dual;

The above works, but the below won't-

SELECT (TO_TIMESTAMP('10/08/2012','DD/MM/YYYY') -
              NUMTODSINTERVAL(1/(24*25*60*1000),'HOUR')) a FROM dual;

Answers


It looks like SQL Developer's parser requires the argument after its - operator to be on the same line. ...so this works:

SELECT (TO_TIMESTAMP('10/08/2012','DD/MM/YYYY') 
- NUMTODSINTERVAL(1/(24*25*60*1000),'HOUR')) a 
FROM dual;

So the problem isn't multi-line per-se, but rather needing to have the operator (-) on the same line as its operand. Why exactly? I'd say either a bug, or just a sub-optimal implementation.

[Edit: as others have noted, the hyphen is the default line continuation character, which is why this works this way]


Need Your Help

spring mvc servlet initialization

java spring spring-mvc initialization

I am new to spring MVC. I am looking for a place in my spring mvc applicationwhere I can initialize all sorts of things in the application.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.