Thank you for your comment, Triskelion.
Could you elaborate what is PRO*C??
Thanks
Main Topics
Browse All TopicsHello, everyone.
Could anyone show me how to call a stored procedure which returns a value in VC++? (WITHOUT using CRecordeset)
I searched and got a few answers here but those were not what I wanted. Let me explain what I need for my project.
It's a multi-threaded program, and each thread must call the stored procedure continually while running. The stored procedure is like the bottom:
CREATE PROCEDURE GetMyNum
@In_MyStr varchar(15),
@Out_Result smallint OUTPUT
AS
SET @In_MyStr = RTRIM(LTRIM(@In_MyStr))
SET @Out_Result = 0
SELECT @Out_Result = theNum
FROM NumTable
WHERE theStr = @In_MyStr
I am from VB so it's very easy to do this with a Command object without using any recordset object. When I looked at a sample VC++ code somewhere and I was just lost.
There are several ways to accomplish the logic above. The reason why I chose this scenario is that I thought it might be better for performance (speed mostly).
Let me elaborate my logic a little bit.
My thought is that:
- Create a global connection object when the program starts.
- Create threads and they are going to use the connection object for its Command object's ActiveConnection.
- When I need a number from database, I call the stored procedure through the command object and get the value from the command object without even bothering with a CRecordset object.
Thank you in advance for any input.
Happy programming.
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.
ORACLE ONLY.
PRO*C is an ORACLE modification to the C language.
It allows the developer to create blocks of SQL code inside of a C module. The code is run through a pre-compiler that converts the SQL commands into C and the ORACLE OCI (Oracle Call Interface) commands.
Some people would rather use Pro*C than ODBC for code to be used only with Oracle.
http://www.altavista.com/s
Business Accounts
Answer for Membership
by: TriskelionPosted on 2002-05-03 at 19:33:34ID: 6989421
Without using a CRecordset, you would need to use PRO*C.
If you want to use a CRecordset, there are a few techniques.