Re: INSERT with a SELECT subquery

2018-01-17 Thread gowri.tn
Sir, The following is our code: Still we are not able to succeed in insert values into table. Please advice. With regards, Gowri S package com.nic.audit; import java.io.File; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.util.Arrays; im

Re: INSERT with a SELECT subquery

2018-01-17 Thread Kasper Sørensen
I don't know what you're doing here since your formatting is very strange looking. I do see that you're dropping a table, which I don't understand why. Is it failing because you're trying to insert into the table that was just dropped? Regardless, if you want help fixing your issues, please also pr

Re: INSERT with a SELECT subquery

2018-01-17 Thread gowri.tn
Table table = dataContext.getTableByQualifiedLabel("test"); dc.executeUpdate(new UpdateScript() { @Override public void run(UpdateCallback callback) { callback.dropTable(schema.getTableByName("test")).execute(); } }); while(ds.next()) { > > System.out.println(">>> " + Arrays.t

RE: INSERT with a SELECT subquery

2018-01-11 Thread Tim Kingsbury
Excellent. Thank you!! Tim -Original Message- From: Kasper Sørensen [mailto:i.am.kasper.soren...@gmail.com] Sent: Wednesday, January 10, 2018 11:07 PM To: dev@metamodel.apache.org Subject: Re: INSERT with a SELECT subquery EXTERNAL Hi there, No that's not available. But you d

Re: INSERT with a SELECT subquery

2018-01-10 Thread Kasper Sørensen
Hi there, No that's not available. But you do get something quite equivalent with this: Table table = dataContext.getTableByName("us_south_es_etg"); dataContext.executeUpdate(callback -> { try (DataSet ds = dataContext.query().from("us_south").selectAll().execute()) { while (ds.next()) {

INSERT with a SELECT subquery

2018-01-10 Thread Tim Kingsbury
Hello, Using Metamodel, is it possible to build an INSERT statement that is paired with a SELECT subquery? For example: INSERT TABLE `us_south_es_etg` SELECT `lon`, `lat`, `number`, `street`, `unit`, `city`, `district`, `region`, `postcode`, `id`, `hash` FROM us