呵.还高试过你的用法, 你可以这样呀:when '4' when '5' when '6' then ' ******' else '********' end .. 试试了..
对了还想问一下,case 里面加case行不行也就是下面这样写行不行 case when '1' then case when '11' then ... when '12' then ... end case end case
哪里有下pl/sql存储过程的写法大全之类的书
可以用 when '4'or '5' or '6' then ......... 还有,后面好像不是end case 而是 end
楼上的我这样写有有错“创建的过程带有编译错误” 只能when '4' then when '5' then when '6' then 这样写,还有就是end case 没有错我用的10G可能和你的版本不同有关
我用的是9i,应该差不多吧 我习惯写成 case when my_column='4' or my_column='5' or my_column='6' then .... when ..........then end 呵呵,应该是一样的
在then后面执行多条语句可以有begin。。end 也可以没有 CREATE OR REPLACE PROCEDURE pro1 (id in number)AS begin case when id=1 then insert into aaaa values(id,'aa'); insert into cc values(id,'aa'); else insert into aaaa values(id,'xxx'); end case; commit;END pro1;
你可以这样呀:when '4'
when '5'
when '6'
then ' ******' else '********' end ..
试试了..
case
when '1'
then
case
when '11' then ...
when '12' then ...
end case
end case
when '4'or '5' or '6' then .........
还有,后面好像不是end case 而是 end
只能when '4' then
when '5' then
when '6' then
这样写,还有就是end case 没有错我用的10G可能和你的版本不同有关
我习惯写成
case when my_column='4' or my_column='5' or my_column='6' then ....
when ..........then
end
呵呵,应该是一样的
也可以没有
CREATE OR REPLACE PROCEDURE pro1 (id in number)AS
begin
case when id=1
then
insert into aaaa values(id,'aa');
insert into cc values(id,'aa');
else
insert into aaaa values(id,'xxx');
end case;
commit;END pro1;