Hi Steve,

Glad to hear that this has sorted out your issue!

Best Regards,
Lukas


2014-04-09 17:02 GMT+02:00 <[email protected]>:

> Rob-
> Yes this is what I did.
>
> Lukas-
> Yes I was just being stupid.  I should've (and have now) just
> done AmlTestResults tr = AML_TEST_RESULTS; as you recommend.
>
>
> On Tuesday, April 8, 2014 10:44:06 AM UTC-5, Rob Sargent wrote:
>
>>
>> Have you tried
>> AmlTestResults tr = AML_TEST_RESULTS.as("tr");
>> create.insertInto(AML_TETS_RESULTS, tr.ID, tr.BANK_ID, tr.RUN_ID,
>> tr.TEST_NAME, tr.TEST_SCORE)
>>                 .values(34L, 123, "T1", "ThisIsATest",
>> -1000000).execute();
>>
>> On 04/07/2014 11:19 AM, [email protected] wrote:
>>
>> Hello-
>>
>> I'm actually a commercial user, but have a low-priority support question.
>>  I have generated bindings and I have code, following the examples, like:
>>
>>   AmlTestResults tr = AML_TEST_RESULTS.as("tr");
>>         create.insertInto(tr, tr.ID, tr.BANK_ID, tr.RUN_ID, tr.TEST_NAME,
>> tr.TEST_SCORE)
>>                 .values(34L, 123, "T1", "ThisIsATest",
>> -1000000).execute();
>>
>> However, I see that this generates sql incorrectly.  The table name is
>> AML_TEST_RESULTS but it creates the insert statement with the alias instead
>> of the table name!
>>
>> DEBUG Executing query          : insert into [tr] ([id], [bank_id],
>> [run_id], [test_name], [test_score]) values (?, ?, ?, ?, ?)
>> DEBUG -> with bind values      : insert into [tr] ([id], [bank_id],
>> [run_id], [test_name], [test_score]) values (34, 123, 'T1', 'ThisIsATest',
>> -1000000)
>> DEBUG Exception                : Total: 81.936ms
>> DEBUG Finishing                : Total: 83.077ms, +1.14ms
>>
>> org.springframework.jdbc.UncategorizedSQLException: jOOQ; uncategorized
>> SQLException for SQL [insert into [tr] ([id], [bank_id], [run_id],
>> [test_name], [test_score]) values (?, ?, ?, ?, ?)]; SQL state [S0002];
>> error code [208]; Invalid object name 'tr'.; nested exception is
>> com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name
>> 'tr'.
>>     at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTr
>> anslator.translate(AbstractFallbackSQLExceptionTranslator.java:84)
>>     at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTr
>> anslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
>>     at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTr
>> anslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
>>     at com.argodata.fraud.commons.database.mapping.
>> JooqExceptionTranslator.exception(JooqExceptionTranslator.java:21)
>>     at org.jooq.impl.ExecuteListeners.exception(
>> ExecuteListeners.java:232)
>>     at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:328)
>>     at org.jooq.impl.AbstractDelegatingQuery.execute(
>> AbstractDelegatingQuery.java:140)
>>
>>
>> The workaround of doing create.insertInto(AML_TEST_RESULTS, tr.ID, ..)
>> works fine, but it seems like I should be able to do the other as well, no?
>>
>> Also, as a minor nit: in all of the documentation examples here
>> http://www.jooq.org/doc/3.3/manual/sql-building/sql-
>> statements/insert-statement/ it never shows that you need to call
>> .execute() at the end.  This was pretty obvious to debug, but still a minor
>> annoyance for someone new to jooq.
>>
>> Thanks!
>> Steve Ash
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "jOOQ User Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>   --
> You received this message because you are subscribed to the Google Groups
> "jOOQ User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to