Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Calling Oracle stored procedure from VC++

Calling Oracle stored procedure from VC++

From: Knut Hovda <knut.hovda_at_pti.no>
Date: Fri, 01 Mar 2002 15:06:28 GMT
Message-ID: <UNMf8.142$5vh.171024384@news.telia.no>


Hello,

I'm using VC++ 6.0 with MFC ODBC classes to access data in Oracle 8.1.6.

The problem is calling stored procedures in Oracle that returns data. From what I have seen on previous postings, Oracle stored procedures can't return recordsets (like stored procedures in SQL Server can), but for now I'd be happy to just be able to get some return parameters back to VC++.

The MSDN article "Recordset: Declaring a Class for a Predefined Query (ODBC)" gives an example on how to build the recordset with the needed parameters, but the article says nothing if this is meant to work with Oracle, or if it is SQL Server only. Also, there are no examples on how the stored procedure would look.

An example: If I have the Oracle stored procedure (PL/SQL code):

CREATE OR REPLACE PROCEDURE sp_get_zonename   (v_zone_id IN zone.z_id%TYPE,
   v_zone_name OUT zone."ZoneName"%TYPE) IS
BEGIN
   SELECT "ZoneName"
   INTO v_zone_name
   FROM zone
   WHERE Z_ID = v_zone_id;
END;
/

how can I call this procedure from VC++ and get the variable v_zone_name back?

In advance, thanks for your help.

Regards,

Knut

--
Knut Hovda (knut.hovda_at_pti.no)
  PTI Scandpower AS
  P.O.Box 206 / Billingstadsletta 30
  1396 Billingstad, Norway
  Phone +47 66 85 03 21
Received on Fri Mar 01 2002 - 09:06:28 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US