Re: database connect in Pro*C

From: Zhao Fu <scip6125_at_leonis.nus.edu.sg>
Date: 28 Dec 1999 09:09:43 GMT
Message-ID: <849uon$i9q$3_at_nuscc.nus.edu.sg>



Hi,

I am trying to run a Pro*C sample program that came with Oracle package, but it gets a connection error. As there is no error message returned from the program, I cannot figure out how to solve this problem. Actually this program worked before we did a system upgrading. We just upgraded our Unix OS from Solaris 2.6 to 2.7. Our Oracle database server 8.0.3 has been running on this unix workstation. In SQL*PLUS, I can connect to the database as usual.

Could anyone advise me how to obtain the error msg and figure out the exact connection error that I got? In the source code of the sample file, there is a function to return the error msg, but it does not work on the connection error. The following is the source code of the function.

void
sql_error(msg)
char *msg;
{

    char err_msg[128];
    size_t buf_len, msg_len;

    EXEC SQL WHENEVER SQLERROR CONTINUE;     printf("\n%s\n", msg);
    buf_len = sizeof (err_msg);
    sqlglm(err_msg, &buf_len, &msg_len);     printf("%.*s\n", msg_len, err_msg);

    EXEC SQL ROLLBACK RELEASE;
    exit(EXIT_FAILURE);

Thank you in advance.

Zhao Fu

 --

--
Received on Tue Dec 28 1999 - 10:09:43 CET

Original text of this message