Pro*C Question

From: Lam Sze Wai <bm_lswaa_at_uxmail.ust.hk>
Date: 1996/12/06
Message-ID: <589hu2$eb5_at_ustsu10.ust.hk>#1/1


After I use proc to generate a "abc.c" file, how can I use cc to link with the oracle library?

My first program always complains that sqlcxt() is undefined. Please tell me where the library path usually is.

My source is as follows:

#include <stdio.h>

EXEC SQL INCLUDE sqlca;
EXEC SQL INCLUDE oraca;
EXEC SQL INCLUDE sqlda;

OpenDb (dbName)
char *dbName;
{

    EXEC SQL BEGIN DECLARE SECTION;
        char *default_login = "/";
    EXEC SQL END DECLARE SECTION;     EXEC SQL CONNECT :default_login;
    if (!sqlca.sqlcode)
    {

        fprintf(stderr, "Cannot connect\n");
        return (sqlca.sqlcode);

    }
 return (0);
}

CloseDb (dbName)
char *dbName;
{

    EXEC SQL COMMIT WORK RELEASE;
    return (sqlca.sqlcode);
}

main()
{

    fprintf(stdout, "Opening database ...\n");     if (OpenDb("data") != 0)

        exit (1);

    fprintf(stdout, "Closing database ...\n");
    CloseDb("data");
    fprintf(stdout, "Done. Exiting ...\n");
} Received on Fri Dec 06 1996 - 00:00:00 CET

Original text of this message