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: Use of PREPARE in Pro*C

Re: Use of PREPARE in Pro*C

From: Art S. Kagel <kagel_at_bloomberg.net>
Date: 1998/06/05
Message-ID: <357828B2.4413@bloomberg.net>#1/1

Thomas Kyte wrote:
>
> A copy of this was sent to a_at_a.com (Anish Moni)
> (if that email address didn't require changing)
> On Fri, 05 Jun 1998 03:57:47 GMT, you wrote:
>
> >Hi Pro*C Gurus,
> >
> >I am trying to use to cursors in my Pro*C code and keep getting an error
> >ORA-00911 Invalid Character. Does anybody know what that error means? I am
> >using Oracle 7.3 on Ultrix. The syntax I am using is as follows
> >
> >VARCHAR SqlString[100];
> >.
> >.
> >
> >SqlString.len = sprintf ( SqlString.arr, "SELECT ID FROM STUDENTS");
> >EXEC SQL PREPARE LIST FROM :SqlString;
 [SNIP]
> If I recall, on Ultrix sprintf returns a "char *" not the length of the
> sprintf'ed string (as almost all other versions do).
>
> do a man on sprintf and make sure it isn't returning a pointer to SqlString.arr.

You are correct. Ultrix uses the BSD string library and the printf clas functions there did NOT return the number of characters written or copied as the System V versions do. SqlString.len will have to be set from a call to strlen().

Art S. Kagel Received on Fri Jun 05 1998 - 00:00:00 CDT

Original text of this message

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