Skip to Main Content

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Pauline.

Asked: March 19, 2002 - 1:06 pm UTC

Last updated: January 15, 2008 - 3:52 pm UTC

Version: 8.1.7.2

Viewed 1000+ times

You Asked

Tom,
We had problem with the long table name:

SQL> sho user
USER is "REF"
SQL> select table_name from user_tables;

TABLE_NAME
------------------------------
ACCOUNT_ADDR_USAGE_TYPES
ACCOUNT_ASSOC_TYPES
ACCOUNT_STATUSES
ACCOUNT_TRANSACTION_STATUSES
ACCOUNT_TRANSACTION_TYPES
ACCOUNT_TYPES
APPLICATIONS
BUSINESS_CODES
CATEGORY_DEPARTMENTS
CERTIFICATION_STATUS
CLIENT_SEGMENTS
COMPANIES
CONTACT_POINT_USAGE_TYPES
CURRENCIES
DEPARTMENTS
FUNCTIONS
GEOGRAPHIC_REGIONS
GEOGRAPHIC_REGION_TYPES
GEO_REGION_ROLLUPS
GEO_REGION_ROLLUP_TYPES
JOBS
LANGUAGES
LEGACY_OFFICE_DEPARTMENTS
MARKETING_SEGMENTS
OFFICES
OFFICE_DEPARTMENTS
PARTY_ACCOUNT_ROLES
PARTY_ASSOC_TYPES
PARTY_ASSOC_TYPE_GROUPS
PARTY_IDENTIFICATION_TYPES
PARTY_IMPORTANCE_LEVELS
PARTY_TYPES

TABLE_NAME
------------------------------
PAYMENT_CALC_METHOD
PAY_TERM_TYPES
PHONE_TYPES
PROCESSES
ROLES
ROLE_FUNCTIONS
STANDARD_HINT_QUESTIONS
TRIGGER_ERRORS

40 rows selected.


SQL> drop table ACCOUNT_TRANSACTION_STATUSES;
drop table ACCOUNT_TRANSACTION_STATUSES
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-01401: inserted value too large for column
ORA-06512: at line 22

SQL> drop table ref.jobs;

Table dropped.

We only may drop the table with shot name or use drop user username
cascade to drop the table with long name.

Is this a bug? What is the workaround for it.

Thanks for your help.

Pauline

and Tom said...

Is this a bug -- you betcha.

Its a bug in YOUR DDL trigger!!!

You have a trigger, it has at least 22 lines of code and on line 22 you are inserting the ora_dict_obj_name into an audit table. Audit table is too small to hold it. It fails. We fail.

Solution... Fix trigger or fix audit table.

Example:

ops$tkyte@ORA817DEV.US.ORACLE.COM> create table ACCOUNT_TRANSACTION_STATUSES ( x int );

Table created.

ops$tkyte@ORA817DEV.US.ORACLE.COM>
ops$tkyte@ORA817DEV.US.ORACLE.COM> drop table ACCOUNT_TRANSACTION_STATUSES;

Table dropped.

ops$tkyte@ORA817DEV.US.ORACLE.COM>
ops$tkyte@ORA817DEV.US.ORACLE.COM> create table ACCOUNT_TRANSACTION_STATUSES ( x int );

Table created.

ops$tkyte@ORA817DEV.US.ORACLE.COM>
ops$tkyte@ORA817DEV.US.ORACLE.COM> drop table log;
drop table log
*
ERROR at line 1:
ORA-00942: table or view does not exist


ops$tkyte@ORA817DEV.US.ORACLE.COM> create table log ( msg varchar2(20) );

Table created.

ops$tkyte@ORA817DEV.US.ORACLE.COM>
ops$tkyte@ORA817DEV.US.ORACLE.COM> create trigger ddl_trigger before drop on schema
2 begin
3 insert into log values ( ora_dict_obj_name );
4 end;
5 /

Trigger created.

ops$tkyte@ORA817DEV.US.ORACLE.COM>
ops$tkyte@ORA817DEV.US.ORACLE.COM> drop table ACCOUNT_TRANSACTION_STATUSES;
drop table ACCOUNT_TRANSACTION_STATUSES
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-01401: inserted value too large for column
ORA-06512: at line 2


ops$tkyte@ORA817DEV.US.ORACLE.COM>
ops$tkyte@ORA817DEV.US.ORACLE.COM> drop trigger ddl_trigger;

Trigger dropped.

ops$tkyte@ORA817DEV.US.ORACLE.COM>
ops$tkyte@ORA817DEV.US.ORACLE.COM> drop table ACCOUNT_TRANSACTION_STATUSES;

Table dropped.

ops$tkyte@ORA817DEV.US.ORACLE.COM>




Rating

  (15 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Excellent

Pauline, March 19, 2002 - 5:05 pm UTC

Tom,
It is amazing that you know everything. The workaround is really working.

Thank you so much!

Pauline

it's wonderfull.....

vis, March 19, 2002 - 10:33 pm UTC

Hi Tom,
It's really wonderful....Excellant..We are really as you said 'Betcha's...Do you know what is the meaning of Betcha in Hindi...Kids
Thanks
vis
USA

amazing

Vikas Sharma, March 20, 2002 - 1:42 am UTC

It's really wonderful ,Excellant.

"ORA-06512: at line 22" was the HINT. right? ;)

