Create or Replace procedurePr_first is--a variableV_avarchar2( -) := 'Someday my life will come to an end';--a constantC_B constantvarchar2( -) := 'and you will be crowned king!'; V_XINGM t_hq_ryxx.xingm%Type;type Ty_ry isrecord (v_nianl t_hq_ryxx.nianl%Type,v_gongz Number(Ten,2)); V_ry Ty_ry;v_ryrow t_hq_ryxx%RowType;begin SelectXingm intoV_xingm fromT_hq_ryxxwhereRowNum= 1;d Bms_output.put_line ('protagonist is' ||v_xingm);SelectNianl,gongz intoV_ry fromT_hq_ryxxwhereRowNum= 1;d bms_output.put_line (v_xingm|| 'The Age is' ||V_ry.v_nianl|| ', Wages for' ||V_ry.v_gongz);Select * intoV_ryrow fromT_hq_ryxxwhereRowNum< 2;d Bms_output.put_line ('people:' ||V_ryrow.xingm|| ', Gender:' ||V_ryrow.xingb|| ', Age' ||v_ryrow.nianl);d bms_output.put_line ('the King said to Arthas:' ||V_a|| ',' ||c_b);EndPr_first;
SQL>exec Pr_first; the protagonist is Arzas Alsas's age is 24, salary for 0 people: Sylvanas, Sex:2, Age 24 The King said to Arthas, "Someday My life will come to an end, and you will be crowned king!pl/procedure successfully completed
Ol/sql Programming Exercises