Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum length of a table name in Oracle NONQUOTED_OBJECT_NAME #2423

Open
Faq opened this issue Jan 29, 2025 · 0 comments
Open

Maximum length of a table name in Oracle NONQUOTED_OBJECT_NAME #2423

Faq opened this issue Jan 29, 2025 · 0 comments

Comments

@Faq
Copy link

Faq commented Jan 29, 2025

This looks outdated:
https://github.com/rsim/oracle-enhanced/blob/master/lib/active_record/connection_adapters/oracle_enhanced/quoting.rb#L40

In Oracle 12.2 and above the maximum object name length is 128 bytes.

In Oracle 12.1 and below the maximum object name length is 30 bytes.
Source https://stackoverflow.com/questions/756558/what-is-the-maximum-length-of-a-table-name-in-oracle

For 19c NONQUOTED_OBJECT_NAME constant with regex prevented connection to the table with the name length more than 30 bytes, and returned default defined ORA-04043 error.
Had to use this in initializer:

module ActiveRecord
    module ConnectionAdapters
      module OracleEnhanced
        module Quoting
          NONQUOTED_OBJECT_NAME = /[A-Za-z][A-z0-9$#]{0,127}/
          VALID_TABLE_NAME = /\A(?:#{NONQUOTED_OBJECT_NAME}\.)?#{NONQUOTED_OBJECT_NAME}(?:@#{NONQUOTED_DATABASE_LINK})?\Z/
        end
      end
    end
  end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant