McKinley wrote: > Re: Copy and Insert DBRecord (Urgent for me) > > On Fri, Jan 15, 2010 at 8:55 PM, Francis De Brabandere > <[email protected]> wrote: > > Feel free to contribute! The wiki should be open for everybody. > > http://cwiki.apache.org/confluence/display/empiredb/Query+Building > > I registered on the wiki but it does not appear that I can edit. I'll > send some wiki markup through the issue tracker for now. > > > I agree that sometimes getting things done is not that intuitive. > > Better documentation or api might help there. On the other hand I > have > > to agree with Rainer. These days the power of the database is > > sometimes forgotten. > > I agree with the philosophy of using the database as much as possible. > What I found confusing about getInsertInto() was making sure that > DBColumnExpr like t.colA.as("colA") are included in the select and > straight t.colA are not. In the end it is essentially just like > writing the statement.
There has to be some kind of mapping between the selection and the target columns. One should never rely on a particular order of column in the target table. However renaming the column is only necessary if the name of the selected column is different or if it is an expression (i.e. transformation). And you may as well use the other overload version of getInsertInto() where you can provide an array of target columns yourself. So I think you have all options here that you may require. > > At first glance it looks like Empire-db does not support joins in > insert and update statements. Is that true? What makes you think it does not? We're using it a lot with SQLServer. However not all databases support the standard SQL syntax with joins in updates (i.e. Oracle). Generally Empire-db should be able to create any kind of SQL statement (with a few database specific exceptions maybe). > > Thanks, > > McKinley Rainer
