![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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... |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
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!
|
|
#3
|
|||
|
|||
|
If anyother way to access the Oracle database..? Thanks for an Info. Thanks yeslekmc.
__________________
Life Means More... |
|
#4
|
|||
|
|||
|
>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. |
|
#5
|
|||
|
|||
|
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. |
|
#6
|
|||
|
|||
|
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 |
|||
| Google The UNIX and Linux Forums |