5、量中,必须有一条 记录,否则抛出异常(如果没有记录抛出NO_DATA_FOUND) 例子: BEGIN SELECTcol1,col2into变量1,变量2FROMtypestructwherexxx; EXCEPTION WHENNO_DATA_FOUNDTHEN xxxx; END; ...3.IF判断 IFV_TEST=1THEN BEGIN dosomething END; ENDIF;4.while循环 WHILEV_TEST=1LOOP BEGIN XXXX END;
6、 ENDLOOP;5.变量赋值 V_TEST:=123;6.用forin使用cursor ... IS CURSORcurISSELECT*FROMxxx; BEGIN FORcur_resultincurLOOP BEGIN V_SUM:=cur_result.列名1+cur_result.列名2 END; ENDLOOP; END;7.带参数的cursor CURSORC_USER(C_IDNUMBER)ISSELECTNAMEFROMUSERWHERETYPEID=C_ID; OPENC_USER