Home » Developer & Programmer » Precompilers, OCI & OCCI » Newbie with a question.
Newbie with a question. [message #94342] Thu, 12 August 2004 07:10 Go to next message
Messages: 12
Registered: June 2001
Junior Member
I'm new to PRO*C development and am having trouble following a tutorial. Could anyone please help me with the following questions?

(1) What exactly is a MACRO?†I was told†that we use #define to define constants and macros. However, I'm not sure what a MACRO is?!

(2)†I have a variable defined to be

static NUMSTR† empdtls="";

I understand that defining a variable as STATIC is akin to making it public. Why do we have the†"" here? What is a†NUMSTR†type of variable?

(3)†Is TABLE a PRO*C reserved word? I have the following definition:


How do I†interpret this code?

(4)if ( !mode )
EXEC SQL OPEN cursor_001;

The term 'mode' however is NOT defined ANYWHERE!!!!! What exactly is happening here?

Thanks for your time and help.†I would also appreciate any links to†a good PRO*C tutorial.

Re: Newbie with a question. [message #94343 is a reply to message #94342] Thu, 12 August 2004 09:43 Go to previous messageGo to next message
Messages: 1
Registered: August 2004
Junior Member
I fear I will not be able to help you on PRO*C, but I can help you find documentation. If you're working with an Oracle 9i Database, go here : "http://www.oracle.com/technology/documentation/oracle9i.html", and download the whole Oracle 9i documentation : "Oracle9i Database Release 2 Documentation Library" (there is also a link to 10g doc). You will find documentation and a Pro*C tutorial in "Pro*C/C++ Precompiler Programmerís Guide" (open "booklist.pdf" once the download is completed).

I hope this will help you,

Re: Newbie with a question. [message #94347 is a reply to message #94342] Mon, 16 August 2004 23:40 Go to previous message
Jai Vrat Singh
Messages: 205
Registered: September 2002
Location: Singapore
Senior Member
(1) Macro is a name given to a peice of code using #define . It gets replaced verbatim by the preprocessor before the actual compilation begins.
-- please read some standard C programming book to get details.
(2) STATIC does not make anything public, but it is opposite. The lifetime of the static vaiable is the whole program but the scope is file scope or function scope if defined inside a function.
NUMSTR may be a typedef in the headers( .h files) which you have not explored but you hae included in your program.
"" is empty string intialization. You can use this to search in the location where you headers as kept.
   grep NUMSTR *&#124grep typedef 

(3) TABLE is a keyword but may be a function call here as it is without an EXEC SQL statement before it.
(4) mode ..something same as NUMSTR.. hidden somewhere in your header files.
Previous Topic: SQLCode = -904
Next Topic: OCILogon - TIMEOUT : HOW TO ?
Goto Forum:

Current Time: Sun Sep 26 22:46:28 CDT 2021