Re: Pro*C and Pointers are not assignment compatiable

From: Thomas J. Kyte <tkyte_at_us.oracle.com>
Date: 1997/02/13
Message-ID: <3302784d.3269220_at_nntp.mediasoft.net>#1/1


Try:

strcpy( (char*)sqlstmt.arr, "SELECT PROD_CODE FROM PP_PRODUCT WHERE PROD_CODE");

The VARCHAR structure is defined as

typedef struct { unsigned short len; unsigned char arr[1]; } VARCHAR;

the unsigned char part might be giving your compiler heartburn.

On Wed, 12 Feb 1997 07:20:18 -0500, "Scott T. Johnson" <sjohnson_at_ibm.net> wrote:

>I am working on a Pro*C program and cannot get rid of the following
>warning. My Pro*C call is included as well as the code. I am running
>on an HP using HP-UX 9.04 and the generic C compiler that comes with the
>OS.
>
>Thanks,
>Scott
>
>
> /orax2/oracle/7.2/bin/proc sqlcheck=full iname=p.pc
>
>Pro*C/C++: Release 2.1.3.0.0 - Production on Wed Feb 12 07:03:51 1997
>
>Copyright (c) Oracle Corporation 1979, 1994. All rights reserved.
>
>System default option values taken from: /orax2/oracle/7.2/proc/pmscfg.h
>
> cc -I. -O -Aa -D_HPUX_SOURCE +ESsfc +ESlit
>-I/orax2/oracle/7.2/sqllib/pc
>cc: "p.c", line 209: warning 604: Pointers are not
>assignment-compatible.
>cc: "p.c", line 209: warning 563: Argument #1 is not the correct type.
>cc: "p.c", line 210: warning 604: Pointers are not
>assignment-compatible.
>cc: "p.c", line 210: warning 563: Argument #1 is not the correct type.
>cc: "p.c", line 213: warning 604: Pointers are not
>assignment-compatible.
>cc: "p.c", line 213: warning 563: Argument #1 is not the correct type.
>cc: "p.c", line 214: warning 604: Pointers are not
>assignment-compatible.
>cc: "p.c", line 214: warning 563: Argument #1 is not the correct type.
>cc: "p.c", line 215: warning 604: Pointers are not
>assignment-compatible.
>
>
>Sample Code:
>
>
>
>void main(int argc, char **argv)
>{
>
>EXEC ORACLE OPTION (ORACA=YES);
> VARCHAR sqlstmt[150];
> VARCHAR v_prodcode[10];
> VARCHAR prodcode[10];
>
>/* The ORACA=YES option must be specified to enable use of
> * the ORACA.
> */
>
>oracle_login("/");
>
>strcpy(sqlstmt.arr, "SELECT PROD_CODE FROM PP_PRODUCT WHERE PROD_CODE");
>strcat(sqlstmt.arr, " = :v1");

Thomas Kyte
Oracle Government
tkyte_at_us.oracle.com                          

http://govt.us.oracle.com

  • Check out Oracle Governments web site! ----- Follow the link to "Tech Center" and then downloadable Utilities for some free software...

statements and opinions are mine and do not necessarily reflect the opinions of Oracle Corporation Received on Thu Feb 13 1997 - 00:00:00 CET

Original text of this message