Oracle Client


B

bclegg

Hi,
Anyone out there successfullly used the microsoft client to get data
back via a stored procedure?
If not, can the oracle client be used on 8.1.7?
The proc is simply 'get * from widget'
I have a cursor as the output parameter in the proc.
My addparameter command in .net is correct:
myDBNull = Convert.DBNull
strSQL = "proc_GetColWidths"
cmdConn = New OracleClient.OracleCommand(strSQL, New
OracleClient.OracleConnection(mstrConn))
cmdConn.Parameters.Add(New
OracleClient.OracleParameter("xx", OracleClient.OracleType.Cursor, _
2000, ParameterDirection.Output, True, 0, 0, "",
DataRowVersion.Default, myDBNUll))
cmdConn.CommandType = CommandType.StoredProcedure
cmdConn.CommandText = strSQL
cmdConn.Connection.Open()
cmdSource =
cmdConn.ExecuteReader(CommandBehavior.CloseConnection)
I get ora-06550 error when the executereader fires
Appreciate any help to sort this out.
Thanks
Bob
 
Ad

Advertisements

K

Kevin Yu [MSFT]

Hi bclegg,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to get data from a stored
procedure in Oracle 8.1.7. If there is any misunderstanding, please feel
free to let me know.

I think there might be something wrong with the DBNull value. Have you
tried to substitute Convert.DBNull with DBNull.Value. If the problem still
persists, please check the following link for an example:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemDataOracleClientOracleDataAdapterClassTopic.asp

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
B

Bob Clegg

Problem Solved.
It turns out that the name that you use in your parameter has to match the
ref cursor name in the stored proc.
Unlike SQL server where position and type must match but you can call the
parameter what you like.
Shame that little gotcha isn't documented.
bob
 
G

Guest

hi,
also check whether the framework which you are using is 1.1 or less. in the MS - site it is saying that it has been introduced from 1.1 only.

can you use ref cursor type in the OUT param in the stored procedure and try. or return a ref cursor from the function.

allirajan

----- Bob Clegg wrote: -----

errrrr
that should read select * from widget.
Bob
 
Ad

Advertisements

K

Kevin Yu [MSFT]

Hi Bob,

It was nice to hear that you have had the problem resolved. Thanks for
sharing your experience with all the people here. If you have any
questions, please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Oracle Client Issue 2
Bug in Oracle Client 2
Install Oracle Client 3
Oracle Client and ADO.NET 3
Multiple Oracle Clients 0
Oracle Client Parameters 5
Oracle Client Components 1
Oracle Client Namespace 5

Top