Home » Developer & Programmer » Precompilers, OCI & OCCI » How to connect to oracle using 'C'
How to connect to oracle using 'C' [message #93807] Sun, 02 February 2003 13:16 Go to next message
ezhilan
Messages: 5
Registered: February 2003
Junior Member
Sir,I would like to know how to connect to oracle using 'C'.I am also in need of a sample source code.
Also I need a brief description about precompliers.
Re: How to connect to oracle using 'C' [message #93819 is a reply to message #93807] Wed, 05 February 2003 02:18 Go to previous messageGo to next message
Thotakura
Messages: 9
Registered: January 2003
Junior Member
EXEC SQL INCLUDE SQLCA;
EXEC SQL BEGIN DECLARE SECTION;
EXEC SQL END DECLARE SECTION;
void main()
{
EXEC SQL WHENEVER SQL ERROR GOTO error;
EXEC SQL CONNECT :"SCOTT/TIGER@DBNAME";
return;
error:
printf("Error - %s",sqlca.sqlerrm.sqlerrmc);
return;
}
if u want more details about this one contact at my mail id
Re: How to connect to oracle using 'C' [message #93858 is a reply to message #93807] Sat, 22 February 2003 11:26 Go to previous messageGo to next message
Viresh
Messages: 2
Registered: February 2003
Junior Member
i wanted to link my c project with oracle. for this i need a sample source code & a brief discription about pre-compilers.
Re: How to connect to oracle using 'C' [message #94029 is a reply to message #93858] Fri, 17 October 2003 01:49 Go to previous messageGo to next message
hemanta
Messages: 2
Registered: October 2003
Junior Member
Please, let me know from beginning to end how to connect to oracle using 'C' as i am a beginner in this field.Please advice me if any.
Re: How to connect to oracle using 'C' [message #94030 is a reply to message #93819] Fri, 17 October 2003 01:57 Go to previous messageGo to next message
hemanta
Messages: 2
Registered: October 2003
Junior Member
Sir,
I want to know more details about the above mentioned topic.Please let me know with examples.
Re: How to connect to oracle using 'C' [message #94085 is a reply to message #94029] Mon, 19 January 2004 00:03 Go to previous messageGo to next message
kok yew
Messages: 1
Registered: January 2004
Junior Member
thx for ur help...ur help is highly appreciated
Re: How to connect to oracle using 'C' [message #94107 is a reply to message #93858] Sun, 29 February 2004 03:43 Go to previous messageGo to next message
kazanoova2
Messages: 1
Registered: February 2004
Junior Member
i wanted to link my c project with oracle. for this i need a sample source code & a brief discription about pre-compilers.
Re: How to connect to oracle using 'C' [message #94111 is a reply to message #93807] Mon, 01 March 2004 03:07 Go to previous messageGo to next message
Mitesh K. Patel
Messages: 4
Registered: March 2004
Junior Member
i just know that pro*c compiler is required but i am also new to it and infact searching for pro*c compilers , well if u get some more info about it then please do send it to me on : mitesh_26@hotmail.com
Re: How to connect to oracle using 'C' [message #94118 is a reply to message #94111] Wed, 10 March 2004 22:38 Go to previous messageGo to next message
Muthukumar
Messages: 6
Registered: November 1998
Junior Member
How to connecting the c program to Oracle
please send me Explanation
Regard,
Muthukumar
Re: How to connect to oracle using 'C' [message #94177 is a reply to message #94118] Fri, 16 April 2004 05:02 Go to previous messageGo to next message
rishikesh
Messages: 3
Registered: April 2004
Junior Member
Hi Folks,

You could try using OCI to connect to oracle using C.
OCI - Oracle Call Interface.
Its quite powerful...

Try it out..

For further documentation check the Oracle Website.,..

Hope this helps...

Cheers,
Rishi
Re: How to connect to oracle using 'C' [message #94223 is a reply to message #94111] Sun, 23 May 2004 21:02 Go to previous messageGo to next message
Kartikeya
Messages: 1
Registered: May 2004
Junior Member
hi
how we can maintain database in ORACLE of my C project.Is there any other way (other than Pro *C)
Re: How to connect to oracle using 'C' [message #94261 is a reply to message #94118] Wed, 23 June 2004 00:14 Go to previous messageGo to next message
anamika
Messages: 3
Registered: January 2003
Junior Member
how to connect c program with oracle.
Re: How to connect to oracle using 'C' [message #94324 is a reply to message #94261] Tue, 03 August 2004 08:26 Go to previous messageGo to next message
sakthivel
Messages: 2
Registered: August 2004
Junior Member
iam doing project in c and i want to use database oracle and i dont know how to connect pl. give me the reason
Re: How to connect to oracle using 'C' [message #94327 is a reply to message #94324] Wed, 04 August 2004 17:40 Go to previous messageGo to next message
Jai Vrat Singh
Messages: 205
Registered: September 2002
Location: Singapore
Senior Member
#include<sqlca.h>
#include<orca.h> /** this one is not necessary **/

int main()

EXEC SQL BEGIN DECLARE SECTION;
/** declare you host variblee here **/
EXEC SQL BEGIN DECLARE SECTION;

/** This is you connect statement **/

EXEC SQL CONNECT :login IDENTIFIED BY :password ;

..
..
..

return 0;

}

You can find more info in Pro*C documentation avalable on oracle technology network.
Re: How to connect to oracle using 'C' [message #94351 is a reply to message #94261] Wed, 25 August 2004 19:22 Go to previous messageGo to next message
Naveen
Messages: 75
Registered: June 2001
Member
how to connet to oracle using 'c'
can we connect c to orcle in database?
if yes tell me the procedure to do that if no is their any other way.
Re: How to connect to oracle using 'C' [message #94366 is a reply to message #94261] Tue, 07 September 2004 10:25 Go to previous messageGo to next message
shrikant
Messages: 7
Registered: December 2001
Junior Member
hy
Please tell how can i connect C with Oracle8.
send full details.
Re: How to connect to oracle using 'C' [message #94528 is a reply to message #94366] Thu, 06 January 2005 01:23 Go to previous messageGo to next message
M.Lakshmana Rao
Messages: 1
Registered: January 2005
Junior Member
hai

please tell me how to connect to oracle using 'c'
Re: How to connect to oracle using 'C' [message #94530 is a reply to message #94366] Sat, 08 January 2005 05:36 Go to previous messageGo to next message
Aurobindo Naik
Messages: 1
Registered: January 2005
Junior Member
i would like to know how to connect oracle with c/c++.Please dosuggest
Re: How to connect to oracle using 'C' [message #109125 is a reply to message #94107] Tue, 22 February 2005 01:11 Go to previous messageGo to next message
karuppasamy.s
Messages: 1
Registered: February 2005
Junior Member
how to connect the oracle using 'c'language and 'C'
how to write the program using 'C'
Re: How to connect to oracle using 'C' [message #110310 is a reply to message #93807] Sat, 05 March 2005 09:40 Go to previous message
amit_joshi
Messages: 5
Registered: March 2005
Junior Member
Hi all

1. Install Pro*C client from the client installation CD.


2. Check the pre-compiler exists and is present in the path
by typing proc at the prompt

#>proc

3.Go to

$ORACLE_HOME/precomp/demo/proc/
directory and check that the samples are installed.

4.Build the sample executable like

make -f $ORACLE_HOME/precomp/demo/proc/demo_proc.mk build EXE=sample1 OBJS=sample1.o

5.Check whether sample1 runs fine.

6.Refer to Pro*C Precompilers Guide found in the Oracle documentation for additional details.

Best Regards
Amit Joshi
Previous Topic: Problems using OCI in multithreaded environment
Next Topic: Write to file using Pro*C
Goto Forum:
  


Current Time: Mon Aug 10 15:40:44 CDT 2020