Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> database connect in Pro*C

database connect in Pro*C

From: Zhao Fu <scip6125_at_leonis.nus.edu.sg>
Date: 28 Dec 1999 08:57:18 GMT
Message-ID: <849u1e$i9q$1@nuscc.nus.edu.sg>


Keywords:database connection, pro*c error

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.

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 - 02:57:18 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US