Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 311505 - Last Review: May 8, 2003 - Revision: 2.1
BUG: "PL/SQL Argument Name Is Invalid" Error Message When You Use MSDAORA with 30 Character Parameter
This article was previously published under Q311505
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.
To work around this problem, use the ODBC driver.
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.x 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 = "{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
- Modify the ADO connection string as appropriate for your environment.
- 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.
- 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.
APPLIES TO
- Microsoft Data Access Components 2.5
- Microsoft Data Access Components 2.6
- Microsoft Data Access Components 2.7
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate