2 Replies Latest reply: May 2, 2013 4:23 PM by Frank Kulash RSS

    package correction

    choti
      i have written the following package to truncate table partition and sleep for 30seconds. Could you let me know whether it works or not.

      create or replace PACKAGE BODY TRUNCATE_PKG AS
      
        PROCEDURE TRUNCATE_TABLE (p_table_name IN VARCHAR2,p_partition_name IN VARCHAR2,p_sleep IN NUMBER) AS
        BEGIN
        
         EXECUTE IMMEDIATE 'ALTER TABLE ' ||  p_table_name || ' TRUNCATE PARTITION ' || p_partition_name ;
         dbms_lock.sleep(p_sleep);
        END TRUNCATE_TABLE;
      
      END TRUNCATE_PKG;
        • 1. Re: package correction
          SomeoneElse
          Could you let me know whether it works or not.
          Normally you do that by testing it on your own system.
          • 2. Re: package correction
            Frank Kulash
            Hi,
            choti wrote:
            i have written the following package to truncate table partition and sleep for 30seconds. Could you let me know whether it works or not.
            No, I can't, because I don't have your table. You have your table, so you can see if it works or not.
            Of course, it won't work if the arguments are invalid.

            It will sleep for exactly 30 seconds only if p_sleep=30.