码迷,mamicode.com
首页 > 数据库 > 详细

oracle snake_trian

时间:2015-05-08 15:10:34      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:oracle

DECLARE

   TYPE arr1_tt IS TABLE OF INT INDEX BY PLS_INTEGER;

   TYPE arr2_tt IS TABLE OF arr1_tt INDEX BY PLS_INTEGER;

   arr2_inst arr2_tt;

   ROW INT := 1;

   col INT := 1;

   tmprow INT := 0;

   tot INT := 0;

BEGIN

  WHILE(ROW<=5) LOOP

    col := 1;

    tmprow := ROW;

    WHILE(col<=ROW) LOOP

       tot := tot + 1;

       arr2_inst(tmprow)(col) := tot;

       tmprow := tmprow-1;

       col := col + 1;

     END LOOP;

    ROW := ROW + 1;

  END LOOP;

  FOR i IN 1..arr2_inst.count LOOP

    FOR j IN 1..arr2_inst(i).count-i+1 LOOP

       dbms_output.put_line(arr2_inst(i)(j)||‘‘);

    END  LOOP;

 END LOOP;

END;


  


oracle snake_trian

标签:oracle

原文地址:http://friendsforever.blog.51cto.com/3916357/1649549

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!