Re: Drawing in Pro*c???

From: Scott Urman <surman_at_wwsun10.us.oracle.com>
Date: 21 Sep 1994 16:31:01 GMT
Message-ID: <35pn45$rf6_at_dcsun4.us.oracle.com>


In article <35ohjr$1q1_at_cougar.vut.edu.au>, leng_at_cougar.vut.edu.au (Leng Kaing) writes:
|> Alvin W. Law (alaw_at_oracle.com) wrote:
|> : In article <35as5k$ibt_at_cougar.vut.edu.au> leng_at_cougar.vut.edu.au (Leng Kaing) writes:
|>
|>
|> : If you can code it in C, sure you can do so in Pro*C. The
|> : pre-compiler function of Pro*C only deals with database accesses.
|> : Once you fetch your data from the database, how you use the data is
|> : bound only by your imagination and coding skills.
|>
|> Thanks for that info, Alvin.
|>
|> Ok, on a related topic: can I use structures in Pro*C? I've started
|> writing a program that uses structures, but it gives me compilation
|> error. Here's the declaration:
|>
|> struct pnt {int x,y;};
|> struct lne {struct pnt p1, p2;};
|>
|> void dplay(struct pnt pArray[],int index, char statusBar[]);
|>
|> And in the main, some more declarations:
|> struct pnt p;
|> struct pnt pArray[Nmax];
|>
|> Compilation error:
|> "protest.c", line 179: syntax error at or near word "struct"
|>

This is a compile error on code that it looks like Pro*C should never touch. I assume that these declarations are not in a declare section, so this code should be the same as your original .pc file. I suggest that you look for a missing ; or { or something like that (in the .c file, then go back and change the .pc) on the lines preceding 179.

|> *** Error code 1
|> make: fatal error: Command failed for target 'protest'
|>
|> The error occurs at the instant the structure pnt is declared. Could
|> you possibly tell me what's wrong. And what restrictions Pro*C has
|> regarding structures. Must structures map to a table in the
|> database???

With versions 1.6 and earlier of Pro*C, you can't use structures as host variables. There is of course no restriction on using them in non-SQL statements, but structures and structure members can't be used as host variables in SQL statements. Neither can subscripted array members. This restriction has been lifted with Pro*C 2.0, shipped with Oracle7 release 7.1.

|>
|> Please shed some light on this matter.
|>
|> Thanx.
|> Leng.
|>
Received on Wed Sep 21 1994 - 18:31:01 CEST

Original text of this message