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 -> Re: Pro*C access to table of ... components via SQL*Net

Re: Pro*C access to table of ... components via SQL*Net

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Wed, 05 May 1999 15:34:15 GMT
Message-ID: <37346485.6317614@192.86.155.100>


A copy of this was sent to Ondrej 'Andy' Brablc <brablc_at_my-dejanews.com> (if that email address didn't require changing) On Wed, 05 May 1999 14:53:18 GMT, you wrote:

>In article <01be964b$011c5460$190114c1_at_sister.grant.UUCP>,
> "Alexander I. Doroshko" <aid_at_grant.kharkov.ua> wrote:
>> With ProC 2.2.3 and Oracle 7.3.4 it works.
>> Haven't you tried to rename the Count variable?
>
>I have ProC 2.2.4 and Oracle 8.0.4.2.1 as a remote database.
>I tried to rename it and to simplify the problem as much as
>possible. So here it is again. I have this package on remote
>database
>

seems to be an issue with the 7.x precompiler against an 8.0 database (if you use 8.0 proc with 8.0 -- no problem, if you use 7.x precompiler against 7.x database -- no problem). A workaround for you right now is to code this as:

static void process( void )
{
exec sql begin declare section;
VARCHAR sqlstmt[1024];
exec sql end declare section;

#define PLSQL_BLOCK "\
declare \n\

    rec_currency IFO0018.t_tab_rec_Currency; \n\ begin \n\

    rec_currency(1).Currency := 'CZK'; \n\     rec_currency(1).Country_name := 'CZECH REPUBLIC'; \n\     DBMS_OUTPUT.put_line(rec_currency.COUNT); \n\ end;"

    EXEC SQL WHENEVER SQLERROR DO sqlerror_hard();

    sprintf( sqlstmt.arr, PLSQL_BLOCK );     sqlstmt.len = strlen( sqlstmt.arr );     exec sql prepare S from :sqlstmt;
    exec sql execute S;
}

which works just fine (and lets you not have to specify sqlcheck=semantics as an added bonus -- precompiles *very* fast without it).

You can call support and reference bug 531062 and tell them you are hitting the same issue as well.

>CREATE OR REPLACE Package IFO0018 IS
>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;
>END;
>/
>
>And I'm trying to compile this program:
>
>char * connect_string="user/demo_at_site";
>
>EXEC SQL INCLUDE SQLCA;
>
>main(int argc, char ** argv)
>{
> EXEC SQL CONNECT :connect_string;
> EXEC SQL EXECUTE
> declare
> rec_currency IFO0018.t_tab_rec_Currency;
> begin
> rec_currency(1).Currency := 'CZK';
> rec_currency(1).Country_name := 'CZECH REPUBLIC';
> DBMS_OUTPUT.put_line(rec_currency.COUNT);
> end;
> END-EXEC;
> EXEC SQL COMMIT WORK RELEASE;
>}
>
>I now that DBMS_OUTPUT will do nothing, but it is for me
>the easiest way to use COUNT component of rec_currency.
>When preprocessing by Pro*C it stops and writes:
>
>PCC-S-02306, wrong number or types of arguments in call to 'COUNT'
>
>The very same thing it will do with LAST or FIRST, NEXT(1) also does not
>work. But I could even touch rec_currency(1).Currency. And when running
>from inside "sqlplus user/demo_at_site" it works fine. So it seems to as
>a bug or some compatibility error.
>
> Andy
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

See http://www.oracle.com/ideveloper/ for my column 'Digging-in to Oracle8i'...  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA

--
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Wed May 05 1999 - 10:34:15 CDT

Original text of this message

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