Home » Developer & Programmer » Precompilers, OCI & OCCI » Setting up Pro*C Pre compiler in Windows (Pro*C, Oracle Express Edition 11.2G)
Setting up Pro*C Pre compiler in Windows [message #635398] Sun, 29 March 2015 10:27 Go to next message
Asfakul
Messages: 43
Registered: July 2014
Member
First thing first. I am complete noob when it comes to Setting up environment for working with Pro*C. I want to use Pro* C with Oracle database to develop applications. I will not be able to understand obscure references and jargon related to Pro*C. If possible please give distinct steps I need to follow. Searching on Google couldn't produce any meaningful result.


Thanks in advance. I will be very grateful.
Re: Setting up Pro*C Pre compiler in Windows [message #635401 is a reply to message #635398] Sun, 29 March 2015 11:28 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

First refer to Pro*C/C++ Programmer's Guide
Then there is nothing special to do.
Just be sure that ORACLE_HOME is set and PATH contains %ORACLE_HOME%\lib library.
Also add %OracleHome%\precomp\public in your include path.
Then the Pro*C call is something like (replace %% by your program name and directory, and change and add parameters for your need):
%OracleHome%\bin\proc parse=full mode=ansi iname=%%.pc oname=%%.c lname=%%.lst ltype=short include=%OracleHome%\precomp\public...


E:\Temp\Listing>proc

Pro*C/C++: Release 11.2.0.1.0 - Production on Dim. Mars 29 18:27:30 2015

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

System default option values taken from: %ORACLE_HOME%\precomp\admin\pcscfg.cfg

Option Name    Current Value  Description
-------------------------------------------------------------------------------
auto_connect   no             Allow automatic connection to ops$ account
char_map       charz          Mapping of character arrays and strings
close_on_commitno             Close all cursors on COMMIT
cmax           100            CMAX Value for connection pool
cmin           2              CMIN Value for connection pool
cincr          1              CINCR Value for connection pool
ctimeout       0              CTIMEOUT Value for connection pool
cnowait        0              CNOWAIT Value for connection pool
common_parser  no             Parse using Common SQL Front End
code           ansi_c         The type of code to be generated
comp_charset   multi_byte     The character set type the C compiler supports
config         default        Override system configuration file with another
cpool          no             Support connection pooling
cpp_suffix     *none*         Override the default C++ filename suffix
db2_array      no             Support DB2 array insert/select syntax
dbms           native         v6/v7/v8 compatibility mode
def_sqlcode    no             Generate '#define SQLCODE sqlca.sqlcode' macro
define         WIN32_LEAN_AND_Define a preprocessor symbol
duration       transaction    Set pin duration for objects in the cache
dynamic        oracle         Specify Oracle or ANSI Dynamic SQL Semantics
errors         yes            Whether error messages are sent to the terminal
errtype        *none*         Name of the list file for intype file errors
events         no             Support publish-subscribe event notifications
fips           none           FIPS flagging of ANSI noncompliant usage
header         *none*         Specify file extension for Precompiled Headers
hold_cursor    no             Control holding of cursors in the cursor cache
implicit_svpt  no             Implicit savepoint prior to buffered insert
iname          *none*         The name of the input file
include        *none*         Directory paths for included files
intype         *none*         The name of the input file for type information
lines          no             Add #line directives to the generated code
lname          *none*         Override default list file name
ltype          none           The amount of data generated in the list file
maxliteral     1024           Maximum length of a generated string literal
maxopencursors 10             Maximum number of cached open cursors
max_row_insert 0              Maximum number of rows to buffer on insert
mode           oracle         Code conformance to Oracle or ANSI rules
native_types   no             Support for native float/double
nls_char       *none*         Specify National Language character variables
nls_local      no             Control how NLS character semantics are done
objects        yes            Support object types
oname          *none*         The name of the output file
oraca          no             Control the use of the ORACA
outline        no             Category in which Outlines are created
                              [yes/no/<category name>]
outlnprefix    *none*         Outline name prefix
pagelen        80             The page length of the list file
parse          none           Control which non-SQL code is parsed
prefetch       1              Number of rows pre-fetched at cursor OPEN time
release_cursor no             Control release of cursors from cursor cache
runoutline     no             If yes, create Outlines in the Database
select_error   yes            Control flagging of select errors
sqlcheck       syntax         Amount of compile-time SQL checking
stmt_cache     0              Size of statement cache
sys_include    *none*         Directory where system header files are found
threads        no             Indicates a multi-threaded application
type_code      oracle         Use Oracle or ANSI type codes for Dynamic SQL
unsafe_null    no             Allow a NULL fetch without indicator variable
userid         *none*         A username/password [@dbname] connect string
utf16_charset  nchar_charset  The character set form used by UTF16 variables
varchar        no             Allow the use of implicit varchar structures
version        recent         Which version of an object is to be returned
win32_threads  no             Support windows default local threading
PCC-F-02135, CMD-LINE:  User asked for help

Re: Setting up Pro*C Pre compiler in Windows [message #635402 is a reply to message #635401] Sun, 29 March 2015 13:27 Go to previous messageGo to next message
Asfakul
Messages: 43
Registered: July 2014
Member
Thanks Michel. I gone through the documentation. It's very useful but unless I set up my machine to compile ProC code , it will not be that much useful.

Can you please name some executable that I need to install to make the environment ready for ProC. Also what will be command to compile a ProC program in Windows.I know I can use make -f sample.mks program_name in Linux but I dont know what it's in Windows.
Re: Setting up Pro*C Pre compiler in Windows [message #635403 is a reply to message #635402] Sun, 29 March 2015 13:36 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Run OUI (Oracle Universal Installer) from Oracle Client download and choose "Developer" install and take care that precompilers are checked.

Now how you compile a C program in Windows depends on your programming tool. It is independent to Oracle.
Oracle proc converts Pro*C program (.pc) to C one (.c).

There is no C compiler pre-installs on Windows and no make either (but you can find both on the web).

Re: Setting up Pro*C Pre compiler in Windows [message #635404 is a reply to message #635403] Sun, 29 March 2015 13:42 Go to previous message
Asfakul
Messages: 43
Registered: July 2014
Member
Okay understood, I will give it a go and will get back to you.. thanks .
Previous Topic: Pro*C migration from Solaris to RHEL
Next Topic: OCI and Threaded applications
Goto Forum:
  


Current Time: Thu Mar 28 04:22:30 CDT 2024