Yogeeraj, March 20, 2002 - 4:25 am UTC


Tom Kyte
March 20, 2002 - 11:31 am UTC

yes it was... the inserted value too large was the rest of the story...

Cool

Tomboy, April 13, 2002 - 7:38 am UTC


Vini, July 16, 2003 - 9:57 am UTC

Hi Tom,

I wants to create table with more than 32 of length. Then I got an error (in Ora 9i):

ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-01401: inserted value too large for column
ORA-06512: at line 6

How can I solve this?

Thank you very much.




Tom Kyte
July 16, 2003 - 10:44 am UTC

well, identifiers are limited to 30 characters.

but you give us no example.  I get this error myself:

ops$tkyte@ORA920LAP> create table t123456789012345678901234567890t ( x int );
create table t123456789012345678901234567890t ( x int )
             *
ERROR at line 1:
ORA-00972: identifier is too long

 

Vini, July 16, 2003 - 10:01 am UTC

Hi Tom,

I am sorry, I did a mistake in earlier message. I wants to create table with lengthy Names as more than 32 characters.

I got an error :
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-01401: inserted value too large for column
ORA-06512: at line 6

Please could you explain how reach for this.

Thanks

A limit is a limit

Jim, July 16, 2003 - 12:59 pm UTC

The length of table names is limited which means you cannot create a table name longer than the limit. That is what the error message is telling you.

Vini, July 17, 2003 - 5:11 am UTC

Hi Tom,

You are correct. My above mensioned error message comes from my another trigger (tracking create objects..)

Now I corrected it, Thanks.

As Jim told "LIMIT IS LIMIT", I know that. But I am asking Is there any possibility (Before creating Database.. ) set the length of name in sys.obj$ and other correspondents.

Please tell me is there any posility?

Tom Kyte
July 17, 2003 - 10:36 am UTC

no, there is not

Why?

oraclelover, June 28, 2004 - 5:40 am UTC

SQL> drop user test cascade;
drop user test cascade
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-00942: table or view does not exist
ORA-06512: at line 7 

Tom Kyte
June 28, 2004 - 8:30 am UTC

look for a system event trigger one of your guys wrote.


ops$tkyte@ORA9IR2> create or replace trigger test before drop on database
  2  declare
  3          l_n number;
  4  begin
  5          null;
  6          null;
  7          null;
  8          execute immediate 'select 1 from tafdafa' into l_n;
  9  end;
 10  /
 
Trigger created.
 
ops$tkyte@ORA9IR2>
ops$tkyte@ORA9IR2> drop user a cascade;
drop user a cascade
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-00942: table or view does not exist
ORA-06512: at line 7
 
 
ops$tkyte@ORA9IR2> drop trigger test;
 
Trigger dropped.
 
ops$tkyte@ORA9IR2> drop user a cascade;
 
User dropped.
 

strange problem with a table name

Matthias Rogel, January 15, 2008 - 3:15 pm UTC

Hallo Tom

today I encountered a strange Exception

sql > select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bi
PL/SQL Release 10.2.0.2.0 - Production
CORE    10.2.0.2.0      Production
TNS for Linux: Version 10.2.0.2.0 - Production
NLSRTL Version 10.2.0.2.0 - Production

sql > select * from ";
ERROR:
ORA-00972: identifier is too long

 
WHICH identifier ?
it seems like a bug to me
shouldn't ORA-01740 be raised instead of ORA-00972 ?

Thank you

Tom Kyte
January 15, 2008 - 3:52 pm UTC

that would be a sqlplus issue - apparently

I ran:

ops$tkyte%ORA10GR2> alter session set events '10046 trace name context forever, level 12';

Session altered.

ops$tkyte%ORA10GR2>
ops$tkyte%ORA10GR2> select /*+ lookforme plus */ * from "
  2
ops$tkyte%ORA10GR2> /
ERROR:
ORA-00972: identifier is too long


ops$tkyte%ORA10GR2> begin
  2          for x in (select * from ")
  3          loop
  4          null;
  5          end loop;
  6  end;
  7  /
ERROR:
ORA-01740: missing double quote in identifier


ops$tkyte%ORA10GR2> declare
  2          l_x long;
  3  begin
  4          execute immediate 'select /*+ lookforme plsql */ * from "' into l_x;
  5  end;
  6  /
declare
*
ERROR at line 1:
ORA-01740: missing double quote in identifier
ORA-06512: at line 4



and the sqlplus query never makes it to the server, even if I do trace_level_client=16, I only see the plsql queries making it over


so, it might be a small parse issue with sqplus trying to be "too smart"

thanks for quick ad complete analysis

Matthias Rogel, January 15, 2008 - 4:27 pm UTC


I've never seen these hints

Chuck Jolley, January 16, 2008 - 11:34 am UTC

I've never seen these hints:

/*+ lookforme plus */
/*+ lookforme plsql */

What are they for?

no hints

Sokrates, January 16, 2008 - 2:30 pm UTC

Chuck Jolley:
they are no hints but comments
in this case marker comments so that we can identify the statement in trace file

no hints

Sokrates, January 16, 2008 - 2:30 pm UTC

Chuck Jolley:
they are no hints but comments
in this case marker comments so that we can identify the statement in trace file

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library