lbehnke / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

enhancement: allow to call 0-parameters functions without parenthesis + enhance error (code/description) #50

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,
It would be great to be able to call function with no parameters without
the parenthesis.

Example:

select user from dual;

expect to be similar to:

select user() from dual;

Resulting column name: USER (not USER())

Moreover, the current (h2-1.1.105) errorcode is wrong:

select user, database from dual;
Column USER not found; SQL statement:
select user, database from dual [42122-105] 42S22/42122

"COLUMN_NOT_FOUND_1 = 42122
The error with code 42122 is thrown when referencing an non-existing
column. Example:

 CREATE TABLE TEST(ID INT);
 SELECT NAME FROM TEST;"

Morevoer USER is not a column of the DUAL table.

Best regards,
Loïc Lefèvre

Original issue reported on code.google.com by loic.lef...@gmail.com on 17 Jan 2009 at 11:04

GoogleCodeExporter commented 9 years ago
Hi,

It is possible to implement this feature, but I don't understand the use case. 
Is it
for compatibility with another database? If yes with witch one? Or are there 
other
reasons?

Regards,
Thomas

Original comment by thomas.t...@gmail.com on 21 Jan 2009 at 6:25

GoogleCodeExporter commented 9 years ago
Hi,
sorry to not be clear enough.

I work with Oracle and I'm used to call 0-parameters functions without the
parenthesis: user instead of user()

So as a compatibility behavior, it could be good.

I spoke about the error message because if this enhancement (according to me), 
is not
possible then the error message should be modified. Actually, the error message
(regarding the previous example) tells us the USER column does not exists but it
could be more clear: inspect list of known functions/procedures and tells the
parenthesis are maybe missing.

Again sorry for the lack of clarity.

Regards,
Loïc

Original comment by loic.lef...@gmail.com on 21 Jan 2009 at 1:13

GoogleCodeExporter commented 9 years ago
I will add a feature request:

Oracle compatibility: support calling 0-parameters functions without 
parenthesis.
Make constants obsolete.

Original comment by thomas.t...@gmail.com on 26 Jan 2009 at 5:36

GoogleCodeExporter commented 9 years ago
Feature requests are tracked in the Roadmap at
http://www.h2database.com/html/roadmap.html
I will move this request there and close it here.
There will be a link to this issue.

Original comment by thomas.t...@gmail.com on 3 Apr 2009 at 12:29