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
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.
The text was updated successfully, but these errors were encountered:
joschug
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
Oct 12, 2021
When we try to access the constant
version
in packagesys.dbms_db_version
, ruby-plsql bails out withThe 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 fromall_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: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.
The text was updated successfully, but these errors were encountered: