db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kim Haase (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4208) Parameters ? with OFFSET and/or FETCH
Date Mon, 24 Aug 2009 23:26:59 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12747138#action_12747138
] 

Kim Haase commented on DERBY-4208:
----------------------------------

The doc looks fine, Dag, thanks! One line of code is long and runs over a line in the PDF,
making a line break that wouldn't work in real code:

PreparedStatement p = con.prepareStatement("SELECT * FROM T ORDER BY I OFFSET ? ROWS");

You might fix it like this:

PreparedStatement p = 
    con.prepareStatement("SELECT * FROM T ORDER BY I OFFSET ? ROWS");

This is optional if you don't want to bother -- people can probably figure it out.

> Parameters ? with OFFSET and/or FETCH
> -------------------------------------
>
>                 Key: DERBY-4208
>                 URL: https://issues.apache.org/jira/browse/DERBY-4208
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.5.1.1
>            Reporter: Steve Radman
>            Assignee: Dag H. Wanvik
>         Attachments: derby4208-docs-a.diff, derby4208a.diff, derby4208a.stat, derby4208b.diff,
derby4208b.stat, derby4208c.diff, derby4208c.stat
>
>
> The new OFFSET/FETCH syntax does not support Parameters. 
> From ij against the toursdb I would like to do the following:
>     ij> prepare foo as 'select * from cities offset ? rows fetch first 10 rows only';
> but results in the following syntax error: 
>     ERROR 42X01: Syntax error: Encountered "?" at line 1, column 29.
> Parameterized OFFSET/FETCH is important for performance (can be prepared) and security
(SQL strings not created on the fly).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message