Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Basic PRO*C problem

Basic PRO*C problem

From: Patrick Drouin <patrick.drouin_at_remove_this.nortel.com>
Date: Fri, 13 Aug 1999 10:55:54 -0400
Message-ID: <37B431FA.DA63B07A@remove_this.nortel.com>


Hello everyone,

 PRO*C is driving me crasy. I am trying to compile a VERY SIMPLE program that uses a cursor. I've done it in the past and ran into problem but moving some code around fixed it (don't ask why!). Now, it just won't budge.

 PRO*C compiles the C file without any problems but gcc or the Sun compiler will not accept the generated code (I would do the same...). Here's the snippet of my code. Anything wrong with this?

/* We query the USER_PROFILES_CHANGES table */
/* and grab all the entries. The ACTION column */
/* tells us what to do and the status tells us */
/* which rows we need to process. */

 EXEC SQL DECLARE user_list CURSOR FOR

	SELECT user_id, password, action
	FROM USER_PROFILES_CHANGES
	WHERE status=0;

/* Open the cursor we have prepared */

EXEC SQL OPEN user_list;

/* Loop on the cursor and break if empty */
EXEC SQL WHENEVER NOT FOUND DO break; for(;;)
{

   /* Fetch values into our HOST variables */    EXEC SQL FETCH user_list INTO :new_user, :new_user_password, :action;

   printf("%s\t%s\t%s\n",new_user,new_user_password,action); }

/* Close the cursor */

EXEC SQL CLOSE user_list;         

Regards,
Patrick Received on Fri Aug 13 1999 - 09:55:54 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US