The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Access to database/eval command chriss_58 Shell Programming and Scripting 1 06-09-2008 01:05 AM
Help with ms access database and firebird ncatdesigner UNIX for Advanced & Expert Users 0 05-14-2008 07:05 AM
Install Guide: Oracle Database 11g Release 1 on Oracle Enterprise Linux 5 iBot Oracle Updates (RSS) 0 04-06-2008 02:10 AM
Perl Database access mercuryshipzz Shell Programming and Scripting 2 01-15-2008 10:54 PM
microsoft access database on Unix spiderling UNIX for Dummies Questions & Answers 1 03-07-2002 03:43 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-22-2002
Registered User
 

Join Date: Jun 2002
Location: chennai
Posts: 3
C program with Oracle database access

Hey,

I want to access oracle database through Unix C programming.. Can you through me some light on that...
__________________
Life Means More...
Reply With Quote
Forum Sponsor
  #2  
Old 06-23-2002
Registered User
 

Join Date: May 2002
Posts: 3
You need the Oracle Pro*C pre-compiler installed on your development machine. Basically, it allows you to embed SQL commands within your C programs. The pre-compiler simply converts all of the embedded SQL code into pure C code that may then be compiled into an executable. Your source code for Pro*C programs will have an extension of .pc (instead of .c). It works great and performace is outstanding!
Reply With Quote
  #3  
Old 06-23-2002
Registered User
 

Join Date: Jun 2002
Location: chennai
Posts: 3
Thumbs up

If anyother way to access the Oracle database..? Thanks for an Info. Thanks yeslekmc.
__________________
Life Means More...
Reply With Quote
  #4  
Old 07-02-2002
Registered User
 

Join Date: Jul 2002
Location: void
Posts: 53
>If anyother way to access the Oracle database..? Thanks for an Info.
None, unless you yourself want to use the SQLCA, SQLDA, .. libraries, which is what the Precompiler exactly does with your .pc program.
Reply With Quote
  #5  
Old 07-02-2002
Registered User
 

Join Date: Jun 2002
Location: PA
Posts: 17
You can use the statement listed below to login to Oracle. It will run from within a shell script. I use a shell script to tie together several Oracle spool files and other programs

sqlplus -s /nolog @[filename] $var1

Example:

In shell script, prompt user to enter db_usr_name, db_passwd into one shell variable.

echo "Enter Oracle username and password"
stty -echo
read ora_pwd
stty echo

#ora_pwd format = user_name/passwd[@db_link]

sqlplus -s /nolog @spool_file_name $ora_pwd

#Enter this in the first line of the spool file and it will connect to #the Oracle DB.

connect &1.[@db_link]
set headsep !
set term off
set verify off
set colsep ' '
set feedback off
set timing off
set linesize 80
set pagesize 1000
...

Let me know if that helps or if you have any other questions.
Reply With Quote
  #6  
Old 07-12-2002
Registered User
 

Join Date: Jan 2002
Location: India
Posts: 111
You can use OCI ( Oracle Call Interface) functions and libraries within you C/C++ code. This way of implementation is of the lowest level,enabling interaction between C/C++ application and that of Oracle.
__________________
Regards,
Satya Prakash Prasad
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:31 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0