3

次のクエリを使用してテストを実行すると、HSQLDBは​​テーブルエイリアスをスキーマと間違えます。

SELECT c.country_ml2country as CTRY_PK, c.name as CTRY_NAME,
l.name as LANGUAGE_NAME, l.code as LANGUAGE_CODE
FROM country_ml as c, language as l
WHERE c.language(+) = l.id and c.country_ml2country(+) = ?
ORDER BY l.name ASC;

誰かがこれを以前に経験したことがありますか?「はい」の場合、修正は何ですか?

FROM country_ml as cに変更するとFROM country_ml as bob、それに応じてエラーメッセージがに変更されることに注意してくださいinvalid schema name: BOB

4

1 に答える 1

6

The problem is the non-standard Oracle-style OUTER JOIN syntax, which is specific to Oracle and not supported by other SQL dialects.

WHERE c.language(+) = l.id and c.country_ml2country(+) = ?

You should use instead the following standard syntax, which Oracle also supports:

SELECT c.country_ml2country as CTRY_PK, c.name as CTRY_NAME,
l.name as LANGUAGE_NAME, l.code as LANGUAGE_CODE
FROM country_ml as c RIGHT OUTER JOIN language as l
ON c.language = l.id and c.country_ml2country = ?
ORDER BY l.name ASC
于 2011-04-14T07:31:05.483 に答える