Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9296221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T21:47:10+00:00 2026-06-18T21:47:10+00:00

Problem: Trying to call a packaged stored procedure, but the call is failing depending

  • 0

Problem:
Trying to call a packaged stored procedure, but the call is failing depending on the values of the parameters.

ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 1

Procedure Definition:

procedure DUP_EXACT (
    SSN in VARCHAR2, 
    LASTNAME in VARCHAR2, 
    FIRSTNAME in VARCHAR2, 
    MASTERRECORD IN VARCHAR2 DEFAULT NULL,
    C_Table out sp_cursor)

Parameter Creation:

    For Each SearchParameter In SearchParameters
        ValueParameter = New OracleParameter

        ValueParameter.Direction = ParameterDirection.Input
        ValueParameter.OracleDbType = OracleDbType.Varchar2
        ValueParameter.ParameterName = SearchParameter.ParameterFieldName

        If Not SearchParameter.TransformedFieldValue = Nothing Then
            ValueParameter.Value = SearchParameter.TransformedFieldValue
        Else
            ValueParameter.Value = String.Empty
        End If

        ExactMatchSearchParameters.Add(ValueParameter)
    Next

    Dim MasterRecordParameter As New OracleParameter()

    MasterRecordParameter.Direction = ParameterDirection.Input
    MasterRecordParameter.OracleDbType = OracleDbType.Varchar2
    MasterRecordParameter.ParameterName = "MASTERRECORD"
    MasterRecordParameter.Value = DBNull.Value

    ExactMatchSearchParameters.Add(MasterRecordParameter)

    Dim TableParameter As New OracleParameter

    TableParameter.ParameterName = "C_Table"
    TableParameter.OracleDbType = OracleDbType.RefCursor
    TableParameter.Direction = ParameterDirection.Output

    ExactMatchSearchParameters.Add(TableParameter)

Execution:

Using Command As OracleCommand = 
        New OracleCommand(
            QualifiedProcedureName, 
            Me.Database.Connection)

    Command.CommandType = CommandType.StoredProcedure
    'Command.AddToStatementCache = False '

    For Each Parameter In Parameters
        Command.Parameters.Add(Parameter)
    Next

    Command.Connection.Open()

    'Command.Connection.FlushCache() '

    Using Reader As OracleDataReader = Command.ExecuteReader()

Example Successes & Failures:

*** SUCCESS ***
[SSN]: "6#######0"
[LASTNAME]: "W_____x"
[FIRSTNAME]: "D______e"
[MASTERRECORD]: ""
[C_Table]: ""

*** FAILURE ***
[SSN]: "2#######_1"
[LASTNAME]: "C____n"
[FIRSTNAME]: "L___e"
[MASTERRECORD]: ""
[C_Table]: ""

*** FAILURE ***
[SSN]: "5#######5"
[LASTNAME]: "C_______s"
[FIRSTNAME]: "R_____o"
[MASTERRECORD]: ""
[C_Table]: ""

*** SUCCESS ***
[SSN]: "6#######0"
[LASTNAME]: "P___a"
[FIRSTNAME]: "N______r"
[MASTERRECORD]: ""
[C_Table]: ""

Additional Testing:

I tried running a trace to see what ODP.NET was actually sending to the database in the parameters, but the tracefiles did not provide any meaningful information (IE: the actual parameter values)

TIME:2013/02/14-14:10:19:678 
TID:231c  
OpsSqlPrepare2(): 
SQL: Begin PACKAGE.DUP_EXACT(:v0, :v1, :v2, :v3, :v4); End;

Example Parameter Values:

?Command.Parameters(0)
{SSN}
    ArrayBindSize: Nothing
    ArrayBindStatus: Nothing
    CollectionType: None {0}
    DbType: String {16}
    Direction: Input {1}
    InvalidPrecision: 100
    InvalidScale: 129
    InvalidSize: -1
    IsNullable: False
    m_bOracleDbTypeExSet: False
    m_bReturnDateTimeOffset: False
    m_collRef: {Oracle.DataAccess.Client.OracleParameterCollection}
    m_commandText: ""
    m_direction: Input {1}
    m_disposed: False
    m_enumType: ORADBTYPE {4}
    m_modified: False
    m_oraDbType: Varchar2 {126}
    m_paramName: "SSN"
    m_paramPosOrName: ""
    m_saveValue: Nothing
    MaxScale: 127
    MinScale: -84
    Offset: 0
    OracleDbType: Varchar2 {126}
    OracleDbTypeEx: Varchar2 {126}
    ParameterEnumType: ORADBTYPE {4}
    ParameterName: "SSN"
    Precision: 0
    Scale: 0
    Size: 0
    SourceColumn: ""
    SourceColumnNullMapping: False
    SourceVersion: Current {512}
    Status: Success {0}
    UdtTypeName: ""
    Value: "4#######0" {String}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T21:47:11+00:00Added an answer on June 18, 2026 at 9:47 pm

    The answer is that there is a bug in Oracle 9.2.0.6.0 that causes intermitten VARCHAR2 binding errors. Awesome.

    This forum post finally gave me the answer:

    Is this behavior consistent or intermittent? If intermitten, and
    your db is 9206, you’re likely encountering the following rdbms bug:

    Bug.4015165 (74) REGRN SCALAR VARCHAR2 IN BINDS WITH DIFFERENT SIZE
    RANDOMLY FAILS WITH ORA-06502

    and should be resolved by patching your database.

    I’m not sure why, but ODP seems to encounter this bug a lot more than
    other drivers.

    If not intermittent, or if you are using a current patch level of
    database, a complete testcase would probably be best.

    Cheers,
    Greg

    A quick check verified that the version we are on is affected:

    select * from v$version;
    ----------------------------------------------------------------
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production       
    PL/SQL Release 9.2.0.6.0 - Production                            
    CORE    9.2.0.6.0   Production                                          
    TNS for 32-bit Windows: Version 9.2.0.6.0 - Production           
    NLSRTL Version 9.2.0.6.0 - Production 
    

    Luckily our production servers are 10g, so we finally updated our dev server to 10g as well, and viola, no more problems.

    Answer Trail:

    Parameter issue with Oracle RefCursor

    Oracle ODP.NET Forum

    ODP.NET Forum Thread “Error ORA-06502 PL/SQL”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running into this problem when trying to call a SOAP Web Service from
I'm trying to call an ImageMagick command from Python 2.7 using subprocess.call. My problem
Problem. What I am trying to do is to call a category specific loop,
I have been trying to debug this problem but unable to do so. I
I have written a PL/SQL (Ora10gR2) package which contains a stored procedure. The header
I am trying to call a function but I get an error stating function
I'm trying pre-revprop-change hook script on a Windows machine, but find a tough problem.
I have a problem trying to turn my python code into an executable using
I have a problem trying to register my own Event/Listener to the event dispatcher.
I am having a problem trying to use the prependTo() function in jQuery... for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.