473,320 Members | 1,991 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Call Oracle Stored Proceedure VB.NET

I have a form based application that inputs values into various oracle
tables, after it has done this I want to call a stored proceedure in
Oracle which is already written to do more work on this data, it does
not return any values to vb nor does it expect any criteria or input.

I already have a connection to Oracle open using the following code:

Dim objcnn As New Data.OracleClient.OracleConnection(ConnectStr)
Dim objcom As Data.OracleClient.OracleCommand
objcnn.Open()
objcom = New Data.OracleClient.OracleCommand(strSQLinsert, objcnn)
objcom.ExecuteNonQuery()

Assuming the stored proceedure is named "my_proc" could I use a
similar command like:

objcom = New Data.OracleClient.OracleCommand(strCallMyProc, objcnn)

If so what would strCallMyProc = ?

If not how else could I or should I call it?

Thanks

Mar 8 '07 #1
2 1854
"my_proc"

You also have to ensure the Commands CommandType is set to stored procedure.
And, since you are using OracleClient, you need to return a REF_CURSOR and
set as an out parameter (which you will never use, go figure). With OleDb,
you still have a REF_CURSOR return, but do not have to declare it as a
param. Yes, a strange anomaly. Once you have the REF_CURSOR param declared,
you simply use the DataSet or Reader as normal with other databases.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*********************************************
Think outside the box!
*********************************************
"Problematic coder" <gn******@gmail.comwrote in message
news:11**********************@v33g2000cwv.googlegr oups.com...
>I have a form based application that inputs values into various oracle
tables, after it has done this I want to call a stored proceedure in
Oracle which is already written to do more work on this data, it does
not return any values to vb nor does it expect any criteria or input.

I already have a connection to Oracle open using the following code:

Dim objcnn As New Data.OracleClient.OracleConnection(ConnectStr)
Dim objcom As Data.OracleClient.OracleCommand
objcnn.Open()
objcom = New Data.OracleClient.OracleCommand(strSQLinsert, objcnn)
objcom.ExecuteNonQuery()

Assuming the stored proceedure is named "my_proc" could I use a
similar command like:

objcom = New Data.OracleClient.OracleCommand(strCallMyProc, objcnn)

If so what would strCallMyProc = ?

If not how else could I or should I call it?

Thanks
Mar 9 '07 #2
Thank you for answering my question, however I am having a hard time
understanding your answer though undoubtably correct.

I am not familiar with the term REF_CURSOR, I assume what you are
saying is I have to return something whether I need it or not?

I do not want anybody to do my work for me but it might be helpful if
somebody could post some example code which would call the proceedure,
make it run and return a value if that is necessary

Again I appreciate your time

On Mar 8, 8:45 pm, "Cowboy \(Gregory A. Beamer\)"
<NoSpamMgbwo...@comcast.netNoSpamMwrote:
"my_proc"

You also have to ensure the Commands CommandType is set to stored procedure.
And, since you are using OracleClient, you need to return a REF_CURSOR and
set as an out parameter (which you will never use, go figure). With OleDb,
you still have a REF_CURSOR return, but do not have to declare it as a
param. Yes, a strange anomaly. Once you have the REF_CURSOR param declared,
you simply use the DataSet or Reader as normal with other databases.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*********************************************
Think outside the box!
*********************************************"Prob lematic coder" <gnews...@gmail.comwrote in message

news:11**********************@v33g2000cwv.googlegr oups.com...
I have a form based application that inputs values into various oracle
tables, after it has done this I want to call a stored proceedure in
Oracle which is already written to do more work on this data, it does
not return any values to vb nor does it expect any criteria or input.
I already have a connection to Oracle open using the following code:
Dim objcnn As New Data.OracleClient.OracleConnection(ConnectStr)
Dim objcom As Data.OracleClient.OracleCommand
objcnn.Open()
objcom = New Data.OracleClient.OracleCommand(strSQLinsert, objcnn)
objcom.ExecuteNonQuery()
Assuming the stored proceedure is named "my_proc" could I use a
similar command like:
objcom = New Data.OracleClient.OracleCommand(strCallMyProc, objcnn)
If so what would strCallMyProc = ?
If not how else could I or should I call it?
Thanks- Hide quoted text -

- Show quoted text -

Mar 9 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Eugene A | last post by:
Hello. In this call from a Java prog to a Oracle SP I am trying to pass along some varchars and a cursor, but apperently the syntax of the call to the stor proc is incorrect. What am I doing...
6
by: John Webb | last post by:
Hope someone can help. I am trying to write a stored proceedure to display sales activity by month and then sum all the columbs. The problem is that our sales year starts in April and end in...
1
by: Melissa Meyer via SQLMonster.com | last post by:
How do you set a stored proceedure for automatic execution? -- Message posted via http://www.sqlmonster.com
12
by: Newbie | last post by:
how can i call an oracle function to get data without using a select statement or stored procedures? given a project_no, i need to call the function: ops$sqltime.pa_new_job_no_fn which will...
1
by: pmclinn | last post by:
I have created a aspx page that requires me to pull data from multiple tables in an Oracle DB. The data is pulled down and then stored in local variables, and then closed and disposed. I have...
2
by: Gary | last post by:
Hi Al I have the following parameters in an oracle function PACKAGE BODY ALLO A ------------------------------------------------------------------------------- FUNCTION ITEM...
0
by: Problematic coder | last post by:
I have a form based application that inputs values into various oracle tables, after it has done this I want to call a stored proceedure in Oracle which is already written to do more work on this...
0
by: pbaillard | last post by:
Here a sample to call a stored procedure with an Oracle Database. odc.Connection = m_cDb ' use an open connection to your database odc.CommandType = CommandType.StoredProcedure odc.CommandText =...
8
by: jthep | last post by:
Is there a way to create a stored procedure where more than one type of parameter can be entered? For example, a user can enter a int type, char(4) type, or nothing in the same stored proceedure.
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.