Re: Help with varchar/Pro*C Warning Message

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 1998/12/22
Message-ID: <3681f525.2446918_at_192.86.155.100>#1/1


A copy of this was sent to jjy_at_typhoon.xnet.com (James Yorton) (if that email address didn't require changing) On 22 Dec 1998 19:24:51 GMT, you wrote:

>Here's my environment:
>
>Oracle 7.3.4
>Pro*C/C++: Release 2.2.4.0.0
>
>I'm porting an application to Solaris 2.6 from SunOS 4.1.3 and am getting
>the warning:
>
>Warning at line 48, column 0, file sql_status.pc:
> EXEC SQL SELECT id, status
>......1
>(1) PCC-W-02344, Host variable array size mismatch. Using minimum: 21
>
>
>I don't believe there is a mismatch though.
>Pro*C code that precompiled cleanly now complains about the statement:
>
>EXEC SQL SELECT id, status
> INTO :id, :st
> FROM STATUS;
>
>where id, status are:
>
>unsigned id[50];
>varchar st[21][50];
>
>and are associated with table definitions:
>
>ID NOT NULL NUMBER(38)
>STATUS VARCHAR2(20)
>
>In order to prevent the warning, I must declare st to be varchar[50][50].
>

or, you could use 50 varchar(21) strings -- you have the array defined backwards. It should be:

varchar st[50][21];

the NUMBER of array elements is first -- the length of each array element is 2'cnd....

>Anything less than 50 (for the size of the varchar string, not the size of
>the array of that) causes the "using minimum" warning above with whatever
>number I use. I'd prefer to dimension the varchar string to match that
>of its corresponding table definition. So varchar st[49][50] causes:
>(1) PCC-W-02344, Host variable array size mismatch. Using minimum: 49
>
>Has something changed with varchars and this release of Pro*C?
>Thanks for any help.
>
>Jim
 

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

--
http://govt.us.oracle.com/    -- downloadable utilities
 
----------------------------------------------------------------------------
Opinions are mine and do not necessarily reflect those of Oracle Corporation
 
Anti-Anti Spam Msg: if you want an answer emailed to you, 
you have to make it easy to get email to you.  Any bounced
email will be treated the same way i treat SPAM-- I delete it.
Received on Tue Dec 22 1998 - 00:00:00 CET

Original text of this message