写了一个存储过程:
create or replace procedure ceshi(strdate in out date,enddate in out date) is
--声明局部变量
...
begin
select id,name into t_id,t_name from table where createdate>=strdate and createdate<=enddate;...
end;执行部分都没有任何问题。
现在要调用这个存储过程,用了以下几种方法:
1、
begin
ceshi(strdate => :to_date('2007-03-01','yyyy-mm-dd'),
enddate => :to_date('2007-04-01','yyyy-mm-dd');
end;
2、
declare
strshijian date;
endshijian date;
begin
strshijian:=to_date('2007-03-01','yyyy-mm-dd');
endshijian:=to_date('2007-04-01','yyyy-mm-dd');
ceshi(strdate => :strshijian,
enddate => :endshijian);
end;
3、
declare
strshijian date;
endshijian date;
begin
strshijian:='2007-03-01';
endshijian:='2007-04-01';
ceshi(strdate => :strshijian,
enddate => :endshijian);
end;
4、
begin
ceshi(strdate => :'2007-03-01',
enddate => :'2007-04-01';
end;执行后全都提示:
ora-01036:非法的变量名/编号如果在ceshi存储过程中不带参数,直接在过程内定义赋值strdate、enddate执行却没有一点问题。小弟初学oracle,问题都很幼稚,让大家见笑了!
create or replace procedure ceshi(strdate in out date,enddate in out date) is
--声明局部变量
...
begin
select id,name into t_id,t_name from table where createdate>=strdate and createdate<=enddate;...
end;执行部分都没有任何问题。
现在要调用这个存储过程,用了以下几种方法:
1、
begin
ceshi(strdate => :to_date('2007-03-01','yyyy-mm-dd'),
enddate => :to_date('2007-04-01','yyyy-mm-dd');
end;
2、
declare
strshijian date;
endshijian date;
begin
strshijian:=to_date('2007-03-01','yyyy-mm-dd');
endshijian:=to_date('2007-04-01','yyyy-mm-dd');
ceshi(strdate => :strshijian,
enddate => :endshijian);
end;
3、
declare
strshijian date;
endshijian date;
begin
strshijian:='2007-03-01';
endshijian:='2007-04-01';
ceshi(strdate => :strshijian,
enddate => :endshijian);
end;
4、
begin
ceshi(strdate => :'2007-03-01',
enddate => :'2007-04-01';
end;执行后全都提示:
ora-01036:非法的变量名/编号如果在ceshi存储过程中不带参数,直接在过程内定义赋值strdate、enddate执行却没有一点问题。小弟初学oracle,问题都很幼稚,让大家见笑了!
解决方案 »
- oracle求教外部认证
- 诡异的ora-01400: 无法将 NULL 插入 ("SYSTEM"."HC_RLDYRBMXB_TEMP"."DYBH"
- 在oracle 10g中如何激活iSQL*Plus DBA访问
- oracle 游标使用疑惑
- 帮忙来看这个SQL怎么写?超长SQL代码
- 关于Berkeley DB 的备份 db_dump
- oracle8 到 oracle10g 的问题
- oracle基本的问题
- 急!!!在线求救一个关于视图访问速度的问题
- 各位老大,如何在java中实现如下调用?调用一个package,该package需要传入一个数组,也需要传出一个数组。
- 关于数据库移植的问题??
- 请教SQL如何写?
1、
begin
ceshi(strdate => to_date('2007-03-01','yyyy-mm-dd'),
enddate => to_date('2007-04-01','yyyy-mm-dd');
end;
2、
declare
strshijian date;
endshijian date;
begin
strshijian:=to_date('2007-03-01','yyyy-mm-dd');
endshijian:=to_date('2007-04-01','yyyy-mm-dd');
ceshi(strdate => strshijian,
enddate => endshijian);
end;
3、
declare
strshijian date;
endshijian date;
begin
strshijian:='2007-03-01';
endshijian:='2007-04-01';
ceshi(strdate => strshijian,
enddate => endshijian);
end;
4、
begin
ceshi(strdate => '2007-03-01',
enddate => '2007-04-01';
end;