Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

repetition

Name: Anonymous 2008-09-29 13:09

print "dongs" five times in your favorite language

with extreme conciseness/verbosity

Name: Anonymous 2008-09-30 16:44

CREATE TABLE Dong (
   dongid INTEGER AUTO_INCREMENT,
   dong   VARCHAR2(5),
   PRIMARY KEY(dongid)
);

CREATE OR REPLACE PROCEDURE InsertDongs(numDongs IN INTEGER) AS

   invalidParameter EXCEPTION;

   BEGIN

      IF numDongs IS NULL THEN RAISE invalidParameter
      END IF;
      IF numDongs < 1 THEN RAISE invalidParameter
      END IF;

      FOR i IN 1 .. numDongs LOOP

         INSERT INTO Dong(dong)
         VALUES('dongs');
  
      END LOOP;

      EXCEPTION

         WHEN invalidParameter THEN DBMS_OUTPUT.PUT_LINE('bad paramter recieved');
         WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE(SQLERRM);

   END;
END InsertDongs;

IsertDongs(5);

SELECT dong
FROM   Dong;

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List