Hi,

I am using the newest version of H2, and recently I encountered a weird 
issue.
Under mysql mode, I tried to use "CREATE ALIAS IF NOT EXISTS UNIX_TIMESTAMP 
FOR "com.xxx.xxx.xxx.xx", but it threw me :
org.h2.jdbc.JdbcSQLSyntaxErrorException: Function alias "UNIX_TIMESTAMP" 
already exists; SQL statement:
CREATE ALIAS IF NOT EXISTS UNIX_TIMESTAMP FOR "com.xxx.xxx.xxx.xx".
This also happened on FROM_UNIXTIME as well as DATE.

After doing research, I found out that these three functions have been 
built-in under mysql mode since 1.4.194, and this might be the cause of 
that exception.
However, my *.sql scripts writing such user-defined functions are runned 
under either oracle or mysql mode, due to different needs. It works under 
oracle, but throws exceptions under mysql mode, is there any adjustment I 
can made to make them work fine on both modes?

I have tried to use DROP ALIAS IF EXISTS, while it seems that these 
built-in functions are different from user-defined functions, such dropping 
only worked on "real" aliases, not on "built-in" or say "reserved" 
functions. And I need to keep these codes, because I still need to call 
these functions under oracle mode using the same scripts. Hope anyone can 
advise.

Many thanks,
Yuqiang

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/4014199e-643e-49cb-9ef4-b0417daf6e42n%40googlegroups.com.

Reply via email to