Re: Pro*C Question
Date: Sat, 23 Oct 2004 02:11:02 GMT
Message-ID: <W4jed.34596$cr4.22157_at_edtnps84>
paddy_nyr wrote:
> I'm new to Pro*C/C in general so can anyone give me some insite on where I
> might be going wrong?
> This is old code that I'm trying to modify.
Pro*C is a precompiler that turns embedded SQL into C based on a strigent set of rules. Those rules are documented in Oracle supplied documents such as
Pro*C/C++ Precompiler Getting Started for Windows Pro*C/C++ Precompiler Programmer's Guide
found at http://www.oracle.com/pls/db92/db92.docindex?remark=homepage for Oracle9i Release 2 (for other versions, look at http://docs.oracle.com)
In addition to Pro*C you can code to the Oracle Call Interface (basically the 'raw' Oracle C API)
Oracle C++ Call Interface Programmer's Guide Oracle Call Interface Developer's Guide for Windows Oracle Call Interface Programmer's Guide
You can also get examples and demos of each from the $ORACLE_HOME/oci/demo and $ORACLE_HOME/precomp/demo/proc directories.
However, I'm surprised that the sample you provided even compiled to the point that you were able to get meaningful interaction. Did you cut & paste, or just transcribe?
Under normal Pro*C, I would have expected a login section and a section like
EXEC SQL SELECT reptyp INTO :reportType FROM reps_tab;
Also, you might want to check your C-language reference manual for string comparisons. One useful reference book I'd recommend (used it for years) is at http://www.amazon.com/exec/obidos/ASIN/0070296898/
/Hans Received on Sat Oct 23 2004 - 04:11:02 CEST