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 -> Re: database connect in Pro*C

Re: database connect in Pro*C

From: Zhao Fu <scip6125_at_leonis.nus.edu.sg>
Date: 28 Dec 1999 09:05:29 GMT
Message-ID: <849ugp$i9q$2@nuscc.nus.edu.sg>


Hi, I just forgot to mention, the database connection is all right where I use SQL*PLUS

Zhao Fu (scip6125_at_leonis.nus.edu.sg) wrote:
: 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 - 03:05:29 CST

Original text of this message

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