Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL-Pro*C++ : Copying char* into VARCHAR
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
![]() |
![]() |