Microsoft KB Archive/311505

= BUG: &quot;PL/SQL Argument Name Is Invalid&quot; Error Message When You Use MSDAORA with 30 Character Parameter =

Article ID: 311505

Article Last Modified on 5/8/2003

-

APPLIES TO


 * Microsoft Data Access Components 2.5
 * Microsoft Data Access Components 2.6
 * Microsoft Data Access Components 2.7

-



This article was previously published under Q311505



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.



RESOLUTION
To work around this problem, use the ODBC driver.



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



Steps to Reproduce Behavior
  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');   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; /                      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; /                     Create a new Standard EXE project in Visual Basic. Form1 is created by default. On the Project menu, click References, and then select the '''Microsoft ActiveX Data Objects 2. Library''' check box.  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 = &quot;{call test.SP_GET_INCOME_EVENTS_FOR_UPD&quot; _ & ({resultset 5000, IncomeEventPayableDateFreqSpa, IncomeEventPayableDateFreqSpan})}&quot; cn.CursorLocation = adUseClient

cn.Open &quot;Provider=MSDAORA.1;Password=mypwd;User ID=myuid;Data Source=myserver&quot; 'cn.Open &quot;dsn=oracle;Pwd=mypwd;uid=myuid;&quot;

cmd.CommandText = sqlcmd cmd.ActiveConnection = cn   cmd.Execute

MsgBox (&quot;Test Complete&quot;) End Sub </li> Modify the ADO connection string as appropriate for your environment.</li> 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.</li> 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.</li></ol>

Additional query words: MSDAORA 80040e14 -2147217900 execute

Keywords: kbbug kbnofix KB311505

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.