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: SQL-Pro*C++ : Copying char* into VARCHAR

Re: SQL-Pro*C++ : Copying char* into VARCHAR

From: Serge LUCAS <Serge.Lucas_at_eurocontrol.fr>
Date: Wed, 17 Feb 1999 14:56:46 +0000
Message-ID: <36CAD8AE.853581E9@eurocontrol.fr>


HandyCam wrote:
>
> My question is why did you declare the "dest " variable within the DECLARE
> SECTION ?
> Wherein you can declare "dest" in the C language.
> e.g.
> void MyClass::f(char * str)
> char dest [20];
> {
> strcpy (dest,str);
> EXEC SQL DECLARE c_sample CURSOR
> SELECT * from sampletable where fldvar = :dest ;
> }
>
> OR maybe the data from "str" variable contains more than 20 characters.

NO. The point is that, with the code=cpp option, you MUST have all the bind variables declared in the DECLARE section. (setting 'code=cpp' automatically sets the parse option to PARTIAL instead of FULL)

The Oracle Pro*C precompiler has many generous suprises like this one in the C++ mode... Received on Wed Feb 17 1999 - 08:56:46 CST

Original text of this message

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