create or replace procedure getData(tabelName in varchar2,myCursor out sys_refcursor)
as
begin
open myCursor for select * from tabelName;
exception
when others then
dbms_output.PUT_LINE(sqlcode||','||sqlerrm);
end getData;编译提示:表或视图不存在,tabelName换成emp就可以,但是如果我要取表名为传入参数的值,要怎么写才行
as
begin
open myCursor for select * from tabelName;
exception
when others then
dbms_output.PUT_LINE(sqlcode||','||sqlerrm);
end getData;编译提示:表或视图不存在,tabelName换成emp就可以,但是如果我要取表名为传入参数的值,要怎么写才行
解决方案 »
- 请问INIT.ORA INIT<SID>.ORA SPFILE<SID>.ORA之间到底是什么关系??
- Merge, connect by 语句的意思
- 高手们看下实际开发中低效的SQL语句,希望能提出优化意见,谢谢
- spool到文件时,如果使用变量控制文件的路径和文件名
- 我的XP机器怎么安装不了Oracle数据库?
- 一个SQL语句的问题,纠结我好几天了,还望高手给个了断...
- 怎么写这个SQL语句!!!!!
- 关于ORACLE 9I的 initSID.ora文件的位置.
- 求救:ORACLE出错:“无法从本地计算机启动OracleServiceTEST000R服务”
- proc*c中对多个数据库里的多个表格查询,如何写?
- 取制定月份的天数
- oracle 中 sql DROP 如何批量删表 包含已存在和不存在的表
as
begin
open myCursor for select * from tabelName;
exception
when others then
dbms_output.PUT_LINE(sqlcode ¦ ¦',' ¦ ¦sqlerrm);
end getData;
create or replace procedure getData(tabelName in varchar2,myCursor out sys_refcursor)
as
str varchar2(200);
begin
str:='select * from '||tabelName ;
open myCursor for str;
exception
when others then
dbms_output.PUT_LINE(sqlcode ¦ ¦',' ¦ ¦sqlerrm);
end getData;