Re: Loop Problem

2002-03-20 Thread Arjen Lentz

Hi Lance,

On Thu, 2002-03-21 at 03:18, Lance Prais wrote:
> Can someone look at this at see what I am doing wrong:
> The following SQL returns to records:
> 50
> 333
> select SC_USER_ID as parmSecurename from CP_USER_COMMENT where SC_ID =
> 107793;
> 
> 
> If I include it in the following loop the result is
> 50
> 333
> 333
> 
> CREATE OR REPLACE Procedure SP_USER_COMMENT_2
> [...]

Looking at the above SQL code, I'm guessing that you are not using
MySQL. Since this is the MySQL mailing list


Regards,
Arjen.


-- 
Get MySQL Training Worldwide, http://www.mysql.com/training/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Mr. Arjen G. Lentz <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Technical Writer, Trainer
/_/  /_/\_, /___/\___\_\___/   Brisbane, QLD Australia
   <___/   www.mysql.com


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Loop Problem

2002-03-20 Thread Lance Prais


Can someone look at this at see what I am doing wrong:
The following SQL returns to records:
50
333
select SC_USER_ID as parmSecurename from CP_USER_COMMENT where SC_ID =
107793;


If I include it in the following loop the result is
50
333
333

CREATE OR REPLACE Procedure SP_USER_COMMENT_2

as

--Set the User SECURE ID
parmSecurename CP_USER_COMMENT.SC_USER_ID%TYPE;
Cursor SC_SECURENAME is select SC_USER_ID as parmSecurename from
CP_USER_COMMENT where SC_ID = 107793;

Begin

Open SC_SECURENAME;
--While SC_SECURE%rowcount < 20
Loop /* Add next three lines */
fetch SC_SECURENAME into parmSecurename;
dbms_output.put_line ('USER ID: '||parmSecurename);
exit when SC_SECURENAME%NOTFOUND;
End LOOP;
Close SC_SECURENAME;
Commit;

End;
/

PLease help

Thank you in advance


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php