Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> ODBC/C++: array binding to a stored procedure
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
for i in 1..nRows loop
SELECT SEQ_ID.NEXTVAL INTO newID ( i ) FROM DUAL; .....
//*********************
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