An identifier with more than 30 characters was specified error message.

Table HOLDING_TABLE has one column named "HOLDER". I just want to insert a five character string into the column. The string I am inserting is the word "Smile". The column colder is 300 characters wide in length. Yet when the code is executed I get the error message shown at the bottom of this post. Does anyone know why I am getting this error, when both clearStr and the target column have enough characters define?

clearStr VARCHAR(100);

clearStr := 'INSERT INTO HOLDING_TABLE (HOLDER) VALUES(' || ''' Smile ''' || ')';

ORA-06512 at line 01
00972. 00000 - "identifier is too long";
*Cause: An identifier with more than 30 characters was specified.
*Action: Specifiy at most 30 characters.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Geert GOracle dbaCommented:
Why the concatenation ?

Open in new window

Mark GeerlingsDatabase AdministratorCommented:
No, I don't see an obvious error in what you posted, so I have two questions:
1. Are you sure that you posted the line(s) that generated this error?
2. Do you have to use "dynamic SQL", that is: constructing the text of the insert and "hard-coding" the value, then processing that with "execute immediate"?  That approach in Oracle PL\SQL has big performance and security disadvantages compared to using SQL statements with bind variables in PL\SQL.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
slightwv (䄆 Netminder) Commented:
I agree with Mark:  It works for me:
create table holding_table(holder varchar2(300));
clearstr varchar2(100);
clearStr := 'INSERT INTO HOLDING_TABLE (HOLDER) VALUES(' || ''' Smile ''' || ')';

select * from holding_table;

Open in new window

I also agree that you are doing things wrong.  You shouldn't need dynamic sql and execute immediate.

Tell us your requirement and we can help.
awking00Information Technology SpecialistCommented:
Can you post an example of what is in column HOLDER and what you expect it to be after the 'Smile' insert?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.