You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by "Thomas Fox (JIRA)" <ji...@apache.org> on 2013/12/15 17:43:07 UTC

[jira] [Commented] (TORQUE-305) Do insert with a select subquery

    [ https://issues.apache.org/jira/browse/TORQUE-305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13848630#comment-13848630 ] 

Thomas Fox commented on TORQUE-305:
-----------------------------------

An aspect which is not traightforward to solve is the automatic generation of primary keys for the inserted values.
In databases which use autoincrement like mysql, this is not a problem as one can leave out the primary key column and then get an id automatically.
For databases which use sequences, a sql expression must be inserted to get the correct pk value. This case should be handled automatically.
Anybody using the idbroker must specify the id values manually, as theere is no way to query the idbroker from the database.

> Do insert with a select subquery
> --------------------------------
>
>                 Key: TORQUE-305
>                 URL: https://issues.apache.org/jira/browse/TORQUE-305
>             Project: Torque
>          Issue Type: Improvement
>    Affects Versions: 4.0
>            Reporter: Michael Wagner
>            Assignee: Thomas Fox
>
> It would be nice if the torque criteria api would support inserts with a given sub query like the following:
> INSERT INTO table_a (column_a, column_b, column_c)
>   SELECT
>     /* Literal number values with column aliases */
>     value_a AS column_a,
>     value_b AS column_b,
>     column_x
>   FROM table_b 
>   WHERE ...;



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org