在ASP程序中使用存储过程时,发生了这个错误:引数中可能发生类型错误
  dim objCmd
set objCmd =server.createobject("adodb.command")   
objCmd.ActiveConnection= cn
objCmd.CommandText="update_total_quantity"  
objCmd.CommandType=adCmdStoredProc
objCmd.execute  存储过程如下
create or replace procedure update_total_quantity as
num number;
begin
select count(*) into num from user_tables where table_name =upper('temp_emp');
if num>0 then
EXECUTE IMMEDIATE 'drop table temp_emp';
else
EXECUTE IMMEDIATE 'create table temp_emp as (select * from wip.xwp_seq_daily_total_quantity) ';delete temp_emp where to_char(DATETIME,'YYYYMMDD') ='20101118' ;EXECUTE IMMEDIATE 'drop table wip.xwp_seq_daily_total_quantity';EXECUTE IMMEDIATE 'create table wip.xwp_seq_daily_total_quantity as (select * from temp_emp)';  
end if;
end;我在PLSQL Developer中运行这个存储过程,也不行,
EXEC update_total_quantity
报错:
ORA-00900:sql叙述句无效哪位高手帮帮忙

解决方案 »

  1.   


    create or replace procedure update_total_quantity as
    num number;
    begin
    select count(*) into num from user_tables where table_name =upper('temp_emp');
    if num>0 then
    EXECUTE IMMEDIATE 'drop table temp_emp';
    else
    EXECUTE IMMEDIATE 'create table temp_emp as (select * from wip.xwp_seq_daily_total_quantity) ';
    end if;
    EXECUTE IMMEDIATE 'delete temp_emp where to_char(DATETIME,''YYYYMMDD'') =''20101118''' ;EXECUTE IMMEDIATE 'drop table wip.xwp_seq_daily_total_quantity';EXECUTE IMMEDIATE 'create table wip.xwp_seq_daily_total_quantity as (select * from temp_emp)';   end;--执行的时候还得显示授权
    --grant create any table to 目标用户