Home » Developer & Programmer » Precompilers, OCI & OCCI » A Simple Program of Pro*c with Oracle 9i Compatable
A Simple Program of Pro*c with Oracle 9i Compatable [message #94365] Tue, 07 September 2004 02:53 Go to next message
Ravi Khurana
Messages: 2
Registered: September 2004
Junior Member
Hello Guys,
I want A Simple Program. Which makes me easy to Pro*c with Oracle 9i

Thanks,
Ravi
khurana
Re: A Simple Program of Pro*c with Oracle 9i Compatable [message #94397 is a reply to message #94365] Thu, 07 October 2004 00:34 Go to previous messageGo to next message
Srinivas
Messages: 138
Registered: June 2000
Senior Member
The following is a sample Pro*c program.. which prints ename and salary for the employee 7369

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<sqlca.h>
#include<sqlda.h>
#include<sqlcpr.h>
#include<string.h>
typedef char asciiz[[20]];
EXEC SQL BEGIN DECLARE SECTION;
EXEC SQL TYPE asciiz is STRING(20) REFERENCE;
asciiz uname;
asciiz en;
asciiz sal;
EXEC SQL END DECLARE SECTION;
void main()
{
strcpy(uname,"system/sreemaruthi");
EXEC SQL CONNECT :uname;
EXEC SQL select ename,sal into :en,:sal from emp where empno=7369;
printf("%s---%dn",en,sal);
printf("Press any key to exit....");
getch();
}
Re: A Simple Program of Pro*c with Oracle 9i Compatable [message #94400 is a reply to message #94397] Thu, 07 October 2004 02:47 Go to previous message
Kaustubh Deshpande
Messages: 32
Registered: March 2004
Member
Hi,

Include sqlca.h with EXEC SQL command and try

Regards,
Kaustubh
Previous Topic: Compile problem with pro*c in MS VC++ 6.0
Next Topic: URGENT!!! HELP ME Please ... UNABLE to Insert into ORACLE
Goto Forum:
  


Current Time: Sat Aug 08 19:25:17 CDT 2020