Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: [Q] DECLARE SECTION
Alex Vinokur wrote:
> Hi,
>
> I'm going to use Pro*C/C++ Precompiler in Oracle.
>
> I work with C/C++/STL, but I didn't work with SQL.
> So I have many questions.
>
> Here is a piece a code.
>
> ------------ Piece#A ------------
>
> <C++ Code : Part#1>
>
> EXEC SQL BEGIN DECLARE SECTION
>
> <C++ Code : Part#2>
>
> EXEC SQL END DECLARE SECTION
>
> <C++ Code : Part#3>
>
> ---------------------------------
>
> 1. What is DECLARE SECTION used for?
It is used to declare "host" variables. Like:
EXEC SQL BEGIN DECLARE SECTION;
int int_type;
const char *p = _some_char_pointer;
VARCHAR x[10];
etc.
EXEC SQL END DECLARE SECTION; These variables can in turn be used in DML statements embedded in you C/C++ application.
>
> 2. What is the difference between
> Piece#A and Piece#B?
PieceB has no declared host variables.
>
>
> ------------ Piece#B ------------
>
> <C++ Code : Part#1>
>
> <C++ Code : Part#2>
>
> <C++ Code : Part#3>
>
> ---------------------------------
>
> =================================
> Server : Oracle8
> Development Platform : Pro*C/C++
> =================================
>
> Thanks in advance,
> Alex
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
See embedded comments...
--
Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.
Received on Wed Jun 16 1999 - 08:34:33 CDT