给了已大堆错误信息,如下:
=======================================
Compilation errors for PROCEDURE SDSPADMIN.PR_SELECTDATAError: PLS-00103: 出现符号 "TABLENAME"在需要下列之一时:
( ; is with authid as
cluster compress order using compiled wrapped external
deterministic parallel_enable pipelined
符号 "is" 被替换为 "TABLENAME" 后继续。
Line: 2
Text: tablename varchar2(50);Error: PLS-00103: 出现符号 "AS"在需要下列之一时:
begin function package
pragma procedure subtype type use <an identifier>
<a double-quoted delimited-identifier> form current cursor
Line: 4
Text: asError: PLS-00103: 出现符号 "="在需要下列之一时:
constant exception
<an identifier> <a double-quoted delimited-identifier> table
LONG_ double ref char time timestamp interval date binary
national character nchar
符号 "<an identifier>" 被替换为 "=" 后继续。
Line: 7
Text: strsql := 'select '||columnname||' from '||tablenameError: PLS-00103: 出现符号 "EXECUTE"在需要下列之一时:
. ( * @ % & = - + ; < /
> at in is mod not rem <an exponent (**)> <> or != or ~= >=
<= <> and or like between ||
Line: 8
Text: execute immediate strsql;
=======================================
Compilation errors for PROCEDURE SDSPADMIN.PR_SELECTDATAError: PLS-00103: 出现符号 "TABLENAME"在需要下列之一时:
( ; is with authid as
cluster compress order using compiled wrapped external
deterministic parallel_enable pipelined
符号 "is" 被替换为 "TABLENAME" 后继续。
Line: 2
Text: tablename varchar2(50);Error: PLS-00103: 出现符号 "AS"在需要下列之一时:
begin function package
pragma procedure subtype type use <an identifier>
<a double-quoted delimited-identifier> form current cursor
Line: 4
Text: asError: PLS-00103: 出现符号 "="在需要下列之一时:
constant exception
<an identifier> <a double-quoted delimited-identifier> table
LONG_ double ref char time timestamp interval date binary
national character nchar
符号 "<an identifier>" 被替换为 "=" 后继续。
Line: 7
Text: strsql := 'select '||columnname||' from '||tablenameError: PLS-00103: 出现符号 "EXECUTE"在需要下列之一时:
. ( * @ % & = - + ; < /
> at in is mod not rem <an exponent (**)> <> or != or ~= >=
<= <> and or like between ||
Line: 8
Text: execute immediate strsql;
tablename varchar2(50);
columnname varchar2(50);
strsql varchar2(1000);
begin
--这里列名和表名是什么?
strsql := 'select '||columnname||'from'||tablename
execute immediate strsql;
end;
execute immediate str into v_coldata;
create or replace procedure pr_DelTable
tablename in varchar2(50);
as
begin
strsql varchar2(1000);
strsql := 'delete from '||tablename
execute immediate strsql;
end;
比如我想传递一个表名的参数,存储过程执行删除该表数据的功能,这么写对么
as
strsql varchar2(1000);
begin
strsql:='select '||columnname||' from '||tablename;
execute immediate strsql;
end;