db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4208) Parameters ? with OFFSET and/or FETCH
Date Tue, 07 Jul 2009 22:49:14 GMT

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

Dag H. Wanvik commented on DERBY-4208:

Thanks for looking at the patch, Rick, I am still learning how to best
go about the code generation in non-trivial cases..

> I would recommend tracking down how we handle ? in a statement like
>  "select * from t where a = ?".

Actually, thats how I found the pattern to make to it work at all; I
did look at the restrict generated code, cf. here:


which does pass in specially generated methods to the result set, and
also see the usage of these generated methods:

    ProjectRestrictResultSet.openCore: constantRestriction.invoke and
    ProjectRestrictResultSet.getNextRowCore: restriction.invoke

so I don't yet understand how this particular usage of ? would lead me to a

I could probaby mimic the constantRestriction handling for the
constant, but I'm can't yet see how that would simplify things, if
anything that's an overkill, because in our case, we only allow
literals for the constant case.

I'll read some more code.. ;)

> 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:
>            Reporter: Steve Radman
>         Attachments: derby4208a.diff, derby4208a.stat, derby4208b.diff, derby4208b.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.

View raw message