Skip to content

Improve 18c support#208

Open
joschug wants to merge 20 commits intorsim:masterfrom
joschug:dev
Open

Improve 18c support#208
joschug wants to merge 20 commits intorsim:masterfrom
joschug:dev

Conversation

@joschug
Copy link
Copy Markdown

@joschug joschug commented Oct 27, 2021

This fixes #204, #207 and probably #200.

  • Resolve type synonyms
  • Support cross-schema type references
  • Added support for package types declared as %ROWTYPE
  • Added support for %ROWTYPE as procedure parameter
  • Exclude hidden columns from table types
  • Remap TIMESTAMP(n) WITH LOCAL TIMEZONE to TIMESTAMP WITH LOCAL TIMEZONE
  • Remap PL/SQL PLS/BINARY INTEGER to PLS_INTEGER/BINARY_INTEGER

# Conflicts:
#	lib/plsql/procedure.rb
"timestamp(6) with local timezone"; before 18c, this was represented as
"timestamp with local timezone"
# Conflicts:
#	lib/plsql/procedure.rb
@yahonda
Copy link
Copy Markdown
Collaborator

yahonda commented May 12, 2023

Could you please break this pull request into smaller pieces?

@Faq
Copy link
Copy Markdown

Faq commented Aug 23, 2024

Using this for a year with Rails 5.2 and 18c, now upgraded Rails to v7.0, still works.

@yahonda
Copy link
Copy Markdown
Collaborator

yahonda commented Apr 13, 2026

Thank you for this contribution. There are several valuable fixes here for Oracle 18c and later.

To make it easier to review and merge, we are splitting the changes into smaller, focused pull requests with tests:

  • Exclude hidden columns from table type field definitions
  • Remap TIMESTAMP(n) WITH LOCAL TIME ZONE to TIMESTAMP WITH LOCAL TIME ZONE
  • Use type_owner instead of schema_name for cross-schema type references

We will reference this PR from each one.

yahonda added a commit to yahonda/ruby-plsql that referenced this pull request Apr 13, 2026
Oracle 18c and later reports the data type as "TIMESTAMP(6) WITH
LOCAL TIME ZONE" in ALL_TAB_COLS, whereas older versions used
"TIMESTAMP WITH LOCAL TIME ZONE". Normalize to the standard form
to avoid type conversion errors.

Based on rsim#208

Co-Authored-By: Jochen Schug <4573581+joschug@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
yahonda added a commit to yahonda/ruby-plsql that referenced this pull request Apr 13, 2026
When querying ALL_TAB_COLS for table/view type parameters, hidden
columns (e.g., those created by functional indexes) were included
in the field definitions. Filter them out with hidden_column != 'YES'.

Based on rsim#208

Co-Authored-By: Jochen Schug <4573581+joschug@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
yahonda added a commit to yahonda/ruby-plsql that referenced this pull request Apr 13, 2026
The get_field_definitions and get_element_definition methods used
@schema_name when querying type metadata from ALL_PLSQL_TYPE_ATTRS,
ALL_TAB_COLS, ALL_PLSQL_COLL_TYPES, and ALL_COLL_TYPES. This fails
when a procedure parameter references a type owned by a different
schema. Use argument_metadata[:type_owner] instead.

Based on rsim#208

Co-Authored-By: Jochen Schug <4573581+joschug@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
yahonda added a commit to yahonda/ruby-plsql that referenced this pull request Apr 13, 2026
Use ALL_TAB_COLUMNS instead of ALL_TAB_COLS when querying column
definitions for table/view type parameters. ALL_TAB_COLUMNS excludes
hidden columns (e.g., those created by functional indexes) by default,
and is available in all supported Oracle versions including 11g.

Based on rsim#208

Co-Authored-By: Jochen Schug <4573581+joschug@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
yahonda added a commit to yahonda/ruby-plsql that referenced this pull request Apr 13, 2026
Use ALL_TAB_COLUMNS instead of ALL_TAB_COLS when querying column
definitions for table/view type parameters. ALL_TAB_COLUMNS excludes
hidden columns (e.g., those created by functional indexes) by default,
and is available in all supported Oracle versions including 11g.

Based on rsim#208

Co-Authored-By: Jochen Schug <4573581+joschug@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
yahonda added a commit to yahonda/ruby-plsql that referenced this pull request Apr 13, 2026
Use ALL_TAB_COLUMNS instead of ALL_TAB_COLS when querying column
definitions for table/view type parameters. ALL_TAB_COLUMNS excludes
hidden columns (e.g., those created by functional indexes) by default,
and is available in all supported Oracle versions including 11g.

Based on rsim#208

Co-Authored-By: Jochen Schug <4573581+joschug@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
yahonda added a commit to yahonda/ruby-plsql that referenced this pull request Apr 13, 2026
Use ALL_TAB_COLUMNS instead of ALL_TAB_COLS when querying column
definitions for table/view type parameters. ALL_TAB_COLUMNS excludes
hidden columns (e.g., those created by functional indexes) by default,
and is available in all supported Oracle versions including 11g.

Based on rsim#208

Co-Authored-By: Jochen Schug <4573581+joschug@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
yahonda added a commit to yahonda/ruby-plsql that referenced this pull request Apr 13, 2026
Use ALL_TAB_COLUMNS instead of ALL_TAB_COLS when querying column
definitions for table/view type parameters. ALL_TAB_COLUMNS excludes
hidden columns (e.g., those created by functional indexes) by default,
and is available in all supported Oracle versions including 11g.

Based on rsim#208

Co-Authored-By: Jochen Schug <4573581+joschug@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
yahonda added a commit to yahonda/ruby-plsql that referenced this pull request Apr 13, 2026
Temporarily revert to ALL_TAB_COLS (without hidden column filter)
to confirm the new test detects hidden columns. If the test fails,
the fix (switching to ALL_TAB_COLUMNS) is validated.

Based on rsim#208

Co-Authored-By: Jochen Schug <4573581+joschug@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
yahonda added a commit to yahonda/ruby-plsql that referenced this pull request Apr 13, 2026
Use ALL_TAB_COLUMNS instead of ALL_TAB_COLS when querying column
definitions for table/view type parameters. ALL_TAB_COLUMNS excludes
hidden columns (e.g., those created by functional indexes) by default,
and is available in Oracle 11g and newer.

Based on rsim#208

Co-Authored-By: Jochen Schug <4573581+joschug@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

ruby-plsql 0.8.0: Procedure with parameters referencing system packages fails

3 participants