Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

BUG: "PL/SQL Argument Name Is Invalid" Error Message When You Use MSDAORA with 30 Character Parameter


View products that this article applies to.

This article was previously published under Q311505

↑ Back to the top


Symptoms

When you use Microsoft OLE DB Provider for Oracle (MSDAORA) to run a stored procedure that takes parameters of 30 characters in length, you receive the following error message:
RunTime Error '-2147217900 (80040e14)'
PL/SQL argument name is invalid.

↑ Back to the top


Resolution

To work around this problem, use the ODBC driver.

↑ Back to the top


Status

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

↑ Back to the top


More information

Steps to Reproduce Behavior

  1. On your Oracle server, run the following data definition language (DDL) script:
    DROP TABLE TEST;
     
    CREATE TABLE TEST ( 
      INCOMEEVENTPAYABLEDATEFREQSPA   VARCHAR2 (50), 
      INCOMEEVENTPAYABLEDATEFREQSPAN  VARCHAR2 (50));
    
    insert into test values('Twenty-Nine Chars','Thirty Chars');
    					
  2. On your Oracle server, create the following package:
    CREATE OR REPLACE package test as
     
          TYPE TEST_REC_TYP IS RECORD(
           IncomeEventPayableDateFreqSpa TEST.IncomeEventPayableDateFreqSpa%TYPE,
           IncomeEventPayableDateFreqSpan TEST.IncomeEventPayableDateFreqSpan%TYPE);
     
          TEST_REC    TEST_REC_TYP;
    
        TYPE TEST_CUR
                  IS REF CURSOR RETURN TEST_REC%TYPE;
     
          TYPE Spa_TABLE                     IS TABLE OF
    TEST.IncomeEventPayableDateFreqSpa%TYPE
            INDEX BY BINARY_INTEGER;
     
          TYPE span_TABLE               IS TABLE OF
    TEST.IncomeEventPayableDateFreqSpan%TYPE
            INDEX BY BINARY_INTEGER;
     
    PROCEDURE SP_GET_INCOME_EVENTS_FOR_UPD(
           IncomeEventPayableDateFreqSpa            OUT SPA_TABLE,
           IncomeEventPayableDateFreqSpan     OUT SPAN_TABLE);
     
    end test;
    / 
    					
  3. On your Oracle server, create the following package body:
    CREATE OR REPLACE PACKAGE BODY TEST AS
     
    PROCEDURE SP_GET_INCOME_EVENTS_FOR_UPD(IncomeEventPayableDateFreqSpa   
       OUT SPA_TABLE,IncomeEventPayableDateFreqSpan OUT SPAN_TABLE ) IS
          V_INDX      NUMBER DEFAULT 1 ;
          C1          TEST_CUR;
    BEGIN
           OPEN C1 FOR
           SELECT * FROM TEST;
           LOOP
                FETCH C1 INTO IncomeEventPayableDateFreqSpa(V_INDX),
    IncomeEventPayableDateFreqSpan(V_INDX);
                EXIT WHEN (C1%NOTFOUND) OR (C1%NOTFOUND IS NULL);
                V_INDX := V_INDX + 1;
           END LOOP;
    END SP_GET_INCOME_EVENTS_FOR_UPD;
    END TEST;
    / 
    					
  4. Create a new Standard EXE project in Visual Basic. Form1 is created by default.
  5. On the Project menu, click References, and then select the Microsoft ActiveX Data Objects 2.x Library check box.
  6. Add a Command button to Form1, and then paste the following code into the Code window of Form1:
    Private Sub Command1_Click()
        Dim cn As New ADODB.Connection
        Dim cmd As New ADODB.Command
        Dim sqlcmd As String
    
        sqlcmd = "{call test.SP_GET_INCOME_EVENTS_FOR_UPD" _
           & ({resultset 5000, IncomeEventPayableDateFreqSpa, IncomeEventPayableDateFreqSpan})}"
                
        cn.CursorLocation = adUseClient
    
        cn.Open "Provider=MSDAORA.1;Password=mypwd;User ID=myuid;Data Source=myserver"
        'cn.Open "dsn=oracle;Pwd=mypwd;uid=myuid;"
    
        cmd.CommandText = sqlcmd
        cmd.ActiveConnection = cn
        cmd.Execute
    
        MsgBox ("Test Complete")
    End Sub
    					
  7. Modify the ADO connection string as appropriate for your environment.
  8. Run the project, and then click the command button. Notice that data appears in the Immediate window. When the command is run, you receive the above-mentioned error message.
  9. To work around this problem, stop the project, and then change the connection so that it uses ODBC. When you run the project again, you do not receive the error message.

↑ Back to the top


Keywords: KB311505, kbnofix, kbbug

↑ Back to the top

Article Info
Article ID : 311505
Revision : 3
Created on : 5/8/2003
Published on : 5/8/2003
Exists online : False
Views : 308