File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Oracle/OAS and the fly likes ORA-00972: identifier is too long at select statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "ORA-00972: identifier is too long at select statement" Watch "ORA-00972: identifier is too long at select statement" New topic

ORA-00972: identifier is too long at select statement

Santosh Kumar

Joined: Jan 03, 2002
Posts: 28
can anybody tell me why am i getting this exception while selct query.My table name is focused_Inventory_Unit_type(it is 27 character long).But according to me table name can be 30 characters long maximum.
Columns name are
I dont think even column names are too long.
So can u tell me what else can be the reason.
below i am pasting the exception i am getting.
santosh kumar
java.sql.SQLException: ORA-00972: identifier is too long
at oracle.jdbc.dbaccess.DBError.throwSqlException(
at oracle.jdbc.ttc7.TTIoer.processError(
at oracle.jdbc.ttc7.Oall7.receive(
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(
at com.softbrands.destiny.fitterMain.FocussedInventory.getHotelRoomTierData(
at com.softbrands.destiny.fitterMain.DobseDAO.assignToSummaryItem(
at com.softbrands.destiny.fitterMain.DobseDAO.getItemProcessList(
at com.softbrands.destiny.fitterMain.DobseSBBean.ExecuteFitterFinder(
at com.softbrands.destiny.fitterMain._sk_DestinyEJB_DobseFitterBean.invoke(
at Method)
at com.sybase.CORBA.local.OutputStream.write(
at com.sybase.CORBA.iiop.Connection.invoke(
at com.softbrands.destiny.fitterMain.DobseSBRemote_Stub.ExecuteFitterFinder(
at com.softbrands.destiny.fitterMain.DobseClient.getOfferList(
at com.sybase.jsp.destiny_0005fswp_0005fOffers$jsp._jspService(destiny_0005fswp_0005fOffers$
at org.apache.jasper.runtime.HttpJspBase.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(
at org.apache.jasper.servlet.JspServlet.serviceJspFile(
at org.apache.jasper.servlet.JspServlet.service(
at javax.servlet.http.HttpServlet.service(
2003-04-18 21:41:07,154 DEBUG [com.softbrands.destiny.fitterMain.DobseDAO] (sortFocussedInventoryArrays:5590) -

Santoh Kumar<br /> India<br />SCJP 1.4 <br />SCWCD 1.4
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

I know it is only 29 characters, but here is the Oracle documentation on the ORA-0972 error
Oracle Product Document Library (C) Oracle Corporation
Manual: Database Error Reference: A90202-02

ORA-00972 identifier is too long
Cause: The name of a schema object exceeds 30 characters. Schema objects are tables, clusters, views, indexes, synonyms, tablespaces, and usernames.
Action: Shorten the name to 30 characters or less.

Hope that helps.

Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
Carl Trusiak

Joined: Jun 13, 2000
Posts: 3340
Try printing the actually string for your PreparedStatement. It could be getting formatted wrong resulting in the error. If a name is too long, Oracle doesn't check to see if it's a valid name to give the "Invalid Column Name" or the "Invalid Table Name" Errors.

I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Chris Fellows

Joined: Jan 26, 2006
Posts: 1
Had this same issue an Oracle9i db. End problem was misnaming columns in my sql.

ex. insert into aTable (ACTIVE_FLAG) values ('Y')

instead of insert into aTable(ACTIVEFLAG) values ('Y')

small difference but nothing to do with incorrectly named table, sequence, etc.
Philip Thamaravelil
Ranch Hand

Joined: Feb 09, 2006
Posts: 99
You will also see this exception when performing sql inserts/updates with (") instead of (') encapsulating your varchar column values.

Good luck.
I agree. Here's the link:
subject: ORA-00972: identifier is too long at select statement
It's not a secret anymore!