Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> SQLDA, Dynamic SQL Method 4 and output host variables
Hi,
I need something like this :
//######################################################### //------------------- Pro*C++ code : BEGIN ----------------
void foo (const vector<string>& out_variables_names_i) {
//=============================================================
//============================================================= // stuff for(; ; ;) { // stuff //==================================================== EXEC SQL FETCH the_cursor INTO <out_variables_names_i>; //==================================================== // stuff } // for // stuff
//------------------- Pro*C++ code : END ------------------ //######################################################### //#########################################################//-------------- Problem Description : BEGIN --------------
Any hints and examples would be appreciated.
Alex
//-------------- Problem Description : END ---------------- //######################################################### //#########################################################// ---- : Release 8.0
// From : Pro*C/C++ Precompiler Programmer's Guide : BEGIN
//========= From : #13 Using Dynamic SQL =========
To process the dynamic SQL statement, your program must issue the DESCRIBE BIND VARIABLES command and declare another kind of SQLDA called a bind descriptor to hold descriptions of the placeholders for input host variables. (Input host variables are also called bind variables.)
!!! Question : Do bind variables care only !!! for input host variables? //================================================ //========= From : #13 Using Dynamic SQL =========
If the PL/SQL block contains an unknown number of input or output host variables, you must use Method 4. To use Method 4, you set up one bind descriptor for all the input and output host variables.
!!! Question : Do bind variables have to do !!! with output host variables? !!! See above : !!! (Input host variables are also called bind variables.)Executing DESCRIBE BIND VARIABLES stores information about input and output host variables in the bind descriptor. Because the precompiler treats all PL/SQL host variables as input host variables,
//================================================ //= From : #14 Using Dynamic SQL: Advanced Concepts
Method 4 is required for dynamic SQL statements
that contain an unknown number of select-list items or
placeholders for bind variables.
To process this kind of dynamic SQL statement,
your program must explicitly declare
SQLDAs, also called descriptors.
Each descriptor is a struct
which you must copy or hardcode into your program.
A select descriptor holds descriptions of select-list items,
and the addresses of output buffers where the names and
values of select-list items are stored.
[snip]
A bind descriptor holds
descriptions of bind variables and indicator variables,
!!! Question : Can bind descriptor hold !!! descriptions of output host variables? !!! If bind descriptor can't do it, !!! why are indicator variables mentioned here?and the addresses of input buffers where the names and values
//================================================
// From : Pro*C/C++ Precompiler Programmer's Guide : END --
//######################################################### //######################################################### //------------------- Environment ------------------------- === Oracle 8.0.5
//--------------------------------------------------------- //#########################################################
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Tue Oct 19 1999 - 04:19:08 CDT