Re: Dynamic array in call to stored procedure



On May 30, 7:17 pm, semki...@xxxxxxxxx wrote:
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 ?- Hide quoted text -

- Show quoted text -

Using the 10gR2 version of the documentation, available free online
and available for download from OTN, I found a section labeled Host
Arrays in Ch. 7 Embedded PL/SQL from Pro*C/C++ Programmer's Guide 10g
Release 2 (10.2) Part Number B14407-01 that seems to cover this topic
with examples.

Try looking at this material and see if it helps.

http://tahiti.oracle.com

HTH -- Mark D Powell --
.



Relevant Pages

  • Re: pro*c
    ... EXEC SQL BEGIN DECLARE SECTION; ... dont have c application installed)..could anyone tell me how to run that..like i can run that in pro*c which show green check mark in front of it ..NOW WHAT TO DO AFTER THAT ..I DONT KNOW ...please help ... And who is responsible for your oracle database? ...
    (comp.databases.oracle.tools)
  • Invoke stored function from Pro*C
    ... I am trying to invoke a function stored on Oracle ... However, the precompiler does not ... compile through. ... EXEC SQL EXECUTE ...
    (comp.databases.oracle.misc)
  • Compiling and running DBD for Oracle 10g without installing Oracle
    ... I recently had to compile the DBD modules for Oracle 10g on machines, ... perl, DBI etc. of recent enough version ... Oracle 10g installation disk for your architecture (available at ...
    (perl.dbi.users)
  • Compiling and running DBD for Oracle 10g without installing Oracle
    ... I recently had to compile the DBD modules for Oracle 10g on machines, ... perl, DBI etc. of recent enough version ... Oracle 10g installation disk for your architecture (available at ...
    (perl.dbi.users)
  • RE: Compiling Multiple versions of DBD::Oracle
    ... Compile DBD::Oracle using the $ORACLE_HOME of the highest installed version of Oracle. ... supporting a large Solaris Environment. ... sender of the delivery error by replying to this message, or notify us by ...
    (perl.dbi.users)