This discussion is archived
7 Replies Latest reply: Dec 12, 2012 1:41 PM by orafad RSS

pro*C

977839 Newbie
Currently Being Moderated
I'm trying to use the precompiler proc in the instant client nstantclient_11_2 for windows xp and I don't know how to run it.
I don't know wheter it is correct to start the proc from the command line of the client oracle or from the SQL command line, anyway,
what I did is starting the oracle database trough the client and from the command line going in the folder whre the program is: instantclient_11_2\sdk.
Here we have the directory demo, include and lib and also the executable proc and procob, the first one is of our interest.
I tried to run a demo application with:
proc procdemo or proc INAME=procdemo , from the demo directory but the prompt say proc is not an intern command;
I tried to run from sdk directory, because proc is there:
proc procdemo or proc INAME=procdemo,
the prompt say: PCC-F-NOERRFILE, unable to open error message file, facility PR2.

A further doubt is the fact that in the content of the configuration files that are in the admin folder: in the file pcbcfg there is just a line that say:
comp5=yes;
while in the pcscfg there is nothing!

Anyone can help me?
  • 1. Re: pro*C
    943610 Newbie
    Currently Being Moderated
    When properly installed on Windows, proc is automatically added to %Path%.
    It doesnt even require %ORACLE_HOME% .
    Try to download the full client instead of instant client:
    https://www.google.com/search?btnG=1&pws=0&q=%22Oracle+Database%22+%22Client%22+%22for+Microsoft+Windows+%2832-bit%29%22

    when prompted for components to install, choose "OCI" (Call interface), "Oracle programmer" and "sqlplus"

    Then you'll be able to launch proc from the normal windows command prompt.

    Not sure about the demos, but usually you need to have Visual Studio or Windows SDK to compile programs.
  • 2. Re: pro*C
    977839 Newbie
    Currently Being Moderated
    Thanks a lot! I have just some questions.
    In my computer is already installed Oracle Database 11g Release 2 (11.2.0.1.0), the server I think, so during the installation of the client (Oracle Database 11g Release 2 Client) it ask me if I want to repair the existent installation of remove it and reinstall everything, what do I do?
    Does that mean that I woul install the client without the server?
  • 3. Re: pro*C
    orafad Oracle ACE
    Currently Being Moderated
    >
    In my computer is already installed Oracle Database 11g Release 2 (11.2.0.1.0), the server I think,
    Then why add another (huge) Oracle home?

    If Pro*c was not included during install, then add it via custom type in existing home.


    Re Attempt with Instant precomp/pro*c files, did you try pcmake.bat?
    It needs ICHOME set (look in the bat file) and also a VC variable set, from Visual Studio environment. What version of VS are you using for development?
  • 4. Re: pro*C
    977839 Newbie
    Currently Being Moderated
    How do I add Pro*c via custom type in existing home?
    Fo what concern visual studio, it serves in a second time to compile the C code, but first I need to get the C code, converting a .pc file in a .c file and I need the precompiler to do that.
  • 5. Re: pro*C
    943610 Newbie
    Currently Being Moderated
    974836 wrote:
    How do I add Pro*c via custom type in existing home?
    I suggest you first try a separate oracle home, just to see how it should work.
    974836 wrote:
    Fo what concern visual studio, ... but first I need to get the C code, converting a .pc file in a .c file and I need the precompiler to do that.
    It's not a must, but if your .pc file includes header files, it's better when proc can read them too during the precompilation.
    For example, if a structure is declared in a header file, you will be able to use its members in the embedded SQL.
  • 6. Re: pro*C
    977839 Newbie
    Currently Being Moderated
    Sorry!
    I didn't understand how do I add Pro* C via custom type in exisisting home!
    What does it mean try a separate Oracle Home?
    Can you detail what I need to do?
  • 7. Re: pro*C
    orafad Oracle ACE
    Currently Being Moderated
    974836 wrote:
    How do I add Pro*c via custom type in existing home?
    Fire up the OUI / Installer from the already existing home.
    Take a look what components are installed.
    If not there run Installer from installation source, select existing home, and choose components per above "when prompted for components to install, choose "OCI" (Call interface), "Oracle programmer" and "sqlplus".
    Custom installation should allow you to select individual components (over the Admin, Run time, etc. fixed install types).

    But the idea to try a new and complete install (separate home) is not bad. You could do this in a virtual machine for easy "clean up" afterwards.

    Fo what concern visual studio, it serves in a second time to compile the C code, but first I need to get the C code, converting a .pc file in a .c file and I need the precompiler to do that.
    The alternative with IC shoud be easier as far as it does not require use of OUI.
    In Instant Client folder, with the added precomp package, you should find a pcmake.bat file. This bat contains a reference to VS environment setting, done via some script file from VS. That's a requirement of the demo make process. But if you don't need the demo, feel free to ignore it.
    Still I assume you need a compiler and VC/VS is a supported one (if not the only one).

    If anything, the pcmake.bat contents should serve as an example on how to setup for and run proc, solving the issue you had in the first place.

    In the Instant Client "unzip" folder, did you also unzip the instantclient sdk package (adding include, lib and demo files)?

    Edit:
    added pcmake as example

    Edited by: orafad on Dec 12, 2012 10:29 PM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points