You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2017/03/21 18:08:41 UTC

[jira] [Updated] (CALCITE-664) Parameterized DML and DDL

     [ https://issues.apache.org/jira/browse/CALCITE-664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Hyde updated CALCITE-664:
--------------------------------
    Description: 
The JDBC spec allows DML statements to have parameters and seems to allow DDL (e.g. CREATE TABLE AS SELECT) to have them too. Currently Avatica only allows queries to be parameterized.

This implies that you can do Connection.prepareStatement on query, DML, DDL, and it would tell you the number and types of parameters. Then you can bind, and execute using PreparedStatement.executeQuery(), execute(), executeUpdate(). (Note - there are versions of these methods in Statement which take a String parameter. You can't use those.)

See discussion http://mail-archives.apache.org/mod_mbox/calcite-dev/201503.mbox/%3CCANZa%3DGsJUJToo4cdygguv8h5h2XjK3eD3oP5-k6rSPvm9qTYZg%40mail.gmail.com%3E and PHOENIX-971.

  was:
The JDBC spec allows DML statements to have parameters and seems to allow DDL (e.g. CREATE TABLE AS SELECT) to have them too. Currently Avatica only allows queries to be parameterized.

This implies that you can do Connection.prepareStatement on query, DML, DDL, and it would tell you the number and types of parameters. Then you can bind, and execute using PreparedStatement.executeQuery(), execute(), executeUpdate(). (Note - there are versions of these methods in Statement which take a String parameter. You can't use those.)

See discussion http://mail-archives.apache.org/mod_mbox/incubator-calcite-dev/201503.mbox/%3CCANZa%3DGsJUJToo4cdygguv8h5h2XjK3eD3oP5-k6rSPvm9qTYZg%40mail.gmail.com%3E and PHOENIX-971.


> Parameterized DML and DDL
> -------------------------
>
>                 Key: CALCITE-664
>                 URL: https://issues.apache.org/jira/browse/CALCITE-664
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Julian Hyde
>
> The JDBC spec allows DML statements to have parameters and seems to allow DDL (e.g. CREATE TABLE AS SELECT) to have them too. Currently Avatica only allows queries to be parameterized.
> This implies that you can do Connection.prepareStatement on query, DML, DDL, and it would tell you the number and types of parameters. Then you can bind, and execute using PreparedStatement.executeQuery(), execute(), executeUpdate(). (Note - there are versions of these methods in Statement which take a String parameter. You can't use those.)
> See discussion http://mail-archives.apache.org/mod_mbox/calcite-dev/201503.mbox/%3CCANZa%3DGsJUJToo4cdygguv8h5h2XjK3eD3oP5-k6rSPvm9qTYZg%40mail.gmail.com%3E and PHOENIX-971.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)