Hi,
My 'LINKED TABLE' does not work as expected.
I can execute simple 'SELECT' statement on a linked table,
but 'SELECT' statement fails when SQL statement contains 'WHERE'
clause with any column name,
saying "Column XXX not found" when it exists.
Is this a bug or an designed behavior? Any Workaround ?
I use the following statements on H2 1.0.75 :
----- SQL Stamentes ---------------------
[Creating LINKED TABLE:]
CREATE LINKED TABLE link_mouse430_2('com.mysql.jdbc.Driver',
'jdbc:mysql://
remoteserver.com:3306/annotation', 'userid', 'userpw',
'mouse430_2');
[This SQL works:]
select * from link_mouse430_2
create table mouse430_2 as select * from link_mouse430_2
[This SQL does not work:]
select * from link_mouse430_2 where probe_id = 'a';
Column PROBE_ID not found; SQL statement:
select * from link_mouse430_2 where probe_id = 'a' [42122-75]
42S22/42122 (Help)
org.h2.jdbc.JdbcSQLException: Column PROBE_ID not found; SQL
statement:
select * from link_mouse430_2 where probe_id = 'a' [42122-75]
at org.h2.message.Message.getSQLException(Message.java:103)
at org.h2.message.Message.getSQLException(Message.java:114)
at org.h2.message.Message.getSQLException(Message.java:77)
at
org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:
125)
at org.h2.expression.Comparison.optimize(Comparison.java:133)
at org.h2.command.dml.Select.prepare(Select.java:688)
at org.h2.command.Parser.prepareCommand(Parser.java:235)
at org.h2.engine.Session.prepareLocal(Session.java:285)
at org.h2.engine.Session.prepareCommand(Session.java:246)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:
1042)
at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:151)
at org.h2.server.web.WebThread.getResult(WebThread.java:1707)
at org.h2.server.web.WebThread.query(WebThread.java:1270)
at org.h2.server.web.WebThread.process(WebThread.java:437)
at org.h2.server.web.WebThread.processRequest(WebThread.java:184)
at org.h2.server.web.WebThread.process(WebThread.java:234)
at org.h2.server.web.WebThread.run(WebThread.java:194)