We help IT Professionals succeed at work.

ORA-00972: identifier is too long

1,395 Views
Last Modified: 2012-06-27
Hi EveryOne,
when i try to execute the below code it says,
ORA-00972: identifier is too long
at the lineadapter1.Fill(Ora_Dataset)

CODE:
Sub BindGrid()
sSql=Select * from Audit_Exceptions where Audit_ID=+ sauditid + and TO_CHAR(Audit_Date,MM/DD/YYYY)= +sauditdate + and Exception_Status=+ exceptionStatus+

adapter1=New OracleDataAdapter(sSql,Ora_Conn)
adapter1.Fill(Ora_DataSet )
grid.DataSource=Ora_DataSet
grid.DataBind()
EndSub

I checked the name of the table and Columns , but all are less than 30 characters
When i selected the values in dropdownlist and click a button(which is that page below the dropdownlists) it shows me this error!

where auditdate has a DATE datatype
Auditid has Number datatype
Exceptionstatus has varchar datatype

When i keep break points on this code and whenevr the SQL stmt shows values in watch window i just copied the statement and executed in SQL Plus
it gave me the result rows.
I tried every possibility,by creating a new table again and changing the column names.But still it didn't wrk!!!
Comment
Watch Question

Naveen KumarProduction Manager / Application Support Manager
CERTIFIED EXPERT

Commented:
is the value whatever coming in this "sauditdate " is in the format 'MM/DD/YYYY'

i think your sql should be in the form :
'Select * from Audit_Exceptions where Audit_ID=' + sauditid + 'and TO_CHAR(Audit_Date,''MM/DD/YYYY'')= ' +sauditdate + '  and Exception_Status= '+ exceptionStatus

but the one you have pasted shows some non printable characters/control characters, hope they are not causing the issue.
Guy Hengel [angelIII / a3]Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009

Commented:
if this is what you have:
sSql='Select * from Audit_Exceptions where Audit_ID=''+ sauditid +'' and TO_CHAR(Audit_Date,'MM/DD/YYYY')= ''+sauditdate +'' and Exception_Status=''+ exceptionStatus+'''

you will need some quotes to be added/removed:

sSql='Select * from Audit_Exceptions where Audit_ID='+ sauditid +' and TO_CHAR(Audit_Date,'MM/DD/YYYY')= '''+sauditdate +''' and Exception_Status= '''+ exceptionStatus+''' '
Database Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Naveen KumarProduction Manager / Application Support Manager
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.