Ok, thanks, it would also be good to update "User-Defined Functions and 
Stored Procedures" documentation part with your answer/information.

On Wednesday, January 2, 2013 3:44:30 PM UTC+1, Noel Grandin wrote:
>
> We already have a CHAR function, and you can't override built-in 
> functions. 
>
> We should probably be throwing an error at the CREATE ALIAS command. 
>
> On 2012-12-24 22:42, [email protected] <javascript:> wrote: 
> > Hi, I'm trying to unit test some legacy DB2 style SQLs, the issue I'm 
> > facing is that my H2 user defined function SQL: 
> > 
> > CREATE ALIAS CHAR FOR "com.and.play.h2.Functions.charfromdate"; 
> > 
> > and Java: 
> > 
> > public class Functions { 
> > 
> >     public static String charfromdate(Object ts, Object s){ 
> >         return "done"; 
> >     } 
> > } 
> >  is not working with DB2 syntax : 
> > 
> > CHAR(cast(CVW.CTORGANS_DATE as date), ISO) 
> > 
> > And I'm getting this exception: 
> > Caused by: org.h2.jdbc.JdbcSQLException: Invalid parameter count for 
> > "CHAR", expected count: "1"; SQL statement: 
> > 
> > which means that my function is not taking effect, any Ides? 
> > 
> > Regards 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "H2 Database" group. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msg/h2-database/-/RFD_Zxf0HsYJ. 
> > To post to this group, send email to 
> > [email protected]<javascript:>. 
>
> > To unsubscribe from this group, send email to 
> > [email protected] <javascript:>. 
> > For more options, visit this group at 
> > http://groups.google.com/group/h2-database?hl=en. 
>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/h2-database/-/jg3-P3jiWrAJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to