Oracle bubbling
DECLARE
TYPE num_tt IS TABLE OF INT
Num_t num_tt:=num_tt ()
Mid_val INT
BEGIN
Num_t.extend (20)
FOR i IN 1..20 LOOP
Num_t (I): = trunc (dbms_random.value (2005100000))
END LOOP
Dbms_output.put_line ('before sort:')
FOR i IN 1..num_t.count LOOP
Dbms_output.put_line (num_t (I) | |',')
END LOOP
FOR i IN REVERSE 1..num_t.count-1 LOOP
FOR j IN 1..i LOOP
IF (num_t (j) > num_t (juni1)) THEN
Mid_val: = num_t (j)
Num_t (j): = num_t (juni1)
Num_t (jacks 1): = mid_val
END IF
END LOOP
END LOOP
Dbms_output.put_line ('after sort:')
FOR i IN 1..num_t.count LOOP
Dbms_output.put_line (num_t (I) | |',')
END LOOP
END