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

Fixes for some weird type issues. #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jonheller1
Copy link

These changes fix some weird issues with different types. This doesn't help much with the data dictionary but it does help if anyone copies this program to make a more generic version of this method.

The list below are some simple test cases and the errors they produce with the original version of the program. After applying the changes these queries should work correctly.

--Do not need to directly grant all DBA_ views.
--ORA-00942: table or view does not exist
--ORA-06512: at "SYS.DBMS_SQL", line 1120
--ORA-06512: at "JHELLER.DLA_OT", line 18
--ORA-06512: at line 4
select * from table(dla_pkg.query_view(q'[select 1 a from dba_users]'));

--Long column name.
--ORA-00902: invalid datatype
select * from table(dla_pkg.query_view(q'[select 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1 from dba_users]'));

--BFLOAT.
--ORA-01405: fetched column value is NULL
select * from table(dla_pkg.query_view(q'[select 1f a from dba_users]'));

--BDOUBLE.
--ORA-01405: fetched column value is NULL
select * from table(dla_pkg.query_view(q'[select 1d a from dual]'));

--Float.
--ORA-06592: CASE not found while executing CASE statement
--ORA-06512: at "JHELLER.DLA_OT", line 151
select * from table(dla_pkg.query_view(q'[select cast(1 as float) a from dual]'));

--NVARCHAR2.
--ORA-06592: CASE not found while executing CASE statement
--ORA-06512: at "JHELLER.DLA_OT", line 151
select * from table(dla_pkg.query_view(q'[select 1 b, n'a' a from dual]'));

--Timestamp precision only goes to 6 instead of 9.
select * from table(dla_pkg.query_view(q'[select timestamp '2000-01-01 00:00:00.123456789' a from dual]'));

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.

1 participant