Q
Problem solve Get help with specific problems with your technologies, process and projects.

I get ORA-01401 error, my friend does not

I created a table and procedure. When I run it I get the ORA-01401 error. My friend who has Oracle 10g on Windows XP runs the procedure and does not get any error -- why?

I created a table:
create table test1 ( x char(2));
then created a procedure:
create or replace PROCEDURE STATISTIC_test(X_T char) AS

BEGIN
INSERT INTO TEST1( X ) VALUES ( X_T );
END STATISTIC_test;
When I run it it gives me this error:
ORA-01401: inserted value too large for column
ORA-06512: at "ITVUSER.STATISTIC_TEST", line 4
ORA-06512: at line 6
Process exited.
whereas my friend who has Oracle 10g on Windows XP runs the procedure and does not get any error -- why?
You did not show how you called the procedure. But I'd be willing to bet on the basis of the ORA-1401 error message that the parameter you passed to the procedure was more than two characters long. Your table has a column, X, defined to hold a maximum of two characters. You either need to redesign your table to hold more than two characters, or only pass in two characters (or less) in the procedure's parameter.

Dig Deeper on Oracle stored procedures

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close