Hi Johannes,

There is a pending issue related to this flag:
https://github.com/jOOQ/jOOQ/issues/1818

So far, I haven't figured out how to generally work around this issue. One
possible workaround would be for you to implement a VisitListener to
transform the generated SQL to ignore all inserts to this column. Another
would be to explicitly specify the fields to be loaded using the
LoaderJSONStep.fields() method.

But I suspect that you actually want to (re-)load those IDs, right? How
would this be solved correctly using JDBC? Does this flag "survive" a
connection / transaction / statement?

Cheers
Lukas


2014-02-07 16:48 GMT+01:00 <[email protected]>:

> When trying to import data using the JsonLoader into MSSqlServer 2012 like
> this :
>
>          Table<? extends TableRecord> table = tables.get(tableName);
>          LoaderJSONStep<? extends TableRecord> loaderJSONStep =
> create.loadInto(table)
>                     .onDuplicateKeyIgnore()
>                     .onErrorAbort()
>                     .commitNone()
>
> .loadJSON(jsonDataFiles.get(table.getName()).getInputStream());
>
> I get
>
> Cannot insert explicit value for identity column in table 'stamm_daten'
> when IDENTITY_INSERT is set to OFF.
>
> errors. I tried to set
>
> create.execute("SET IDENTITY_INSERT " + stringTableEntry + " " + onOff);
>
> Without success.
> The generated insert statements contains the column names, so this should
> also not be a Problem.
> Any ideas?
>
> Thanks
> Johannes
>
> --
> 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/groups/opt_out.
>

-- 
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/groups/opt_out.

Reply via email to