# DBMS\_JAVA requirement for schema browser table columns

**URL:** <https://forums.toadworld.com/t/dbms-java-requirement-for-schema-browser-table-columns/58275>\
**Category:** Toad for Oracle - Beta\
**Created:** [October 5, 2023, 9:39pm UTC](https://forums.toadworld.com/t/dbms-java-requirement-for-schema-browser-table-columns/58275 "2023-10-05T21:39:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rjesse](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/rjesse/32/156_2.png) [@rjesse](https://forums.toadworld.com/u/rjesse)\
**Post date:** [October 5, 2023, 9:39pm UTC](https://forums.toadworld.com/t/dbms-java-requirement-for-schema-browser-table-columns/58275/1 "2023-10-05T21:39:38Z")

</div>

Howdy!

In 17.0.294.1777, I'm seeing occasional `ORA-00904 "SYS"."DBMS_JAVA"."LONGNAME": invalid identifier` errors in the SB/Tables-\>Columns tab.

Our standard is to lock down that package since the zero-day in Oracle 11.2... ☹ This would be per [CIS Oracle Server 19c DB Unified Auditing v1.1.0 | Tenable®](https://www.tenable.com/audits/CIS_Oracle_Server_19c_v1.1.0_L1_Database_Unified) and the accompanying CIS link that I don't have a login to access.

Thoughts?

Thanks!  
Rich

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [October 5, 2023, 9:52pm UTC](https://forums.toadworld.com/t/dbms-java-requirement-for-schema-browser-table-columns/58275/2 "2023-10-05T21:52:02Z")

</div>

Hi Rich,

When a connection is first made, in the giant pl/sql block that Toad runs, we select from ALL\_OBJECTS looking for DBMS\_JAVA and DBMS\_DEBUG. So if they aren't found due to lack of privs, Toad won't use them.

That said, the places we might use DBMS\_JAVA.LONGNAME are:

on F4, when trying to figure out what you've F4'd on.  
in SB, if you go to Java tab  
SB RHS Grants tab of java objects  
SB RHS script tab of java objects

If you can post the SQL that you're seeing next time it happens, I can tell you exactly where it comes from. But I don't know why you're seeing it in SB/Table-Columns.

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [October 5, 2023, 9:58pm UTC](https://forums.toadworld.com/t/dbms-java-requirement-for-schema-browser-table-columns/58275/3 "2023-10-05T21:58:16Z")

</div>

I see that some of these places in our source reference dbms\_java.longname even if our prior query to all\_object said you don't have it.

I'll log this to go through it carefully tomorrow/next week.

-John

---

<div class="post-metadata">

**Author:** ![rjesse](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/rjesse/32/156_2.png) [@rjesse](https://forums.toadworld.com/u/rjesse)\
**Post date:** [October 5, 2023, 10:05pm UTC](https://forums.toadworld.com/t/dbms-java-requirement-for-schema-browser-table-columns/58275/4 "2023-10-05T22:05:37Z")

</div>

I'll grab the Spool for you tonight or tomorrow. Right now, it's BurgerTime™ (the food, not the '80s arcade game).

Thanks John!

---

<div class="post-metadata">

**Author:** ![rjesse](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/rjesse/32/156_2.png) [@rjesse](https://forums.toadworld.com/u/rjesse)\
**Post date:** [October 5, 2023, 11:51pm UTC](https://forums.toadworld.com/t/dbms-java-requirement-for-schema-browser-table-columns/58275/5 "2023-10-05T23:51:36Z")

</div>

Here's what causes the error:

```auto
-- Timestamp: 18:38:52.848
Select o.*, SYS.DBMS_JAVA.LONGNAME(OBJECT_NAME) longname
from sys.DBA_OBJECTS o
where o.owner = :own
and o.object_type = 'JAVA SOURCE'
and o.object_name = :OneObjectName
order by o.object_name;
-- ORA-00904: "SYS"."DBMS_JAVA"."LONGNAME": invalid identifier
:own(VARCHAR[2],IN)='RR' 
:OneObjectName(VARCHAR[17],IN)='RRR#RRRRRRRRR#RRR' 
-- Elapsed Time: 0.332 seconds
-- Rows fetched: 0

```

I guess the weird thing is that the :OneObjectName object is a trigger (of course the object names have been obfuscated). I replaced the letters and numbers with "R", but left the "#" in where it appears in the actual object name (_not_ my idea to have that character in an object name).

Let me know if there's more info needed!

Thanks!  
Rich

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [October 6, 2023, 1:21am UTC](https://forums.toadworld.com/t/dbms-java-requirement-for-schema-browser-table-columns/58275/6 "2023-10-06T01:21:48Z")

</div>

I see what's happening.

First of all, we should not be running this query at that time (longname or no longname). So that's a bug right there. It's running when we try to load the script for a trigger. I'll make a change to fix that tomorrow.

If you uncheck Options -\> Schema Browser -\> Data Tab -\> Highlight columns populated by sequence/trigger pair, then it won't run, unless you go to the SB-Tables-RHS triggers tab.

But the interesting thing is that we _are_ checking our internal HasJava property, which means that DBMS\_JAVA is in all\_objects for you, which - I would think - would let you call dbms\_java.longname. Because the ALL\_ views are all about privileges, right? Weird.

_Edit_: I see what's wrong with that too. We're actually querying DBA\_OBJECTS in that pl/sql block when a connection is first made. Can you find it? It was sneaky. 🤦🏻‍♂️

-John

---

<div class="post-metadata">

**Author:** ![rjesse](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/rjesse/32/156_2.png) [@rjesse](https://forums.toadworld.com/u/rjesse)\
**Post date:** [October 6, 2023, 12:49pm UTC](https://forums.toadworld.com/t/dbms-java-requirement-for-schema-browser-table-columns/58275/7 "2023-10-06T12:49:26Z")

</div>

The "Highlight columns..." toggle does the trick! A Toad option I'm reasonably comfortable saying I have not used in the past 23+ years. 😃

This issue doesn't actually affect me personally because I'll just grant execute on DBMS\_JAVA to my personal user. 😇 I'm thinking down the road to GA, where my users will start hitting it and I'll get the support tickets.

Ahh, were you catching the public synonym in the ALL\_ view???

Rich

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [October 6, 2023, 1:20pm UTC](https://forums.toadworld.com/t/dbms-java-requirement-for-schema-browser-table-columns/58275/8 "2023-10-06T13:20:39Z")

</div>

> [@rjesse](#):
>
> Ahh, were you catching the public synonym in the ALL\_ view???

I was building some SQL text using all\_objects with the intent of running it using execute immediate, but at the last second, I ran the string through a proc that swaps out all\_objects for dba\_objects if the user can select from dba\_objects. Good way to see if the package exists. Not so good for seeing if the user can execute it.
