File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
looking for help re writing a for-loop
Joined: Apr 04, 2009
Mar 09, 2011 10:59:18
Here is the for loop:
FOR i IN 1..p_import_lines.COUNT LOOP IF p_import_lines(i).part_number IS NOT NULL AND p_import_lines(i).orig_sys_header_ref = rec.orig_sys_document_ref AND p_import_lines(i).part_number = rec.ordered_item THEN v_line_tbl(j).orig_sys_line_ref := p_import_lines(i).orig_sys_line_ref; END IF; END LOOP;
I would like the loop to end once the IF statement inside of it evaluates to true (or once v_line_tbl(i).orig_sys_line_ref is no longer NULL, same difference).
I know there is a simple way to accomplish this from the tutorials I used to teach myself pl sql, but I have not found it and cannot remember it.
Can anyone point me in the right direction please?
I was trying EXIT LOOP; this whole time and could not fogure out why it was not working hahaha
True wisdom is in knowing you know nothing - Socrates
Joined: Jan 24, 2006
Mar 09, 2011 15:41:46
you can also code EXIT WHEN conition to accomplish the same thing.
I agree. Here's the link:
subject: looking for help re writing a for-loop
Problem with Namespace Prefixes with Axis1 but not Axis2
Exiting for loop using JOptionPane
didnt get this line of code?
How to execute PL/SQL program from Java?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014