{"id":2302,"date":"2013-06-30T05:31:46","date_gmt":"2013-06-29T19:31:46","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=2302"},"modified":"2023-03-29T07:34:35","modified_gmt":"2023-03-28T21:34:35","slug":"oracle-proc-cursor-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/oracle-proc-cursor-primer-tutorial\/","title":{"rendered":"Oracle Pro*C Cursor Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/ProC\/Cursor\/\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Oracle Pro*C Cursor Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/ProC\/Cursor\/Pro-C_Primer.jpg\" title=\"Oracle Pro*C Cursor Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Oracle Pro*C Cursor Primer Tutorial<\/p><\/div>\n<p>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 <a target=_blank href='http:\/\/www.plsql-tutorial.com\/' title='PL\/SQL Tutorial'>PL\/SQL<\/a>.    For fast speeds as well, add <a target=_blank href='http:\/\/srikanthtechnologies.com\/articles\/oracle\/proc\/getstart.html' title='Pro*C Information'>Pro*C<\/a> (<a target=_blank href='http:\/\/www.bioinfo.uh.edu\/cosc3480\/ProC\/ProC_download.htm' title='Link to a Pro*C++ and\/or Pro*C download site'>Pro*C++<\/a> 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 &#8220;grunt&#8221;.<\/p>\n<p>This tutorial shows you Pro*C and the use of a <a target=_blank title='Database cursor information via Wikipedia' href='http:\/\/en.wikipedia.org\/wiki\/Cursor_%28databases%29'>cursor<\/a> to analyze an SQL SELECT statement&#8217;s data.  We use Visual Studio 2010 Express on Windows and create a C++ project which supports C code.<\/p>\n<p>Below is a bit of Oracle history.<\/p>\n<blockquote><p>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 \u2013 particularly its own brands of database management systems. Oracle is the third-largest software maker by revenue, after Microsoft and IBM.[3]<\/p>\n<p>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.<\/p>\n<p>Larry Ellison, a co-founder of Oracle Corporation, has served as Oracle&#8217;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]<\/p><\/blockquote>\n<p>Let&#8217;s see Oracle link and include directory requirements when used to interface Pro*C to Visual Studio 2010 Express on Windows within this <a target=_blank title='click picture' href='http:\/\/www.rjmprogramming.com.au\/ProC\/Cursor\/'>tutorial<\/a>.<\/p>\n<p>This tutorial builds on the install which happened during <a target=_blank href=\"http:\/\/http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=2248\">Oracle Install PL\/SQL Primer Tutorial<\/a>.<\/p>\n<p>Link to Oracle information &#8230; <a target=_blank title='Oracle information' href='http:\/\/en.wikipedia.org\/wiki\/Oracle_Corporation'>from Wikipedia from which quote above comes<\/a>.<br \/>\nLink to Oracle home &#8230; <a target=_blank title='Oracle Home' href='http:\/\/www.oracle.com\/index.html'>Home of Oracle<\/a>.<br \/>\nLink to Oracle Pro*C &#8230; <a target=_blank title='Oracle downloads' href='http:\/\/docs.oracle.com\/cd\/A97630_01\/win.920\/a96111\/intro.htm'>information<\/a>.<\/p>\n<p>Download Oracle Pro*C .c programming code and rename to  &#8230; <a target=_blank title='Oracle' href='http:\/\/www.rjmprogramming.com.au\/ProC\/Cursor\/Pro-C_Cursor.c_GETME'>Pro-C_Cursor.c<\/a> as required.<br \/>\nDownload Oracle Pro*C .h programming code and rename to  &#8230; <a target=_blank title='Oracle' href='http:\/\/www.rjmprogramming.com.au\/ProC\/Cursor\/Pro-C_Cursor.h_GETME'>Pro-C_Cursor.h<\/a> as required.<\/p>\n<p>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 <a target=_blank title='Pro*C personal experience' href='http:\/\/www.rjmprogramming.com.au\/ProC\/'>webpage<\/a>.  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 <a target=_blank title='Microsoft Visual Studio 2010 Express' href='http:\/\/www.microsoft.com\/visualstudio\/eng\/products\/visual-studio-2010-express'>Visual Studio 2010 Express<\/a> by Microsoft.   Back then the way Pro*C utilized <a target=_blank title='Embedded SQL information from Wikipedia' href='http:\/\/en.wikipedia.org\/wiki\/Embedded_SQL'>embedded SQL<\/a> was very clear.<\/p>\n<p>Two great websites for research on this topic are <a target=_blank title='Pro*C tutorial 1 of 2' href='http:\/\/www.ehow.com\/how_6943222_run-program-visual-studio.html'>How to Run C Program in Visual Studio<\/a> and <a target=_blank title='Pro*C tutorial 2 of 2' href='https:\/\/forums.oracle.com\/message\/11049975?tstart=0'>How do I compile one of C\/C++ Oracle Examples ? (Windows)<\/a> &#8230; 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.\n<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d2302' onclick='var dv=document.getElementById(\"d2302\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?cat=47\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d2302' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>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 &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/oracle-proc-cursor-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,12,37,39],"tags":[299,887,988,997,1319],"class_list":["post-2302","post","type-post","status-publish","format-standard","hentry","category-database","category-elearning","category-tutorials","category-visual-studio","tag-database-2","tag-oracle","tag-proc","tag-programming","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/2302"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=2302"}],"version-history":[{"count":1,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/2302\/revisions"}],"predecessor-version":[{"id":58800,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/2302\/revisions\/58800"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=2302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=2302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=2302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}