On 23 January 2013 13:56, Mongelli, Kurt <[email protected]> wrote:
>
> I have been looking for some examples of returning a Oracle REF_CURSOR
> From a Oracle Stored Procedure using the SOCI Interface C++ Library.
>
> I have a test stored procedure:
>
> CREATE OR REPLACE PROCEDURE da_get_users
>    ( ptr_cursor OUT read_cursor_pack.readCursor )
> AS
> BEGIN
>      OPEN ptr_cursor FOR
>      SELECT da_user, da_type FROM DA_USERS ;
> END da_get_users ;
>
> In a C++ application how do I retrieve the out variable (ptr_cursor), then
> do I use a Fetch() loop to retrieve the data from the select statement.

Kurt,

I haven't used stored procedures a lot, but AFAIR fetch() is the way to go.
You can take a look at the test4 in Oracle tests [1], it should help.

[1] 
https://github.com/SOCI/soci/blob/master/src/backends/oracle/test/test-oracle.cpp

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to