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: RC <rclarence_at_tyc.com>
Date: Tue, 28 Dec 1999 16:30:13 GMT
Message-ID: <s6hpclas5k2157@corp.supernews.com>

Zhao Fu wrote:
>
> 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
>
> : --
>
>
> --

 Try posting the .PC file instead of the .c file. The problem may be you need to recompile your PRO C precompiler since you upgraded your OS. I have encountered that problem before since the OS may now have slightly different libraries that need to be linked in.

HTH RC

--
Posted via CNET Help.com
http://www.help.com/ Received on Tue Dec 28 1999 - 10:30:13 CST

Original text of this message

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