Re: connect oracle 10g DB from C language

From: Nigel Thomas <nigel_cl_thomas_at_yahoo.com>
Date: Fri, 18 Jan 2008 01:41:47 -0800 (PST)
Message-ID: <198952.26702.qm@web58802.mail.re1.yahoo.com>


To use EXEC SQL directives you need to use the PRO*C precompiler before the C compiler.

See http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14407/toc.htm Pro*C/C++ Programmer's Guide 10g Release 2 (10.2)

Reads the introduction first!

If you don't want to use the pre-compiler, you can't use PRO*C directives and embedded SQL - you can use OCI, the Oracle Call Interface, instead - see http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14250/toc.htm.

Certainly, PRO*C is easier to get started with (in my opinion).

Hope that helps

Regards Nigel

  • Original Message ---- From: Shwe Yee Than <shweyeesyt_at_yahoo.com> To: Prasad <p4cldba_at_gmail.com> Cc: oracle-l_at_freelists.org Sent: Friday, January 18, 2008 7:36:58 AM Subject: Re: connect oracle 10g DB from C language

As you suggested, I used the following code in my program:EXEC SQL WHENEVER SQLERROR GOTO error_in_SQL; /* ... */error_in_SQL: /* do error handling */

I got this error:
alpha1.c:12672: error: `EXEC' undeclared (first use in this function)

I also declare the header file: #include <sqlca.h>.

what should i do?? any sugession??

Prasad <p4cldba_at_gmail.com> wrote:
http://infolab.stanford.edu/~ullman/fcdb/oracle/or-proc.html#preprocessor%20directives

On Jan 17, 2008 8:55 PM, Shwe Yee Than <shweyeesyt_at_yahoo.com> wrote:

Hi,

How can I connect to the oracle 10g database from C program code? I want to use EXEC SQL command in the C program. Can anyone help me?

Thanks in advance.

Regards,
Shwe

Looking for last minute shopping deals? Find them fast with Yahoo! Search.

Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
--

http://www.freelists.org/webpage/oracle-l Received on Fri Jan 18 2008 - 03:41:47 CST

Original text of this message