如:
先定义: 变量1
然后写的存储过程中要包含:
select count(*) from table1 where newsid=变量1该如何编写啊
先定义: 变量1
然后写的存储过程中要包含:
select count(*) from table1 where newsid=变量1该如何编写啊
解决方案 »
- oem问题
- 我现在有一个Orcal 10g 有一个 *.dmp 请问如何把*.dmp 弄到Orcal 10g里
- 数据库开发工程师如何写好详细设计说明书啊?
- 在secureCRT中执行SQLPLUS显示-bash: sqlplus: command not found怎么办
- 初学者问题:要在自己的机上安装pl/sql developer连服务器的oracle9i,要先装什么?oracle9i客户端吗?
- 超级水问题!在sql脚本中两个创建视图语句用;隔开为什么被系统认为是非法字符!
- Oracle9i装不上呀!!!!急!!!
- 有关临时表问题(请帮忙从一个SQLServer 2000的一个语句改到Oracle中来)
- ORACLE下创建一个新的资料库时,为何每次都说无法处理服务名?--急!
- primary库上有如下归档信息,目录去哪里查?
- 询问一条sum查询相关查询语句,急
- 急求:两个数据库间不同表的部分数据同步问题求解
select count(*) from table1 where newsid=变量1我该如何编写含有上面语句的存储过程啊???????
procedure getcount(ID in number)
is
begin
select count(*) from t
end getcount
procedure getcount(ID out number)
is
i number;
begin
select count(*) into i from t where ID= ID;
if i>0 then
ID:=i;
else
ID:=0;
end if;
end getcount
IS
i NUMBER;
BEGIN
SELECT COUNT (*)
INTO i
FROM t
WHERE ID = ID; IF i > 0
THEN
ID := i;
ELSE
ID := 0;
END IF;
END getcount;
create or replace getcount
(ID OUT NUMBER)
IS
i NUMBER;
BEGIN
SELECT COUNT (*)
INTO i
FROM t
WHERE ID = ID; IF i > 0
THEN
ID := i;
ELSE
ID := 0;
END IF;