Hi,
1. The syntax for a linked table allows using a subquery or'(query-
> string)' in lieu of the table name. If the query string itself must
> contain single quotes, then I understandably get a syntax error as the
> parser doesn't know I'm trying to embed quotes in my string.
>
> Example: Executing
> create linked table lt1 ('mydriver','myurl','user','pass',NULL,
> '(select 'fish' as dinner,order_header.*,order_line.*order_line
> from demarc.order_header , demarc.order_line where
> order_header.orderid = order_line.orderid)')
>
This problem isn't related to H2. It's the ANSI SQL standard itself that
requires to use two single quotes as in:
'(select ''fish'' as dinner...'
This is documented (in H2, and elsewhere).
select count(*) from v2;
>
> However, now H2 is producing the count(*) instead of the remote
> database doing so
According to my test, the query "SELECT COUNT(*) FROM ..." is ran against
the linked table, in TableLink.getRowCount().
3. non-functioning linked tables. I keep seeing an issue with linked
> tables becoming non-functional. Suddenly, H2 doesn't show any columns
> for the linked table and you can't select anything from it.
>
That's the expected behavior.
work-around - when you get an error selecting data from a linked
> table, drop the table and re-create it, now you can use the table
> again.
>
Any idea why the linked tables stop working? Could it be due to a
> stale connection?
>
I can't reproduce this. If you have a simple reproducible test case please
post it.
Regards,
Thomas
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
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.