Oracle databases are great in design and in their range of software tools. The SQL is great and their command line tool SQL*Plus makes the creation of procedures around a job, especially reporting type jobs, very easy. Oracle SQL Developer is a great user-friendly application to enhance the Oracle suite of software to help maintain Oracle databases. You can do reports straight from a view of the database with ordinary SQL and if it asks for more drilling down, Oracle has this great procedural SQL language called PL/SQL. For fast speeds as well, add Pro*C (Pro*C++ these days) into the mix. Pro*C(++) embeds SQL code into your C(++) code making use of cursors and other database smarts. Oracle is such a solid database, different arrangements of which work with large and small amounts of computing “grunt”.
This tutorial shows you Pro*C and the use of a cursor to analyze an SQL SELECT statement’s data. We use Visual Studio 2010 Express on Windows and create a C++ project which supports C code.
Below is a bit of Oracle history.
Oracle Corporation is an American multinational computer technology corporation headquartered in Redwood City, California, The United States. The company specializes in developing and marketing computer hardware systems and enterprise software products – particularly its own brands of database management systems. Oracle is the third-largest software maker by revenue, after Microsoft and IBM.[3]
The company also builds tools for database development and systems of middle-tier software, enterprise resource planning software (ERP), customer relationship management software (CRM) and supply chain management (SCM) software.
Larry Ellison, a co-founder of Oracle Corporation, has served as Oracle’s CEO throughout its history. He also served as the Chairman of the Board until his replacement by Jeffrey O. Henley in 2004. On August 22, 2008, the Associated Press ranked Ellison as the top-paid chief executive in the world.[4][5]
Let’s see Oracle link and include directory requirements when used to interface Pro*C to Visual Studio 2010 Express on Windows within this tutorial.
This tutorial builds on the install which happened during Oracle Install PL/SQL Primer Tutorial.
Link to Oracle information … from Wikipedia from which quote above comes.
Link to Oracle home … Home of Oracle.
Link to Oracle Pro*C … information.
Download Oracle Pro*C .c programming code and rename to … Pro-C_Cursor.c as required.
Download Oracle Pro*C .h programming code and rename to … Pro-C_Cursor.h as required.
My personal experience writing Pro*C in a commercial environment goes back a bit and you will see how Pro*C has changed a lot by examining links at this webpage. In those days you would write .pc files of code, which would be put through a precompiling process by proc.exe, but none of this happened getting this tutorial together interfacing to Visual Studio 2010 Express by Microsoft. Back then the way Pro*C utilized embedded SQL was very clear.
Two great websites for research on this topic are How to Run C Program in Visual Studio and How do I compile one of C/C++ Oracle Examples ? (Windows) … thanks a lot! The implication of the first is that, yes, you can write C in a Visual Studio C++ project if you arrange that project the correct way.
If this was interesting you may be interested in this too.
13 Responses to Oracle Pro*C Cursor Primer Tutorial