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 -> Pro*C proc. call with out param. of type table of rec via SQL*Net

Pro*C proc. call with out param. of type table of rec via SQL*Net

From: Ondrej 'Andy' Brablc <brablc_at_my-dejanews.com>
Date: Tue, 04 May 1999 11:48:24 GMT
Message-ID: <7gmmq7$lu$1@nnrp1.dejanews.com>


I have problem using procedure call with output parameter of type table of records via SQL*Net from Pro*C program.

What I have are this types:

type t_rec_Currency is record
(

        Currency      varchar2(3),
        Country_name  varchar2(35)

);
type t_tab_rec_Currency is table of t_rec_Currency index by binary_integer;

I'm calling a stored procedure ENCR(out C t_tab_rec_Currency) and the only thing I need is number of rows returned.

So I did this:

char * connect_string="user/password_at_site";

EXEC SQL BEGIN DECLARE SECTION;
   int Count;
EXEC SQL END DECLARE SECTION; ...

EXEC SQL CONNECT :connect_string;
EXEC SQL EXECUTE
   declare
     rec_currency t_tab_rec_Currency;
   begin

     ENCR(rec_currency);

:Count := rec_currency.count;
for i in 1..rec_currency.count loop ... end loop;

   end;
END-EXEC; And I cannot get this compiled, on my side there is Oracle 7.3.4, remote site is Oracle 8. When executed as an PL/SQL block from sqlplus it works fine. It could be also compiled against local database. When trying to make with this file:

USERID=user/password_at_site
PROCPLSFLAGS= sqlcheck=semantic userid=$(USERID) dbms=v6_char

it writes this:

PCC-S-02306, wrong number or types of arguments in call to 'COUNT'

:Count := rec_currency.count;

............1

Does anybody know why I cannot access .count of the otput parameter. There are 8 rows in my environment in this table of rec, and I can see them using this ugly thing:

   begin

     ENCR(rec_currency);

:Count := 8;
for i in 1..:Count loop ... copy rec_currency(i).Currency somewhere ... end loop;

   end;

But I really need the number of rows.

Thanks in advance

               Andy

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Tue May 04 1999 - 06:48:24 CDT

Original text of this message

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