Skip to content

Numeric bind arguments #116

@NKame

Description

@NKame

In Oracle PL/SQL, you can use bind arguments with all kind of identifiers:
"At run time, bind arguments replace corresponding placeholders in the dynamic string. Every placeholder must be associated with a bind argument in the USING clause and/or RETURNING INTO clause. You can use numeric, character, and string literals as bind arguments, but you cannot use Boolean literals (TRUE, FALSE, and NULL)."

For instance, "SELECT a FROM b WHERE c = :1" fails with 0.9.3-SNAPSHOT.

I patched the grammar with:
JdbcNamedParameter JdbcNamedParameter() : {
JdbcNamedParameter parameter = new JdbcNamedParameter();
Token token;
}
{
LOOKAHEAD(2)
":" token=<S_IDENTIFIER> { parameter.setName(token.image); }
| ":" token=<S_LONG> { parameter.setName(token.image); }
{
return parameter;
}
}

I'm quite sure it's not the right way to do it, never done any JavaCC before.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions