Don't worry, it happens to the best :)

I wish there was a simpler way to trigger execution. Like in PL/SQL, where
execution is "automatic" as soon as the parser hits the semicolon. But
unfortunately, that's not possible in an internal DSL. With fetch() it's
more obvious as you want to use the result, unlike execute()'s returned row
count, which is mostly useless.

Of course, you could switch to "external execution" via
DSLContext.execute(Query), but that would remove fluency, I suspect.

Oh well...

2016-06-21 16:24 GMT+01:00 Patrick Conway <[email protected]>:

> DOH!!!
>
> Well that was embarassing :)
>
>
>
> On Thursday, June 9, 2016 at 11:31:30 AM UTC+1, Lukas Eder wrote:
>>
>>
>>
>> 2016-06-09 13:04 GMT+03:00 <[email protected]>:
>>
>>> How do I execute a createTableIfNotExists correctly
>>>
>>> Calling the method is not creating the table.  Is there an additional
>>> step to execute the statement?
>>>
>>
>> The answer is in your question :)
>>
>>
>>>
>>> DSLContext create = DSL.using(conn, SQLDialect.MYSQL);
>>>
>>>
>>> logger.info("CREATING TABLES");
>>>
>>> create.createTableIfNotExists(Keystore.KEYSTORE);
>>>
>>> Append ".execute()" Of course, you will need to first append also some
>> columns.
>> Some examples can be found here in the manual:
>>
>> http://www.jooq.org/doc/latest/manual/sql-building/ddl-statements/create-statement
>>
> --
> 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