存储过程创建与调用
时间:2011-12-14
来源:互联网
as
begin
select sysdate into testdae from dual;
dbms_output.put_line('in 参数:'||testchar||'out参数:'||testdae);
insert into b(b,testchar,testtype) values(capablity_seq.nextval,testchar,testdae);
end proc_test;
这是我创建的一个最基本的存储过程,是OK的,但在执行时报错,
执行的方式
execute proc_test(234);
然后就总报错,这个参数应该如何传递啊。。。。。。
作者: ZWJ1988 发布时间: 2011-12-14
declare vs_char varchar2(10) := '234' vd_date date; begin proc_test(vs_char, vd_date); dbms_output.putline(to_char(vd_date,'yyyymmdd')); end;
作者: yixilan 发布时间: 2011-12-14
两个参数,
testchar是传入参数
testdae是传出参数
作者: rainbow_han 发布时间: 2011-12-14
还有异常的捕获也是必须的、
SQL code
/*create or replace procedure proc_test(testchar in number,testdae out date) as begin testdae:=sysdate; dbms_output.put_line('in 参数:'||testchar||'out参数:'||testdae); insert into b(b,testchar,testtype) values(1,testchar,testdae); commit; end proc_test; */ declare my_testdae date; begin proc_test(234,my_testdae); dbms_output.put_line(my_testdae); end ; /*create table b ( b number, testchar number, testtype date )*/ select * from b
作者: lxpbs8851 发布时间: 2011-12-14
作者: lfz860110 发布时间: 2011-12-14
PLS-00103:Encountered the symbol 'TEST'when expection one of the following :=.(@ %;The symbol ":=" was substituted for 'Test' to continus;
这个错误有见过吗???
作者: ZWJ1988 发布时间: 2011-12-14
PLS-00103:Encountered the symbol 'TEST'when expection one of the following :=.(@ %;The symbol ":=" was substituted for 'Test' to continus;
这个错误有见过吗???
出错的过程帖出来啊
作者: lxpbs8851 发布时间: 2011-12-14
但我还是不知道为什么一定要去掉了exec呢???
作者: ZWJ1988 发布时间: 2011-12-14
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28