Re: Newbie PL/SQL

From: Givzig <givzig_at_aol.com>
Date: 11 Feb 2001 01:30:54 GMT
Message-ID: <20010210203054.09047.00000394_at_ng-cj1.aol.com>


  1. You don't need to declare the upc_record for the cursor. The for loop does this for you.
  2. You don't need a FETCH as the cursor for loop fetches into each record (upc_record) implicitly. Remove that line.
  3. You should probably add your counter into the cursor, ie. and rownum < 11, or you could still use your exit when upc_cursor%rowcount > 10. BUT, you can't use the upc_cursor%notfound, as it would never be notfound inside this loop.
  4. Your selecting of the upc_number into the local variable will raise an exception if no data is found, so your insert will never execute (in the if condition). It will execute in the exception section though.

All in all, it looks like it would work, if you made a few changes...

good luck. Received on Sun Feb 11 2001 - 02:30:54 CET

Original text of this message