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 -> ODBC/C++: array binding to a stored procedure

ODBC/C++: array binding to a stored procedure

From: Uwe Schweitzer <Uwe_Schweitzer_at_Kirchgruppe.de>
Date: Fri, 19 Jun 1998 15:30:27 +0200
Message-ID: <358A67F3.A24287A9@Kirchgruppe.de>


Hi,

How to give arrays in C++ as parameters to a stored procedure expected params <table of ...>?
(Environment: NT4, C++, ODBC 2, DB 7.3)

Thanks!

Uwe Schweitzer
Uwe_Schweitzer_at_Kirchgruppe.de

//*********************

Example:

TYPE id_tab IS table of Number(9) INDEX BY binary_integer;

procedure my_proc( nRows in NUMBER,

                             newID out id_tab    )
is
begin

    for i in 1..nRows loop

        SELECT SEQ_ID.NEXTVAL
        INTO newID ( i )
        FROM DUAL;
        .....

    end loop;
 end;

//*********************

int iRows = 10;
int id_list[10];

SQLPrepare(hstmt, "{call my_proc(?,?)}", SQL_NTS); SQLBindParameter(hstmt, 1, SQL_INPUT_PARAMETER, SQL_C_LONG, SQL_NUMERIC, 0, 0, &iRows....); // iRows

SQLBindParameter(hstmt,     2,     SQL_OUTPUT_PARAMETER,      ? ? ?
....);          // id_list

SQLExecute(hstmt); Received on Fri Jun 19 1998 - 08:30:27 CDT

Original text of this message

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