oracle 第一课 :集合
1:
varray
sql>set serverout on
sql>declare --定义一个可以存放64字段的数组
type column_type is varray(64) of varchar2(50);---用来放字段类型的数组类型
var_columnname column_type;
var_column column_type;
begin
var_columnname:=column_type('一、免税所得','国债利息所得',' 免税的补贴收入',
' 免税的纳入预算管理的基金、收费或附加','免于补税的投资收益','免税的技术转让收益',
' 免税的治理“三废”收益',' 种植业、养殖业及农林产品初加工所得',' 其他免税所得'
);
var_column:=column_type('MSSD','GZLXSD','MSBTSR','MSNRYSGL','MYBSTZSY','MSJSZRSY',
'MSZLSFSY','ZZYYZYNLCPCJGSD','MSQT','JMS','GXJSQYJSJB','GXJSKFQ',
'RJJCDL','FYLKYJG','KYJGZZQY','QXJSQYQT',
'JCSSJSJM','GLQYYHJM','XBDKF','XQDS',
);
for i in 1..var_columnname.count() loop
dbms_output.put_line(var_columnname(i));
end loop;
end;
/
遍历出所有初始的值
1:
varray
sql>set serverout on
sql>declare --定义一个可以存放64字段的数组
type column_type is varray(64) of varchar2(50);---用来放字段类型的数组类型
var_columnname column_type;
var_column column_type;
begin
var_columnname:=column_type('一、免税所得','国债利息所得',' 免税的补贴收入',
' 免税的纳入预算管理的基金、收费或附加','免于补税的投资收益','免税的技术转让收益',
' 免税的治理“三废”收益',' 种植业、养殖业及农林产品初加工所得',' 其他免税所得'
);
var_column:=column_type('MSSD','GZLXSD','MSBTSR','MSNRYSGL','MYBSTZSY','MSJSZRSY',
'MSZLSFSY','ZZYYZYNLCPCJGSD','MSQT','JMS','GXJSQYJSJB','GXJSKFQ',
'RJJCDL','FYLKYJG','KYJGZZQY','QXJSQYQT',
'JCSSJSJM','GLQYYHJM','XBDKF','XQDS',
);
for i in 1..var_columnname.count() loop
dbms_output.put_line(var_columnname(i));
end loop;
end;
/
遍历出所有初始的值