sbyreddy
asked on
ORA-00972: identifier is too long
Hi EveryOne,
when i try to execute the below code it says,
ORA-00972: identifier is too long
at the lineadapter1.Fill(Ora_Data set)
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_DataSe t
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!!!
when i try to execute the below code it says,
ORA-00972: identifier is too long
at the lineadapter1.Fill(Ora_Data
CODE:
Sub BindGrid()
sSql=Select * from Audit_Exceptions where Audit_ID=+ sauditid + and TO_CHAR(Audit_Date,MM/DD/
adapter1=New OracleDataAdapter(sSql,Ora
adapter1.Fill(Ora_DataSet )
grid.DataSource=Ora_DataSe
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!!!
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+''' '
sSql='Select * from Audit_Exceptions where Audit_ID=''+ sauditid +'' and TO_CHAR(Audit_Date,'MM/DD/
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/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i think your sql should be in the form :
'Select * from Audit_Exceptions where Audit_ID=' + sauditid + 'and TO_CHAR(Audit_Date,''MM/DD
but the one you have pasted shows some non printable characters/control characters, hope they are not causing the issue.