You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ruby-plsql 0.8.0 / Oracle 19c: "No PL/SQL procedure or variable 'VERSION' found" when accessing plsql.dbms_db_version.version #207
When we try to access the constant version in package sys.dbms_db_version, ruby-plsql bails out with
No PL/SQL procedure or variable 'VERSION' found
package.rb:83:in `method_missing'
The cause seems to be a change in the source code of sys.dbms_db_version in combination with the way plsql-ruby tries to identify variables and constants. variable.rb selects all rows from all_source that match the variable name and then verifies the variable with a regex. The regex assumes that the variable declaration ends with a semicolon on the same line.
Unfortunately, this fails if the assignment to the variable is wrapped to the next line. This is exactly what changed in sys.dbms_db_version between 12 and 19:
SELECT * FROM all_source WHERE owner = 'SYS' AND name = 'DBMS_DB_VERSION' AND type = 'PACKAGE';
-- Oracle 12:
package dbms_db_version is
version constant pls_integer := 12; -- RDBMS version number
release constant pls_integer := 2; -- RDBMS release number
-- Oracle 19:
package dbms_db_version is
version constant pls_integer :=
19; -- RDBMS version number
release constant pls_integer := 0; -- RDBMS release number
An easy fix would be to make the semicolon at the end of the line optional. I can create a PR if that's acceptable.
changed the title [-]Oracle 19c: "No PL/SQL procedure or variable 'VERSION' found" when accessing plsql.dbms_db_version.version[/-][+]ruby-plsql 0.8.0 / Oracle 19c: "No PL/SQL procedure or variable 'VERSION' found" when accessing plsql.dbms_db_version.version[/+]on Oct 12, 2021
Activity
[-]Oracle 19c: "No PL/SQL procedure or variable 'VERSION' found" when accessing plsql.dbms_db_version.version[/-][+]ruby-plsql 0.8.0 / Oracle 19c: "No PL/SQL procedure or variable 'VERSION' found" when accessing plsql.dbms_db_version.version[/+]Add failing test for multiline constant declaration (rsim#207)
Fix multiline constant declaration in packages (rsim#207)
Fix multiline constant declaration in packages (rsim#207)
Fix multiline constant declaration in packages (rsim#207)
Fix multiline constant declaration in packages (rsim#207)
Fix multiline constant declaration in packages (rsim#207)
Fix multiline constant declaration in packages (rsim#207)
Merge pull request #264 from yahonda/fix-multiline-variable-declaration
Fix multiline constant declaration in packages (rsim#207)