Categories:
.NET (961)
C (387)
C++ (185)
CSS (84)
DBA (8)
General (31)
HTML (48)
Java (641)
JavaScript (220)
JSP (109)
JUnit (31)
MySQL (297)
Networking (10)
Oracle (562)
Perl (48)
Perl (9)
PHP (259)
PL/SQL (140)
RSS (51)
Software QA (28)
SQL Server (5)
Struts (20)
Unix (2)
Windows (3)
XHTML (199)
XML (59)
Other Resources:
How To Use "FOR" Statements
How To Use "FOR" Statements? - Oracle DBA FAQ - Understanding PL/SQL Language Basics
✍: FYIcenter.com
If you have a block of codes to be executed repeatedly over a range of values, you can use the "FOR ... LOOP" statement. Here is a sample script on FOR statements:
DECLARE total NUMBER := 0; BEGIN FOR i IN 1..10 LOOP total := total + i; END LOOP; DBMS_OUTPUT.PUT_LINE('Total: ' || TO_CHAR(total)); END;
Note that temporary variable "i" used in the FOR loop needs no declaration. This script should print this:
Total: 55
2007-04-29, 4691👍, 0💬
Popular Posts:
How To View All Columns in an Existing Table? - Oracle DBA FAQ - Managing Oracle Database Tables If ...
How To Return the Second 5 Rows? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries If yo...
How To Merge Values of Two Arrays into a Single Array? - PHP Script Tips - PHP Built-in Functions fo...
What’s difference between HashTable and ArrayList ? You can access array using INDEX value of array,...
How was XML handled during COM times? During COM it was done by using MSXML 4.0. So old languages li...