I try to copy the records from one database to another.
create1.insertInto(Tables.KTO).select(
create2.select().from(Tables.KTO)
).execute();
Since I have a primary key with auto_increment this wont work.
In pure SQL it is not possible to exclude the primary key i
You can easily extract a set of columns without the primary key as follows:
List> fields = new ArrayList<>(Arrays.asList(KTO.fields()));
fields.removeAll(KTO.getPrimaryKey().getFields());
create1.insertInto(KTO).columns(fields).select(
select(fields).from(KTO)
).execute();
Perfect, thank you. (to copy it from one db to another, create2 was
missing)
List> fields = new ArrayList<>(Arrays.asList(KTO.fields()));
fields.removeAll(KTO.getPrimaryKey().getFields());
create1.insertInto(Tables.KTO).columns(fields).select(
create2.se
On Fri, Mar 29, 2019 at 8:36 AM Christian Master wrote:
> Perfect, thank you. (to copy it from one db to another, create2 was
> missing)
>
Yes of course.
> For one row i do it this way:
> MyRecord my1 = create2.selectFrom(KTO).fetchAny();
> my1.set(KTO.KTOID,null);
> create1.in
thank you so much!
Am Freitag, 29. März 2019 09:09:57 UTC+1 schrieb Lukas Eder:
>
>
>
> On Fri, Mar 29, 2019 at 8:36 AM Christian Master > wrote:
>
>> Perfect, thank you. (to copy it from one db to another, create2 was
>> missing)
>>
>
> Yes of course.
>
>
>> For one row i do it this way: