Home » Developer & Programmer » Precompilers, OCI & OCCI » Why to use Precompilers....................??
icon4.gif  Why to use Precompilers....................?? [message #306820] Mon, 17 March 2008 00:27 Go to next message
Manoj.Gupta.91
Messages: 217
Registered: March 2008
Location: Delhi
Senior Member
Hi All,

I'm new in this forum but I'm experienced with PL/SQL and C. I've something to discuss at first level.

1. Why to use Precompilers like Pro *C, Pro *COBOL etc ?
2. Is there anything that we cannot achieve using PL/SQL so we need precompilers ?
3. Advantages of Pro *C over PL/SQL.
4. Does Pro *C programme creates process at client end and distributes load etc.

Any additional information is highly welcomed and appriciated. Lets make it a discussion point. Once I start with this I'll surely go for Oracle Reference books.

Thanks & Regards
Manoj
Re: Why to use Precompilers....................?? [message #306860 is a reply to message #306820] Mon, 17 March 2008 02:18 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
1. to write your program
2. Yes
3. To do some things you can't in PL/SQL
4. It does what you write it to do. It is just a programming language.

Additional information: Pro*C/C++ Programmer's Guide

Regards
Michel
Re: Why to use Precompilers....................?? [message #306889 is a reply to message #306860] Mon, 17 March 2008 03:05 Go to previous messageGo to next message
Manoj.Gupta.91
Messages: 217
Registered: March 2008
Location: Delhi
Senior Member
Thanks Michel Cadot,

I've 2,3 more questions

1. Where to store Pro *C programme. Like we can have procedures stored in database, local to form, local to report etc.

2. How to create a simple program in Pro *C ?

3. Can I call a Pro *C program from SQL *Plus, Forms, Reports etc. If yes then how ?

4. Can you give me simple steps to create a very simpler programme in Pro *C. Like it is simply selecting count from EMP table.

Will it work ????


#include <stdio.h>
#include <sqlca.h>
void main()
{
EXEC SQL BEGIN DECLARE SECTION;
int emp_count = 0 ;
char *connstr = "scott/tiger";
EXEC SQL END DECLARE SECTION;

EXEC SQL WHENEVER SQLWARNING CONTINUE;
EXEC SQL CONNECT :connstr;

EXEC SQL SELECT COUNT(*)
INTO emp_count
FROM EMP ;

printf("Total Employee = %d\n", emp_count);

}


Thanks & Regards
Manoj

[Updated on: Mon, 17 March 2008 03:15]

Report message to a moderator

Re: Why to use Precompilers....................?? [message #306901 is a reply to message #306889] Mon, 17 March 2008 03:41 Go to previous message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
1. Can you store C program in database?
2. See documentation and demo programs
3. Possible in a very complex way
4. See 2.

It should.

Regards
Michel
Previous Topic: PRO*C
Next Topic: Can't compile Pro*C code with 11g
Goto Forum:
  


Current Time: Fri Dec 09 15:31:37 CST 2016

Total time taken to generate the page: 0.41158 seconds