db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Fox (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TORQUE-305) Do insert with a select subquery
Date Sun, 15 Dec 2013 16:43:07 GMT

    [ 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


Mime
View raw message