Home » Developer & Programmer » Precompilers, OCI & OCCI » Simple One
Simple One [message #93942] Thu, 08 May 2003 11:44 Go to next message
Anand Chiney
Messages: 7
Registered: April 2003
Junior Member
hi

A newbie to Pro*C.
i want to run Pro*C sample examples with 9i on Win 2k.
i dont know how to compile the programs. Can anybody
help me? Thks in adavnce.
Re: Simple One [message #94012 is a reply to message #93942] Sat, 23 August 2003 21:21 Go to previous messageGo to next message
umang
Messages: 4
Registered: August 2003
Junior Member
Hi Anand

if u get answer let me know. my case is same as you, know Oracle, know C and now started Pro *C. Downloaded evedry thing from Oracle.com (ver. 8), created one .pc file, precomplied it, giving errors like var not found. copied code, pl. help me how to complie and run.

char emp_name[[20]];
int emp_number, dept_number;
float salary;

EXEC SQL WHENEVER NOT FOUND DO break;
EXEC ORACLE OPTION (HOLD_CURSOR=NO);

EXEC SQL DECLARE emp_cursor CURSOR FOR
SELECT empno, deptno FROM emp;

EXEC SQL OPEN emp_cursor;
printf(
"Employee Number Departmentn--------------------------n");
for (;;)
{
EXEC SQL FETCH emp_cursor INTO :emp_number, :dept_number;
printf("%dt%dn", emp_number, dept_number);
}

EXEC SQL WHENEVER NOT FOUND CONTINUE;

Thanks i nadvance
Re: Simple One [message #94139 is a reply to message #93942] Tue, 30 March 2004 03:30 Go to previous message
Kaustubh Deshpande
Messages: 32
Registered: March 2004
Member
On windows, You will need to compile Pro*c file (.pc)
with Pro*c compiler. (Procui.exe). It will give u errors, if any, in your program.
If program is fine, it will create [[.c]] file
[[if ur program name is sample.pc then sample.c]]

You also need to have visual studio installed.
Open that [[.c]] file in Visual C++, compile it , it will create [[.exe]] file of your program. Now you can call this exe in any of your program [[frontend]] to execute, or execute directly by clicking on it.

This is one of the way of doing it.

Regards,
Kaustubh
Previous Topic: I'm getting this error message "ORA-01722: invalid number~Error in opening c_fetch_groups CURSOR" wh
Next Topic: Rollback statement closes cursor
Goto Forum:
  


Current Time: Sat May 26 01:29:12 CDT 2018