下面是一个sql server2005的存储过程中的一条语句
select @khbhlen=convert(int,csz) from dz_xtcs where cslb=22 and csxh=4
我要把这条语句改成Oracle存储过程,改后如下:
select to_number(SVALUE) into t_sclientidlen from btc_syspar where IPARTYPE=22 and IPARID=4;
但是调试的时候报错,错误信息如下:
Error: PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
begin function package pragma procedure subtype type use
<an identifier> <a double-quoted delimited-identifier> form
current cursor
The symbol "begin" was substituted for "SELECT" to continue.
请问大家,应该怎样改啊
select @khbhlen=convert(int,csz) from dz_xtcs where cslb=22 and csxh=4
我要把这条语句改成Oracle存储过程,改后如下:
select to_number(SVALUE) into t_sclientidlen from btc_syspar where IPARTYPE=22 and IPARID=4;
但是调试的时候报错,错误信息如下:
Error: PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
begin function package pragma procedure subtype type use
<an identifier> <a double-quoted delimited-identifier> form
current cursor
The symbol "begin" was substituted for "SELECT" to continue.
请问大家,应该怎样改啊
解决方案 »
- oracle stream 删除队列的 疑难杂症………………要长……要……长
- Oracle rac 安装clusterware 出错oui-25031错误。请大虾赐教。
- Sqlserver的存储过程如何变成在Oracle下可以执行的
- rac环境DBID跟SID怎么回事,不了解,问下,谢谢了!
- 请问Oracle库最大容量,单个表最大容量,单个表在最大容量下查询所有记录所用时间 和查询时的服务器配置(急)?
- Oracle中的SELECT语句的一个关于AS的问题
- 机制
- sql查询合计横排
- 请大家翻译几句关于系统恢复的文档
- 为什么有这个错误?
- 求教各位大哥:复合索引创建规则是什么?
- SQL全称选择写法
SVALUE是什么类型的,如果是int类型不需要to_number;
把你完整代码贴出来。
sql server的
declare @khbhlen int
select @khbhlen=convert(int,csz) from dz_xtcs where cslb=22 and csxh=4
declare @usesysclientno int
select @usesysclientno=convert(int,csz) from dz_xtcs where cslb=22 and csxh=11Oracle的
declare t_sclientidlen number;
select to_number(SVALUE) into t_sclientidlen from btc_syspar where IPARTYPE=22 and IPARID=4;
declare t_sysclientno number;
select to_number(SVALUE) into t_sysclientno from btc_syspar where IPARTYPE=22 and IPARID=11;
svalue是varchar类型的。。
放到begin段不能再变量定义中
...
begin
..
Exception
..
end;declare和Exception可以没有,但begin..end必须有.
SELECT TO_NUMBER(CSZ) FROM DZ_XTCS WHERE CSLB=22 AND CSXH=11;-- 如果SELECT返回1个值:
SELECT TO_NUMBER(CSZ) INTO T_SYSCLIENTNO FROM DZ_XTCS WHERE CSLB=22 AND CSXH=11;
-- T_SYSCLIENTNO 要在DECLARE后面定义.DECLARE
...
T_SYSCLIENTNO NUMBER := 0;
...
BEGIN
...
END;