Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: database connect in Pro*C
HI,
Until you connect to the database, you
(probably) can't get any Oracle return codes or
messages back.
When I worked in ProC a lot, I would
put a lot of printf statements out to screen
to debug.
I used a connect() function to log onto the database that would return zero for success.
The other potential area that I would look into would be the makefiles. What are all the paths that they use? Do they connect to the database with the same username, and password strings? Did you recompile this program? If the server was upgraded, are all the paths for Oracle the same as before? You may need to modify the makefile.
Good luck,
Argosy
In article <849u1e$i9q$1_at_nuscc.nus.edu.sg>,
scip6125_at_leonis.nus.edu.sg (Zhao Fu) 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
>
> --
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Tue Dec 28 1999 - 08:19:09 CST
![]() |
![]() |