Hi,

I have created a alias called WELL and it works fine from the h2 shell.This 
is how I execute it

CALL WELL('SELECT FBNK.CUSTOMER');

This returns the correct data.However when I have single quotes as the part 
of the query h2 does throws error saying invalid syntax

sql> call WELL('SELECT FBNK.CUSTOMER SAVING EVAL"@ID:',':SHORT.NAME"');
Error: org.h2.jdbc.JdbcSQLException: Method "doIt (WEBSEL.WEBSELECT, 
parameter
ount: 2)" not found; SQL statement:
call WELL('SELECT FBNK.CUSTOMER SAVING EVAL"@ID:',':SHORT.NAME"') 
[90087-172]
        at 
org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
        at org.h2.message.DbException.get(DbException.java:169)
        at org.h2.message.DbException.get(DbException.java:146)
        at 
org.h2.engine.FunctionAlias.findJavaMethod(FunctionAlias.java:255)
        at org.h2.expression.JavaFunction.<init>(JavaFunction.java:33)
        at org.h2.command.Parser.readJavaFunction(Parser.java:2151)
        at org.h2.command.Parser.readFunction(Parser.java:2190)
        at org.h2.command.Parser.readTerm(Parser.java:2500)
        at org.h2.command.Parser.readFactor(Parser.java:2062)
        at org.h2.command.Parser.readSum(Parser.java:2049)
        at org.h2.command.Parser.readConcat(Parser.java:2022)
        at org.h2.command.Parser.readCondition(Parser.java:1887)
        at org.h2.command.Parser.readAnd(Parser.java:1868)
        at org.h2.command.Parser.readExpression(Parser.java:1860)
        at org.h2.command.Parser.parseCall(Parser.java:4038)
        at org.h2.command.Parser.parsePrepared(Parser.java:326)
        at org.h2.command.Parser.parse(Parser.java:279)
        at org.h2.command.Parser.parse(Parser.java:251)
        at org.h2.command.Parser.prepareCommand(Parser.java:218)
        at org.h2.engine.Session.prepareLocal(Session.java:425)
        at org.h2.server.TcpServerThread.process(TcpServerThread.java:255)

In java when we want to use a double or single codes within a string we use 
\" or \'.I tried this as well but does not work for alias parameters.Kindly 
let me know how I can use single quotes within alias function in shell 
prompt.

Thanks

Cheers,
Harish

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to