Did a simple test on plainSQLTable() in order to achieve something
like
SELECT * FROM (SELECT * FROM x WHERE x.a = '1') A WHERE ...
Test Script:
==============================
String innerSql= ....
create.select().from(
create.plainSQLTable(innerSql).asTable("A")
).getSQL();
Exception:
==============================
java.lang.IllegalStateException: java.sql.SQLException: ORA-00903:
invalid table name
at org.jooq.impl.PlainSQLTable.getFieldList(PlainSQLTable.java:112)
at org.jooq.impl.AbstractType.getFields(AbstractType.java:80)
at org.jooq.impl.AbstractType.getFields(AbstractType.java:45)
Q:
==============================
While using plainSQLTable(), is that mandatory to provide all the
fields? (as I found the follows works:
String innerSql= ....
create.select( Field1, Field2 ).from(
create.plainSQLTable(innerSql).asTable("A")
).getSQL();
// where Field1 looks like create.plainSQLField("A.field1");
)