create or replace function Test04(sCustomerID varchar2,sType varchar2)
return varchar2 is
Result varchar(20);
s1 varchar(20);
s2 varchar(20);
s3 varchar(20);
begin
--下面有多个值,报错
select CustomerID into s1 from CUSTOMER_RELATIVE
where Relativeid=sCustomerID
and RelationShip ='0107'
;
--1个值
select CustomerID into s2 from customer_info
where customerid=sCustomerID;
if(sType=1) then
s3:=s1;
else
s3:=s1+s2;--我需要的是前面2个合起来的结果,着句也有问题
end if; select sum(gethistorybalance(BP.LoanAccount,to_char(sysdate,'yyyy/mm/dd'),'AllBalance',BP.BusinessNo,BP.PutOutNo)) into Result
from business_putout bp
where applicantid in ( s3);--得到的在着,再次计算
return(Result);
end ;
return varchar2 is
Result varchar(20);
s1 varchar(20);
s2 varchar(20);
s3 varchar(20);
begin
--下面有多个值,报错
select CustomerID into s1 from CUSTOMER_RELATIVE
where Relativeid=sCustomerID
and RelationShip ='0107'
;
--1个值
select CustomerID into s2 from customer_info
where customerid=sCustomerID;
if(sType=1) then
s3:=s1;
else
s3:=s1+s2;--我需要的是前面2个合起来的结果,着句也有问题
end if; select sum(gethistorybalance(BP.LoanAccount,to_char(sysdate,'yyyy/mm/dd'),'AllBalance',BP.BusinessNo,BP.PutOutNo)) into Result
from business_putout bp
where applicantid in ( s3);--得到的在着,再次计算
return(Result);
end ;
解决方案 »
- Oracle Enterprise Manager无法启动,oracle11密码过期
- 小弟刚学ORACLE 在写一个飞常简单的存储过程都有一个错误大哥们进来给俺说说吧 小弟在这谢谢了
- pro c中时间数据问题?
- 请教一个SQL,有关树状结构的
- oracle9i 在windows 上面有没有2G或者几G (大文件)的问题
- sqlnet.ora文件中的:SQLNET.AUTHENTICATION_SERVICES= (NTS) 是什么意思呀?
- 通过网络访问Oracle,在客户端该怎么配置?
- oracle中日期的计算
- 游标是否能存放多个结果集?
- PLSQL 系统变量的值
- 下面语句是什么问题,急!
- 可以用一个SQL语句实现吗!~
我需要把customerid先计算出来,因为实际的sql比较长
希望大侠们回答下!谢谢!
我马上试下
实际上主要的怎么把2个结果连起来,实际SQL比较长,不好用union来连
Line: 10
Text: select s1=CustomerID from CUSTOMER_RELATIVEError: PL/SQL: SQL Statement ignored
Line: 10
Text: select s1=CustomerID from CUSTOMER_RELATIVEError: PL/SQL: ORA-00923: 未找到预期 FROM 关键字
Line: 14
Text: select s2:=CustomerID from customer_infoError: PL/SQL: SQL Statement ignored
Line: 14
Text: select s2:=CustomerID from customer_info
楼上的,不可以啊!我的是oracle 8i
我需要的是前面2个sql结果的和