Manish Pansiniya's Blog

.NET, C#, Javascript, ASP.NET and lots more…:)

ORA-06502: PL/SQL: numeric or value error: character string buffer too small – Solution

with 5 comments

We get following error while executing insert procedure of oracle which inserts record and return primary key.

ERROR: ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at line 1

Just in our case, issue is we didn’t given the size of output oracle parameter when assigned to command.

param = New OracleParameter(“p_sh_behavior_seq”, OracleDbType.Long)
param.Value = m_sh_behavior_seq
param.Direction = ParameterDirection.Output
param.Size = 9
cmdOracle.Parameters.Add(param)

And it works!!!

Advertisements

Written by Manish

May 16, 2007 at 11:06 am

Posted in Uncategorized

5 Responses

Subscribe to comments with RSS.

  1. Thanks for the hint. MS Oracle Adapter did this on it’s own.

    Stefan Jope

    July 31, 2008 at 11:20 am

  2. I have given the size of paramter, still
    getting the same error.Do you have any other
    solution or can give me a hint, why this is
    not working at my end?

    NetDeveloper

    October 14, 2008 at 8:00 am

    • Because Oracle is shitty that’s why

      devvvy

      June 29, 2009 at 8:39 am

  3. thank u! it worked for me.

    kesh

    August 14, 2009 at 1:48 pm

  4. It worked for me too. Thank you very much!

    Borja

    May 28, 2010 at 6:18 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: