Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re:Pro*C book
Kimberly,
There is a book on C language programming style written by Kerrigan & Richie
(the FATHERS of the language) that I really love. Consequently it's at home
where it can't grow legs. Otherwise I simply use the Pro*C manual from Oracle
and follow the standard that all "EXEC SQL" statements are in uppercase, except
for host variables. Which is the way Oracle teaches it. I've even had some of
my code reviewed by other managers & directors here who have made my ideas the
standards. Pretty simple actually, ask the developers to critique each others
code. The desired results will fall out.
Dick Goulet
PS: Here's an example;
int deltext(void)
{ char efile[100];
int y = 0;
EXEC SQL DECLARE TEXTDEL CURSOR FOR
SELECT PREFIX||TO_CHAR(TO_DATE(:loaddate,'fmDDMONYY'),FORMAT) ||SUFFIX||'.'||EXTENSION FROM TEXT_LOAD_FORMATS WHERE ID = :testerid ORDER BY DECODE(TABLE_TYPE,'HEADER',0,'DATA',1);if(oracle_error("Declare textload cursor")) return(1); EXEC SQL OPEN TEXTDEL;
if(oracle_error("Fetch text load")|| sqlca.sqlcode > 0) break; NULLTERM(fname); sprintf(efile,"%s\\%s\0", testerpath.arr, fname.arr); y = remove(efile); if(y!= 0) break;
____________________Reply Separator____________________ Author: Kimberly Smith <kimberly.smith_at_gmd.fujitsu.com> Date: 2/6/2001 8:20 AM
Just wondering what people are using for a Pro*C reference? I am seeing some pretty bad code here in that area (mostly by a developer who likes to hack and no longer works here but its what people are using for guidelines) and would like to have a reference around that the developers can use. I used to have a copy of the Oracle Press one and it was not to bad. Actually, the manual is not to bad but they don't seem to want to use it.
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Kimberly Smith INET: kimberly.smith_at_gmd.fujitsu.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-LReceived on Tue Feb 06 2001 - 13:27:49 CST
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: dgoulet_at_vicr.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).