看一个建package body的语句:
create or replace package body osm_dml_3sp.osm_tab_packpack7 as
gpck number;
procedure osm_tab_packproctt(f in out number) as
begin
select count(*) into f from osm_dml_3sp.osm_tab_pack;
if f < 8039 then
insert into osm_dml_3sp.osm_tab_pack select * from osm_dml_3sp.osm_tab_pack;
end if;
end osm_tab_packproctt;
begin -- 为初使化部分
insert into osm_dml_3sp.osm_tab_pack(col_0, col_5) values(12140, systimestamp);
gpck := 6048;
end osm_tab_packpack7;
1>>> 感觉设计的很麻烦begin ... end为什么不成对出现.
如:
create package package-name as
-- add pl/sql
end;
为什么不设计成:
create package package-name as
begin
-- add pl/sql
end;
感觉很是麻烦啊!
上面的感觉这样比较好:
create or replace package body osm_dml_3sp.osm_tab_packpack7 as
insert into osm_dml_3sp.osm_tab_pack(col_0, col_5) values(12140, systimestamp); -- 为初使化部分
gpck := 6048;
begin
gpck number;
procedure osm_tab_packproctt(f in out number) as
begin
select count(*) into f from osm_dml_3sp.osm_tab_pack;
if f < 8039 then
insert into osm_dml_3sp.osm_tab_pack select * from osm_dml_3sp.osm_tab_pack;
end if;
end osm_tab_packproctt;
end osm_tab_packpack7;
2>>> as 与 is 不知道什么时候用
create function / procedure / package 中as与is可以混和用, 但为什么cursor中却只可以用is
cursor c1 is select col_0 from aa;
感觉很是奇怪.
不知道设计pl/sql人的怎么想的!!!
阅读(1510) | 评论(0) | 转发(0) |