你将动态sql这样执行试试吧
insert_str:='INSERT INTO T_PX_ZD_TEMP(field_name,field_display)'||
          ' VALUES (''zbdw1'',''Ö÷°ìµ¥Î»'')';
    EXECUTE IMMEDIATE insert_str;

解决方案 »

  1.   

    DBMS_SQL.Variable_Value_char?
    先把这个错改了.
    最好提供ora错误号.
      

  2.   

    把DBMS_SQL.Variable_Value换成DBMS_SQL.column_value
    最后把游标close. 至少可以编译成功了.
      

  3.   

    create or replace function Get168Fee (
      Fee_mobileid        in Varchar2, 
      Fee_type            in number,  -- 0:real,1:history     
      Fee_date            in Varchar2 default NULL)-- YYYYMM 
      return number as
        Fee_Sum     number(12,2); -- -1:error
        Mm          Char(2);
        Dd          Char(2);
        Mi          number(1);
        i           Integer;
        Tname       Char(10);
        Vsql        varchar2(800);
        vCursorID   INTEGER :=DBMS_SQL.Open_cursor;
        vRet        INTEGER;    
    --  local variable as FEE table Field*
        v_SmType    char(2);
        v_Fee_type  char(2);
        v_Info_fee  number(6);
        v_Month_fee number(6);
        v_Send_stat number(4);
    begin
    -- init value 
      i := 1;
      Fee_Sum := 0.00;
      if Fee_type = 0 then /* 0:real */     
        Mm := to_char(sysdate,'MM');
        Dd := to_char(sysdate,'DD');  
      elsif Fee_type = 1 then /* 1:history */    
        Mm := substr(Fee_date,5,2);
        Dd := to_char(last_day(to_date(Fee_date||'01','YYYYMMDD')),'DD');
      else
        Return -1;  
      end if;  
      Mi := Mod(to_number(Mm),4);
      if Mi = 0 then
        Mi := 4;
      end if;
      Mm := '0' || to_char(Mi);
    /* get sum */ 
      Dd:='20';i:=20;
      loop
        Tname := 'Fee_' || Mm || ltrim(to_char(i,'09'));
        Vsql := 'select SmType,Fee_type,Info_fee,Month_fee,Send_stat from ' || Tname;
        Vsql := Vsql || ' where fee_id=' || Fee_mobileid || ' and (to_number(SmType)=0 or to_number(SmType)=10 or to_number(SmType)=1 or to_number(SmType)=2)';                
        DBMS_output.put_line (Vsql);
        
        DBMS_SQL.parse(vCursorID,vSql,DBMS_SQL.NATIVE);
        DBMS_SQL.Define_column(vCursorID,1,v_SmType,2);
        DBMS_SQL.Define_column(vCursorID,2,v_Fee_type,2);
        DBMS_SQL.Define_column(vCursorID,3,v_Info_fee);
        DBMS_SQL.Define_column(vCursorID,4,v_Month_fee);
        DBMS_SQL.Define_column(vCursorID,5,v_Send_stat);   
        
        vRet := DBMS_SQL.execute(vCursorID);           
        loop
          if dbms_sql.fetch_rows(vCursorID) = 0 then
            exit;
          end if;  
          DBMS_output.put_line('11');       
          DBMS_SQL.column_value(vCursorID,1,v_SmType);            
          DBMS_output.put_line('12'); 
          DBMS_SQL.column_value(vCursorID,2,v_Fee_type);    
          DBMS_SQL.column_value(vCursorID,3,v_Info_fee);    
          DBMS_SQL.column_value(vCursorID,4,v_Month_fee);    
          DBMS_SQL.column_value(vCursorID,5,v_Send_stat);                           
          DBMS_output.put_line (v_Smtype || v_Fee_type );
        end loop;
        i := i + 1;
        exit when i > to_number(Dd);
      end loop;
      DBMS_SQL.close_cursor(vCursorID);
      Return Fee_Sum;
    end;
    /21:15:18 jlanzpa817>@c:\jl
    输入被截为1个字符函数已创建。已用时间:  00: 00: 00.50
      

  4.   

    PLS-00307 too many declarations of name match this callCause: The declaration of a subprogram name is ambiguous because there was no exact match between the declaration and the call and more than one declaration matched the call when implicit conversions of the parameter datatypes were used. The subprogram name might be misspelled, its declaration might be faulty, or the declaration might be placed incorrectly in the block structure.
    Action: Check the spelling and declaration of the subprogram name. Also confirm that its call is correct, its parameters are of the right datatype, and, if it is not a built-in function, that its declaration is placed correctly in the block structure.
      

  5.   

    太感谢 jlandzpa(ORA-00600) 你了。
      

  6.   

    jlandzpa(ORA-00600):
    PRAGMA RESTRICT_REFERENCES这个怎么用?