|
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 message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
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();
}
|
|
|
|