JOOQは、指定された列の「selectに挿入」構文を実行できますか?私はいくつかの異なる試みを実行します。
テーブル:
table1(予想される挿入)
id column1 column2column3...タイムスタンプ 1 John Leo null 2012/1/28 23:32:23(予想される挿入)
表2
id col1 col2 col3 101 John xxx xxx(table2.col1から) 102 xxx xxx xxx
table3
id col1 col2 col3 101 xxx Leo xxx(table3.col2から) 102 xxx xxx xxx
INSERT INTO table1 ( column1, column2 )
SELECT table2.col1, table3.col2
FROM table2 join table3 t3 on table2.id = table3.id
where table2.id = 101;
JOOQコード:
create.insertInto(table1, column1, column2 )
.values( create.select( table2.col1, table3.col2 )
.from(table2)
.join(table3)
.on( table12.id.equal(table3.id) )
.where( table2.id.equal(101) ))
.execute(); //.getSQL();
JOOQ showエラーメッセージ:
The number of values must match the number of fields
私がどのような問題を起こし、JOOQコードを修正する方法を誰もが知っています。ありがとう、支払います。