ooops - msgbox(ex.Message)
Also you might need to spell out the exception type, ie:
Catch ex As System.Data.OracleClient.O
If that doesn't work, then just catch the error as a general Exception if possible
Main Topics
Browse All TopicsI'm using VB.Net to connect to Oracle with the Mocrosoft managed data provider for Oracle. I can connect to the database and run a query and get data back with no problem. Now I need to call a stored procedure thate has 2 paramters. The first one is a varchar input paramter and the second one is a number output parameter. My code is below. When the app gets to the myCommand.ExecuteNonQuery(
An unhandled exception of type 'System.Data.OracleClient.
Additional information: System error.
The examples I've found match my syntax and I've got no clue what else to try.
Dim document_id As Integer
Dim myConnection As New OracleConnection
Dim myCommand As New OracleCommand
connString = "data source=HOLMES;user id=LINE_HOST;password=LINE
myConnection.ConnectionStr
myCommand.Connection = myConnection
myCommand.CommandText = "test_for_new_document"
myCommand.CommandType = CommandType.StoredProcedur
myCommand.Parameters.Add(N
'myCommand.Parameters("the
'myCommand.Parameters("the
myCommand.Parameters.Add(N
myCommand.Parameters("the_
myConnection.Open()
myCommand.ExecuteNonQuery(
document_id = myCommand.Parameters(1).Va
myConnection.Close()
Any help would be greatly appreciated.
Thanks.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Also, I've never touched an Oracle Server, but those Params are strange? And how about this one?
myCommand.Parameters.Add(N
You gave a string, and said it's a number. I assume you replacing the actual values with the placeholders, or is this the ACTUAL code?
I have gotten errors before for not declaring the size of the VARCHAR when calling a stored procedure..
I’m pretty confident that the error is coming from Oracle, but with all the layers and wrappers involved, it’s hard to be 100% sure...
In the statement “document_id = myCommand.Parameters(1).Va
Does the connection have an Error collection that you can investigate?
getting error ORA-06550: line 1 column7
PLS-00306: wrong number or types of arguments in call to 'TEST_FOR_NEW_DOCUMENT'
Here's the Oracle procedure
create or replace procedure test_for_new_document
(thesource_path in varchar2,the_document_numb
is
CNT NUMBER;
thedoc number;
begin
SELECT COUNT(*)
INTO CNT
FROM LINE_HOST.ELECTRONIC_DOCUM
WHERE SOURCE_PATH = thesource_path;
IF CNT = 0
THEN
SELECT LINE_HOST.E_DOCUMENT_NUM.N
INTO the_document_number
FROM DUAL;
COMMIT;
ELSE
SELECT E_D_NUMBER
INTO the_document_number
FROM LINE_HOST.ELECTRONIC_DOCUM
WHERE SOURCE_PATH = thesource_path;
END IF;
end;
I'm not familiar with this provider (we use ODP.Net) but try setting up lengths on the parameters:
myCommand.Parameters.Add(N
myCommand.Parameters.Add(N
Can you also post the dim of SourceFileName? It might be wigging out if it's dimmed as String.....
Business Accounts
Answer for Membership
by: toddhdPosted on 2005-01-27 at 10:19:17ID: 13155211
If you could wrap it in a Try/Catch and gives us the error message, it would help greatly:
_HOST" ing = connString e ew OracleParameter("thesource _path", OracleType.VarChar)).Value = SourceFileName source_pat h").Direct ion = ParameterDirection.Input source_pat h").Value = SourceFileName ew OracleParameter("the_docum ent_number ", OracleType.Number)) document_n umber").Di rection = ParameterDirection.Output ) lue
Dim document_id As Integer
Dim myConnection As New OracleConnection
Dim myCommand As New OracleCommand
Try
connString = "data source=HOLMES;user id=LINE_HOST;password=LINE
myConnection.ConnectionStr
myCommand.Connection = myConnection
myCommand.CommandText = "test_for_new_document"
myCommand.CommandType = CommandType.StoredProcedur
myCommand.Parameters.Add(N
'myCommand.Parameters("the
'myCommand.Parameters("the
myCommand.Parameters.Add(N
myCommand.Parameters("the_
myConnection.Open()
myCommand.ExecuteNonQuery(
document_id = myCommand.Parameters(1).Va
myConnection.Close()
Catch ex as OracleException
msgbox(ex.Message>
End Try