Re: PRO*C/C++ for AIX

From: Steve <stephenlmitchell_at_tiscali.co.uk>
Date: Wed, 9 Jan 2002 16:03:46 -0000
Message-ID: <3c3c69a8_3_at_mk-nntp-1.news.uk.worldonline.com>


[Quoted] Use the standard make file that comes with the Pro*C installation.

You can find it in the following directory (if memory serves me right, I'm on a NT site at the moment).

$ORACLE_HOME/precomp/demo/proc.mk

This file should contain the line:

include $(ORACLE_HOME)/precomp/lib/env_precomp.mk

Copy this file to your working directory.

If your Pro*C code is called mycode.pc build and executable as follows

make -f proc.mk build OBJS=mycode.o EXE=mycode

"andrija" <ar35644_at_fer.hr> wrote in message news:a1hmnh$b4tr$1_at_as201.hinet.hr...
> Is there any tutorial for PRO*C/C++ for AIX? I'm trying to compile one
> simple program i wrote, but I don't know how to compile it. Oracle's
> documentation is very poor (PRO*C/C++ guide says to check system specific
> documentation, and system specific documentation says to check PRO*C/C++
> guide).
>
> Here is my program:
>
> #include <stdio.h>
> #include <string.h>
> #include <stdlib.h>
> #include <sqlda.h>
> #include <sqlcpr.h>
>
> struct {
> VARCHAR key[11];
> VARCHAR data[11];
> } d1;
>
> struct {
> short key;
> short data;
> } d2;
>
> #include <sqlca.h>
>
> VARCHAR user[10];
> VARCHAR pass[10];
>
> void main() {
>
> strncpy((char *) user.arr,"SCOTT",10);
> user.len = (unsigned short) strlen((char *) user.arr);
>
> strncpy((char *) pass.arr, "TIGER", 10);
> pass.len = (unsigned short) strlen((char *) pass.arr);
>
> EXEC SQL CONNECT :user IDENTIFIED BY :pass;
>
> EXEC SQL SELECT key_item, data_item
> INTO :d1 INDICATOR :d2
> FROM t2;
>
> d1.key.arr[d1.key.len]='\0';
> d1.data.arr[d1.data.len]='\0';
>
> printf("%s %s",d1.key.arr,d1.data.arr);
>
> EXEC SQL ROLLBACK WORK RELEASE;
> }
>
>
Received on Wed Jan 09 2002 - 17:03:46 CET

Original text of this message