Skip to content

[PARSING] plsql varaibles with $ and # #822

Closed

Description

@sosoba

Describe the bug
Use variable with the characters $ or # a in the name. Example:

select :a$# from dual;

Expected behavior
Pass

Actual behavior
Parse error: Unexpected "$# from du" at line 1 column 12. SQL dialect used: "plsql".

Usage

  • How are you calling / using the library? Playground
  • What SQL language(s) does this apply to? plsql
  • Which SQL Formatter version are you using? 15.4.9

Activity

  1. nene commented on Jan 14, 2025

    @nene
    Collaborator

    Thanks for reporting.

    Could you point me to the documentation that describes the syntax of these variables in PL/SQL? I haven't been able to find this info by myself. The best I've managed to find is this page but it doesn't describe the syntax, only the usage.

  2. sosoba commented on Jan 14, 2025

    @sosoba
    Author

    I searched for a long time and couldn't find anything better than the chapter 5.3.1 Rules for Placeholder on your site.

  3. nene commented on Jan 14, 2025

    @nene
    Collaborator

    Yeah, but this section says nothing about $ and # characters.

  4. sosoba commented on Jan 15, 2025

    @sosoba
    Author

    Yeah, but this section says nothing about $ and # characters.

    You have right.
    There is also:
    Placeholder-Expressions
    Database-Object-Names-and-Qualifiers.
    The second says:

    Nonquoted identifiers can only contain alphanumeric characters from your database character set and the underscore (_), dollar sign ($), and pound sign (#). Database links can also contain periods (.) and "at" signs (@).

  5. nene commented on Jan 25, 2025

    @nene
    Collaborator

    Sorry for the delay on this. I don't have means to test this myself with Oracle, so I just take your word for it.

    Looks like I had explicitly turned the support of these characters off in parameter names, because the documentation said so.

  6. nene commented on Jan 25, 2025

    @nene
    Collaborator

    Fixed in 15.4.10

  7. added a commit that references this issue on Jan 25, 2025
    4eb0193
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions