Re: Dynamic array in call to stored procedure



On May 30, 5:44 pm, DA Morgan <damor...@xxxxxxxxx> wrote:
semki...@xxxxxxxxx wrote:
How to do the following with Oracle 9:

No such product. Provide full version information.

1. allocate array of VARCHAR

Look up ASSOCIATIVE ARRAYShttp://www.psoug.org/library.html

2. allocate array of related index variables

What does this mean?

3. call stored procedure from C++ and pass parameters from step 1 and
2.

Look up EXTERNAL PROCEDURES athttp://tahiti.oracle.com

I can pass declared array, but how to pass allocated ?

What does this mean?

Is it possible at all ?

Of course. But we would need to have a far clearer description to
know for sure what you are asking about.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damor...@xxxxxxxxxxxxxxxx (replace x with u to respond)
Puget Sound Oracle Users Groupwww.psoug.org

Hi,
I use Oracle 9i. My code in C++ has to do the next:

...
EXEC SQL BEGIN DECLARE SECTION;
VARCHAR* pVar;
short* pInd;
EXEC SQL END DECLARE SECTION;


pVar = new VARCHAR[ARRAY_SIZE];
pInd = new short[ARRSY_SIZE];


EXEC SQL EXECUTE
BEGIN
Package.Procedure(:pVar, :pInd);
END;
END-EXEC;


C++ percompiler doesn't allow use pointer VARCHAR* and all my attempts
to use some wrapper didn't help.
I can't compile C++ program, that calls stored procedure and use
allocated array of VARCHAR.

Without using 'new'

EXEC SQL BEGIN DECLARE SECTION;
VARCHAR Var[ARRAY_SIZE];
short Ind[ARRAY_SIZE];
EXEC SQL END DECLARE SECTION;

I can compile and run program



I hope now I provided enough details. Any suggestions ?
.



Relevant Pages

  • Re: Can I use ESQL/C datetime type to define non-host variables / parameters (oops)
    ... Do I need to put the parameters with esql/c datatypes between EXEC SQL BEGIN DECLARE SECTION; and EXEC SQL END DECLARE SECTION;. ... If you want to write datetime as the type name without a typedef, then you have to use the ESQL/C preprocessor to change the datetime into dtime_t for you. ...
    (comp.databases.informix)
  • Re: Opinions on approach, please...
    ... It means the first column in the result set. ... EXEC SQL DECLARE c1 CURSOR FOR s1 END-EXEC. ...
    (comp.lang.cobol)
  • Re: ESQLC problem
    ... preprocessor step before the esqlc step. ... exec sql begin declare section; ... I can't think of any simple way to deal with this, unless the header ...
    (comp.databases.ingres)
  • Re: help with tables
    ... department into table2-entry from table2 ... This does not appear to work, at least not using the DB2 pre-processor. ... EXEC SQL ... BEGIN DECLARE SECTION ...
    (comp.lang.cobol)
  • Re: [Info-Ingres] ESQLC problem
    ... #ifdef BIG_STRING ... exec sql begin declare section; ... I can't think of any simple way to deal with this, unless the header ...
    (comp.databases.ingres)