Execute Immediate - Drop table

Hello

I have a piece of code that accepts name of table as a parameter entry and the fall of the table using dynamic SQL. The code follows below:

create or replace procedure drop_table (in_table_name in varchar2)
as
sql_stmt varchar2 (25);
Start
dbms_output.put_line (' name of the Table that had to be abandoned is: ' | in_table_name);
sql_stmt: = 'drop table ' | in_table_name;
execute_immediate sql_stmt;
end;
/

When I'm trying to compile this procedure, I get compilation errors.
We can use execute immediate to remove the tables inside PL/SQL code.

Kindly help.

Thanks in advance
Rambeau

You get an error because of the "_" between run and immediate.

Try:

create or replace procedure drop_table(in_table_name in varchar2)
as
sql_stmt varchar2(25);
begin
dbms_output.put_line('Table name that has to be dropped is: '|| in_table_name);
sql_stmt := 'drop table ' || in_table_name;
execute immediate sql_stmt;
end;
/

Tags: Database

Similar Questions

  • drop table through procedure

    How to remove the table by using the procedure, I get the error message:

    Code

    CREATE OR REPLACE PROCEDURE drop_table IS

    BEGIN

    drop table test;

    end;

    Hello

    Shuumail wrote:

    How to remove the table by using the procedure, I get the error message:

    Code

    CREATE OR REPLACE PROCEDURE drop_table IS

    BEGIN

    drop table test;

    end;

    DROP TABLE is not a PL/SQL command; It's only a SQL command.

    To run a command SQL, PL/SQL, you can use dynamic SQL, like this:

    CREATE OR REPLACE PROCEDURE drop_table IS

    BEGIN

    EXECUTE IMMEDIATE 'drop table test;

    END;

    Why do you do this?  Using PL/SQL to create and drop objects, it is often the best 3rd or 4th way to meet certain requirements.  If you can tell which is your requirement, so someone can help you find a good way to do it in Oracle.

  • Execute Immediate with DOF and TABLE() - error ORA-22905

    Hello

    I have a problem trying to use a user defined the Type of the Table in a statement Execute Immediate containing a CREATE TABLE statement.

    Is there no work around for this problem?

    The actual code for the SELECT * OF TABLE(:T) is dynamic and slow. That's why I try to avoid to create/fill the table in two steps (as does with MY_TABLE1). Also, in this case, I can't use SELECT * but must specify all the columns (amount variable and over 100 columns).

    CREATE TYPE MY_TABLE_TYPE AS TABLE OF VARCHAR2(30);
    /
    DECLARE
        MT MY_TABLE_TYPE;
    BEGIN
        SELECT * BULK COLLECT INTO MT FROM DUAL;
        -- Two steps
        EXECUTE IMMEDIATE 'CREATE TABLE MY_TABLE1 (A VARCHAR2(30))';
        EXECUTE IMMEDIATE 'INSERT INTO  MY_TABLE1    SELECT * FROM TABLE(:T)' USING MT; -- OK
        -- One step
        EXECUTE IMMEDIATE 'CREATE TABLE MY_TABLE2 AS SELECT * FROM TABLE(:T)' USING MT; -- ERROR ORA-22905   
    END;
    /
    

    byee

    Andrea

    In my view, the error message is incorrect or the less misleading. Bind variables cannot be used in DDL:

    SQL > declare
    2 number of v_var: = 99;
    3. start
    4 run immediately "' create the my_table2 in select table: double T" using v_var; "
    5 end;
    6.
    declare
    *
    ERROR on line 1:
    ORA-01027: bind variable not allowed for data definition operations
    ORA-06512: at line 4 level

    SQL >

    What you could do is use the package variable:

    SQL > CREATE OR REPLACE
    2 PACKAGE PKG1
    3 EAST
    4 MT MY_TABLE_TYPE;
    5 FUNCTION GET_MT
    6 RETURN MY_TABLE_TYPE;
    7 END;
    8.

    Package created.

    SQL > CREATE OR REPLACE
    PACKAGE 2 BODY PKG1
    3 EAST
    4 GET_MT FUNCTION
    5 RETURN MY_TABLE_TYPE
    6 EAST
    7. START
    8 RETURN MT;
    9 END;
    10 END;
    11.

    Package body created.

    SQL > DROP TABLE MY_TABLE1 PURGE
    2.

    Deleted table.

    SQL > DROP TABLE MY_TABLE2 PURGE
    2.
    DROP TABLE MY_TABLE2 PURGE
    *
    ERROR on line 1:
    ORA-00942: table or view does not exist

    SQL > START
    2. SELECT * BULK COLLECT INTO PKG1.MT FROM DUAL;
    3 - two steps
    4 RUN IMMEDIATELY "CREATE TABLE MY_TABLE1 (A VARCHAR2 (30))';"
    5 IMMEDIATELY EXECUTE "INSERT INTO MY_TABLE1 SELECT * FROM TABLE (PKG1." GET_MT)';
    6 - one step
    7 IMMEDIATE EXECUTION "CREATE TABLE MY_TABLE2 AS SELECT * FROM TABLE (PKG1." GET_MT)';
    8 END;
    9.

    PL/SQL procedure successfully completed.

    SQL > select * from my_table1;

    A
    ------------------------------
    X

    SQL > select * from my_table2;

    COLUMN_VALUE
    ------------------------------
    X

    SQL >

    SY.

  • suffixing date in the EXECUTE IMMEDIATE statement

    Hi could one please let me know how I can the suffix of the name of the table to the year, which the calculation is being in the select statement. Output should be as an example: test_2007
    declare
    
    abc number;
    
    begin
    
       select (to_char(sysdate, 'YYYY') - 4) into abc from dual;
    
       EXECUTE IMMEDIATE 'CREATE TABLE test_&abc as select * from emp where 1=2';
    
    end;

    You can do it like this

    BEGIN
       EXECUTE IMMEDIATE
             'CREATE TABLE test_'
          || (TO_CHAR ( SYSDATE, 'YYYY') - 4)
          || ' as select * from emp where 1=2';
    END;
    

    You can use your variable as well, if this can change dynamically.

    DECLARE
       abc            NUMBER;
    BEGIN
       SELECT (TO_CHAR ( SYSDATE, 'YYYY') - 4) INTO abc FROM DUAL;
    
       EXECUTE IMMEDIATE 'CREATE TABLE test_'||abc||' as select * from emp where 1=2';
    END;
    

    Edited by: g. March 1, 2011 11:49

  • Variable content inside "EXECUTE IMMEDIATE" does not properly.

    Hello

    I have the following package:
    CREATE OR REPLACE PACKAGE "BACKUP"."PKG_BACKUP"
    IS
    PROCEDURE BACKUP_TABLE (TABLE_NAME IN VARCHAR);
    END PKG_BACKUP;
    /
    CREATE OR REPLACE PACKAGE BODY "BACKUP"."PKG_BACKUP"
    IS
    PROCEDURE BACKUP_TABLE (TABLE_NAME IN VARCHAR) IS
    MYDATE VARCHAR(10);
    BEGIN
    MYDATE := to_char(sysdate,'YYYYMMDD');
    DBMS_OUTPUT.PUT_LINE(' Backing up '||TABLE_NAME||' table...');
    
    
    EXECUTE IMMEDIATE 'CREATE TABLE "BACKUP"."'||TABLE_NAME||'_'||MYDATE||'" AS SELECT * FROM "MYSCHEMA"."'||TABLE_NAME||'" COMPRESSED';
    END backup_table;
    END "PKG_BACKUP";
    /
    However, every time that I run it, I get the following error:



    SQL & gt; BACKUP exec. PKG_BACKUP. BACKUP_TABLE ('POOL');
    * Save the POOL table... *.
    START THE BACKUP. PKG_BACKUP. BACKUP_TABLE ('POOL'); END;

    ***
    ERROR on line 1:
    ORA-00942: table or view does not exist
    * ORA-06512: at "BACKUP. PKG_BACKUP
    ", line 9."
    * ORA-06512: at line 1 *.



    Table exists, and the user running the statement has the appropriate privileges (I even run the content of "immediate execution" by hand and it works very well)



    What Miss me?



    Thanks in advance.

    Frank R. says:

    Boneist wrote:
    The BACKUP user has the privs too?

    Yes, he does.

    What is Boneist to is that the SCHEMA. Pool table isn't visible in the PL/SQL code. The owners/running the package has explicit permissions to select from the SCHEMA. Pool table? While it may work to the breast for example of SQL * Plus as a standard CREATE table, this will use permissions based on roles. These permissions based on the roles are not available in the PL/SQL code. Ensure that select explicit grants have had on this table to the correct user.

  • Create a temporary table using EXECUTE IMMEDIATE

    Hello

    I need to create a report more complex which must have three different queries. I use a determined IF clause that the query that uses the report, according to the parameters.

    I want to write the output to a csv file, so I created a PROCEDURE.

    The first package of the procedure has the three SQL and the IF clause in order to determine the query that the report uses and stores the query code in a variable (v_sql), which is passed to the PROCEDURE that needs to write to the output of the report.

    I tried to create a table with data from the request in order to make a LOOP and exit, something like this:

    WRITE_FILE (errBUFF of the PROCEDUREOUT VARCHAR2,
    retCODEOUT VARCHAR2,
    v_sqlIN VARCHAR2)

    IS

    ContorNUMBER;

    BEGIN

    EXECUTE IMMEDIATE v_sql;
    SLIDE G
    IS
    Select * from XXROR_REG_MF_TBL;
    --
    -initialization
    --
    retCode: = 0;
    errBUFF: = NULL;
    Contor: = 0;
    --
    -cursor
    --

    FOR X IN G
    LOOP
    APPS. FND_FILE.
    PUT_LINE)
    APPS. FND_FILE. OUTPUT,
    ....)

    I should mention that v_sql is something like:

    CREATE GLOBAL TEMPORARY TABLE ACEs (SELECT * of the double);

    I can't really do that, so I was wondering if you have any suggestions

    Thank you

    Claudiu

    Hello

    I don't think you need a table at all. You can set the cursor based on the SQL passed as parameter

    https://docs.Oracle.com/database/121/LNPLS/dynamic.htm#LNPLS629

    Concerning

    Marcus

  • Execute Immediate giving in ORA-00942: table or view does not exist

    Hello

    I am creating a table using an immeidate in PL/SQL execute it gives table or view does not exist. When that same create table sql works well outside the PL/SQL.

    g_sql: =.
    'CREATE TABLE' | l_tmptable1 |' as '.
    ' SELECT decode (gsisource, null, "WEBSTORE", gsisource) as 'SOURCE', COUNT (1) as 'ADD_COUNT' ' |
    'OF SCHEMA_NAME.t_master' |
    ' WHERE the add_date between to_date('''|| g_startDateChrTrunc ||'') (', "MM/DD/YYYY) ' |
    ' AND to_date('''|| g_endDateChrTrunc ||'') (', "MM/DD/YYYY) ' |
    'GROUP BY DECODE (gsisource, null, "WEBSTORE", gsisource)';

    EXECUTE IMMEDIATE g_sql;

    Any help is appreciated.

    Concerning

    Hello

    It seems that you have the privileges through a role. Roles do not count in the AUTHID DEFINE stored procedures. A the owner of the table the necessary privileges directly to the owner of the proceudre.

    Moreover, the creation of tables in PL/SQL is almosty never the right way to do whatever it is you need. What is the purpose of this table? Why can not be created once and be truncated if necessary?

  • Pass Pl/sql table in the USING clause in the EXECUTE IMMEDIATE statement

    Getting error when I try to pass the PL/SQL table in the USING clause in the EXECUTE IMMEDIATE statement:

    Declare
    result NUMBER;
    TYPE values_tab IS TABLE OF NUMBER INDEX OF directory;
    lv_tab values_tab;
    lv_exp varchar2 (300);
    lv_exec varchar2 (300);
    BEGIN
    lv_tab (1): = 5;
    lv_tab (2): = 48;
    lv_tab (3): = 7;
    lv_tab (4): = 6;
    lv_exp: = ': + b1: b2 + (: b3 *: b4)';
    lv_exec: = 'SELECT'. lv_exp | ' THE DOUBLE '.

    IMMEDIATE EXECUTION
    lv_exec
    IN
    result
    USING
    lv_tab;
    DBMS_OUTPUT. Put_line (result);

    END;
    /

    Error on line 1
    ORA-06550: line 20, column 12:
    PLS-00457: expressions must be SQL types
    ORA-06550: line 15, column 8:
    PL/SQL: Statement ignored


    I am trying to evaluate the expression ': + b1: b2 + (: b3 *: b4) "which is stored in the table. This table has different expressions (expressions about 300). I want to use the bind variable in the expression because each expression evaluated thousands of time may be more in some cases. If I use bind variable can he fill pool.

    Is there a way I can pass parameters with the HELP of (IN) dynamically instead of write "help lv_tab (1), lv_tab (2), lv_tab (3), lv_tab (4)? As number of change of the input parameters depend on the expression in the table.

    If it is possible please suggest any other ideas/approaches

    Help, please...

    Published by: satnam on June 11, 2009 11:50

    Well, you keep changing faster reqs that I can follow. In any case, assuming that N-th variable bind (left to right) corresponds to n-th collection item:

    Declare
        result NUMBER;
        lv_tab values_tab := values_tab();
        lv_exp varchar2(300);
        lv_exec varchar2(300);
        lv_i number := 0;
    BEGIN
        lv_tab.extend(4);
        lv_tab(1) := 5;
        lv_tab(2) := 48;
        lv_tab(3) := 7;
        lv_tab(4) := 6;
        lv_exp := ':5000135+:5403456+(:5900111*:5200456)';
        lv_exec := lv_exp;
        While regexp_like(lv_exec,':\d+') loop
          lv_i := lv_i + 1;
          lv_exec := REGEXP_REPLACE(lv_exec,':\d+',':b(' || lv_i || ')',1,1);
        end loop;
        lv_exec := 'BEGIN :a := ' || lv_exec || '; END;';
    DBMS_OUTPUT.PUT_LINE(lv_exec);
    EXECUTE IMMEDIATE lv_exec USING OUT result,IN lv_tab;
    DBMS_OUTPUT.PUT_LINE(result);
    END;
    /
    BEGIN :a := :b(1)+:b(2)+(:b(3)*:b(4)); END;
    95
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.

  • Creating external Tables using the EXECUTE IMMEDIATE in PL/SQL

    Hi guys,.

    I am trying to create an external Table using the EXECUTE IMMEDIATE in a procedure and I managed to compile and no errors were generated. But when I try to run it from sql using the exec command I get the following error:

    ------------------------------------------------------------------------
    ERROR on line 5:
    ORA-00911: invalid character
    ORA-06512: at "GEO. TEST_DDL', line 4
    ORA-06512: at line 5

    -------------------------------------------------------------------------

    I tried to check the whole statement to create the external table, but I can't find where is the error. Surprisingly, if I simply run the command table create external on sqlplus it works, but not a procedure.

    If anyone can help with ideas or experience?

    Geoffrey Kossami

    The error means that there is an identifier somewhere that starts with a nonalphanumeric. This is a typical mistake of editing. A procedure compiles correctly is not of course because the underlying dynamic sql running is OK. Which of course only be resolved when you try to run it.

    There is certainly a problem with the text you provide to be run as a piece of dynamic sql code. You should try to watch it with dbms_output and run this code in sqlplus. But your problem is with the code you run as dynamic PL/SQL, it is not itself compilable.

    Jack

  • How to create and insert data with Execute Immediate?

    Hi guys

    Am stuck on a procedure of formatting in a package... script works okay however integrating a module turns out to be difficult!

    Am not used to oracle... I have the script runs, but not in the package... Well not all that... Drop Table worked

    CREATE or REPLACE PACKAGE BODY is

    PROCEDURE DropTable1 IS

    BEGIN

    run immediately ("DROP TABLE mytable1");

    END;

    PROCEDURE PopulateTable1 IS

    BEGIN

    immediately execute ('CREATE TABLE mytable1 )

    AS LONG AS)

    Select

    substr (T1.genarea, 3, 3) as M_Class,

    substr (T1.genarea, 6, 30) as M_Description,

    substr (T1.genarea, 36, 3) as M_Class,

    substr (T1.genarea, 39, 30) as M_Description,

    substr (T1. ItemItem, 1, 3) as product_code,.

    T3. CHANNEL_NUM as SALES_CHANNEL,

    to_date(''t2.time_id'',''dd-mon-yyyy'') as mis_date,

    Sum (T2.ap_cw_cfi_irp + T2.ap_cw_issues_irp) as ap_gross,

    sum (t2. Ap_Cw_Cfi_Irp + t2. Ap_Revivals_Irp) as ap_net,

    Sum (T2.sp_inc_irp + T2.sp_issues_irp) as sp_gross,

    Sum (T2.sp_dec_irp + T2.sp_fs_irp) as sp_net

    Of

    d_pr t1, t2 age_map t3 law

    where

    T1.pfx = "WE"and t1.coy ="1" and t1.tabl = "T81" and substr (t1.itemitem, 1, 3) = t2.product_id and t3. AGE_NUM = t2.age_id

    Group

    substr (T1.genarea, 3, 3),

    substr (T1.genarea, 6, 30),

    substr (T1.genarea, 36, 3),

    substr (T1.genarea, 39, 30),

    substr (T1. ItemItem, 1, 3).

    T3. CHANNEL_NUM,

    to_date(''t2.time_id'',''dd-mon-yyyy'')

    )');

    COMMIT;

    END PopulateTable1;

    END test;

    /

    Thank you

    Hello

    a few notes.

    1. to_date(t2.time_id,'dd-mon-yyyy')

    New York T2.Time_ID Cis the varchar2 data type that contains values to JJ-me-YYYY format?

    And if, in which language is used for the names of the months? Conversions are point impossible to solve in reasonable time limits without logging of dml errors and unique failure on charges of staging nightly!


    2 single quote escaping "alternative in string literals.

    You can use Q or q to escape single quotes in strings.

    http://docs.Oracle.com/database/121/SQLRF/sql_elements003.htm#SQLRF00218

    3. validation

    Not required because the DDL commands commit implied.

    In general I recommend you write commit clauses only in calling script rather than in the code unless it connects with an autonomous transaction.

    You end up with a lot of validation of code here and there and you don't know where it is and where it isn't. That is, your process may have more than one appeal process and commit the middle of the process, it is not atomic processes.

    Here's the demo although I recommend also using the static table and truncate to efficiency. ETG is good choice for the purpose of maintenance table.

    create or replace
    package testing is
      procedure staging_one;
    end;
    /
    create or replace
    package body testing is
      --
      procedure staging_one is
        --
        procedure drop_staging_one is
          table_does_not_exist exception;
          pragma exception_init(table_does_not_exist, -00942);
        begin
          execute immediate q'{
            drop table staging_one purge
          }';
        exception when table_does_not_exist then
          return; -- fine
        end;
        --
        procedure create_staging_one is
        begin
          execute immediate q'{
    
            -- remove >>>
            create table staging_one nologging
            as
            select * from dual
            -- <<< remove
    
            /* uncomment >>>
            create table staging_one nologging
            as
            select
              substr(t1.genarea,3,3)                    as m_class,
              substr(t1.genarea,6,30)                   as m_description,
              substr(t1.genarea,36,3)                   as m_class,
              substr(t1.genarea,39,30)                  as m_description,
              substr(t1.itemitem,1,3)                   as product_code,
              t3.channel_num                            as sales_channel,
              to_date(t2.time_id,'dd-mon-yyyy')         as mis_date,
              sum(t2.ap_cw_cfi_irp+t2.ap_cw_issues_irp) as ap_gross,
              sum(t2.ap_cw_cfi_irp+t2.ap_revivals_irp)  as ap_net,
              sum(t2.sp_inc_irp   +t2.sp_issues_irp)    as sp_gross,
              sum(t2.sp_dec_irp   +t2.sp_fs_irp)        as sp_net
            from
              d_pr t1,
              act t2,
              age_map t3
            where
              t1.pfx                      = 'IT'
              and t1.coy                  = '1'
              and t1.tabl                 = 'T81'
              and substr(t1.itemitem,1,3) = t2.product_id
              and t3.age_num              = t2.age_id
            group by
              substr(t1.genarea,3,3),
              substr(t1.genarea,6,30),
              substr(t1.genarea,36,3),
              substr(t1.genarea,39,30),
              substr(t1.itemitem,1,3),
              t3.channel_num,
              to_date(t2.time_id,'dd-mon-yyyy')
            <<< uncomment */
          }';
          --
        end;
      -- main
      begin
        drop_staging_one;
        create_staging_one;
      end;
    end;
    /
    
    set serveroutput on
    
    exec testing.staging_one;
    
    select * from staging_one
    ;
    commit
    ;
    
    PACKAGE TESTING compiled
    PACKAGE BODY TESTING compiled
    anonymous block completed
    DUMMY
    -----
    X 
    
    committed.
    
  • Unable to drop table

    Hello

    I currently am tring to remove a table by using a device to process by clicking on the button

    Icreated my button and also a 'process of PL/SQL' and I put

    ----
    DROP TABLE & P0_TABLE_NAME. THE CASCADE CONSTRAINTS;
    ----

    inside the 'source' field with by checking the box "do not validate code PL/SQL (PL/SQL code when executing only analysis).»


    But when the button is clicked I got the following error


    ----
    ORA-06550: line 1, column 7: PLS-00103: met the 'DROP' symbol during the waited as follows: begin case declare exit for goto rise back loop mod null pragma select update while < ID > < a between double quote delimited identifiers of > < a variable binding > < < current delete fetch locking insert open nearby rollback savepoint SQLExecute fusion pipe set commit forall
    Error drop table error
    Ok
    ----

    Anyone has an idea about this?

    Debug trace is

    ----
    A C C E P t: ask = "purge."
    0.00: metadata: go look up the definition and application shortcuts
    0.00: alter session set nls_language = "AMERICAN."
    0.00: alter session set nls_territory = 'AMERICA '.
    0.00:... "NLS: decimal separator Set =". »
    0.00:... NLS: Set NLS Group separator = ",".
    0.00:... NLS: Date Format Set = "DD-MON-RR.
    0.00:... Setting session time_zone at + 02:00
    0.00: NLS: wwv_flow.g_flow_language_derived_from = 0: wwv_flow.g_browser_language = en - us
    0.00: fetch database session state
    0.01:... Check the owner of the 2289784661666743 session
    0.01:... Check for expiration of the session:
    0.01:... Metadata: Page Fetch, calculation, process and branch
    0.01: session: extract information from session header
    0.01:... Metadata: Retrieve the attributes of the page for application 121, page 2
    0.01:... Validate page affinity point.
    0.03:... Check off the items hidden_protected.
    0.03:... Check authorization security systems
    0.03: session state: Save elements of form and p_arg_values
    0.03:... Session state: Save "P0_TABLE_NAME" - registration of same value: "STATPHI_595730051".
    0.04:... Session state: Save "P2_TABLE_NAME" - registration of same value: "STATPHI_595730051".
    0.04:... Session state: Save "P2_TYPE" - registration of same value: '2 '.
    0.04:... Session state: Save "P2_CALENDAR" - registration of same value: "PA".
    0.04:... Session state: Save "P2_FILE_NAME" - registration of same value:
    0.04: point of treatment: ON_SUBMIT_BEFORE_COMPUTATION
    0.04: branch point: BEFORE_COMPUTATION
    0.04: point of calculation: AFTER_SUBMIT
    0.04: tabs: make the connection for the tab queries
    0.04: branch point: BEFORE_VALIDATION
    0.04: perform validations:
    0.04: branch point: BEFORE_PROCESSING
    0.04: point of treatment: AFTER_SUBMIT
    0.04: button "P2_PURGE_TABLE" process.
    0.04:... Process 'DROP TABLE': PLSQL (AFTER_SUBMIT) DROP TABLE & P0_TABLE_NAME. THE CASCADE CONSTRAINTS;
    0.06: unhandled exception encountered type process PLSQL
    0.06: see the error page...
    0.06: execute rollback...
    ----

    Hi user631592 ;-)

    You can't directly use a DDL statement.
    But you can use an EXECUTE IMMEDIATE in your process.

    THEN

    BEGIN
    RUN IMMEDIATELY "DROP TABLE STATPHI_595730051;
    END;

    Concerning

  • use of execute immediate with variables

    Hello

    I want to update a table with immediate execution, but I need to use the variable to run immediately. I typed a code, but the code below does not work and I m getting the error ORA-00936. Something wrong with this code?

    WHILE v_acu_payment_amount > 0

    LOOP

    BEGIN

    SELECT emplid, amount_past_due

    IN v_emplid, v_vade_tutari

    OF vade_temp

    WHERE the sira = v_sirano AND emplid IN (r1.emplid);

    END;

    v_acu_payment_amount: = v_acu_payment_amount - v_vade_tutari;

    Dbms_output.put_line ('paymentamount2' | v_acu_payment_amount);

    IF v_acu_payment_amount > 0

    THEN

    EXECUTE IMMEDIATE "update vade_temp set AMOUNT_PAST_DUE = to_number('||) 0

    || ') where sira = to_number (')

    || v_sirano

    || ')';

    ON THE OTHER

    Temp: = v_acu_payment_amount * (-1);

    Dbms_output.put_line (temp);

    EXECUTE IMMEDIATE "update vade_temp set AMOUNT_PAST_DUE = to_number (')"

    || Temp

    || ') where sira = to_number (')

    || v_sirano

    || ')';

    END IF;

    COMMIT;

    v_sirano: = v_sirano + 1;

    END LOOP;

    Kind regards

    Gunce

    In addition, you have no dynamic SQL for this

    [code]

    WHILE v_acu_payment_amount > 0

    LOOP

    BEGIN

    SELECT emplid, amount_past_due

    IN v_emplid, v_vade_tutari

    OF vade_temp

    WHERE the sira = v_sirano AND emplid IN (r1.emplid);

    END;

    v_acu_payment_amount: = v_acu_payment_amount - v_vade_tutari;

    Dbms_output.put_line ('paymentamount2' | v_acu_payment_amount);

    IF v_acu_payment_amount > 0

    THEN

    UPDATE vade_temp

    SET amount_past_due = 0

    WHERE the sira = v_sirano;

    ON THE OTHER

    Temp: = v_acu_payment_amount * (-1);

    Dbms_output.put_line (temp);

    UPDATE vade_temp

    SET AMOUNT_PAST_DUE = temp

    where sira = v_sirano;

    END IF;

    COMMIT;

    v_sirano: = v_sirano + 1;

    END LOOP;

    [/ code]

    But if you need dynamic sql statements, then you should use bind variables as

    ...

    EXECUTE IMMEDIATE "UPDATE vade_temp SET amount_past_due =: b1 WHERE sira =: b2' using 0, v_sirano;"

    ...

    HTH

  • Maximum size of EXECUTE IMMEDIATE

    Hellou everyone,

    I would like to ask if there is a way how to run the dynamic SQL CREATE or VIEW of REPLACE command more than 32 KB of wholesale. Because the EXECUTE IMMEDIATE statement can run up to 32 k (greater length of variable plsql chain) chain

    Is there a way how children Ridge or replace the command?

    Or I need to revrite using DBMS_SQL.

    Thank you.

    (a) WHY? If you want to dynamically create views?  This is not recommended because your application/database should be designed at the time of the design, not running.

    (b) If you are on 11 g, you can use the CLOB datatype with immediate execution, so there is no 32 K limit.

    (c) If you are before 11 g you need to update, but if you can't then the following example is how you do it using DBMS_SQL.

    SQL > declare

    2 v_large_sql clob.

    3 v_num number: = 0;

    number of v_upperbound 4;

    5 v_sql dbms_sql.varchar2s;

    6 whole v_cur;

    number of v_ret 7;

    8 v_join_sql varchar2 (100): = ' crΘer view vw_tmp as ";

    9 start

    10. build a very big SQL statement in the CLOB

    11 loop

    12 v_large_sql: = v_large_sql | v_join_sql | "select" the number of this line is: ' | TO_CHAR (v_num, 'fm0999999') | " "as col1 from dual;"

    13 v_join_sql: = "union all";

    14 v_num: = v_num + 1;

    15 exit when dbms_lob.getlength (v_large_sql) > 40000 or v_num > 800;

    16 end loop;

    17 dbms_output.put_line (' length :'||) DBMS_LOB. GetLength (v_large_sql));

    18 dbms_output.put_line ('Num :'|| v_num);

    19-

    20. now divide this big SQL statement into pieces of 256 characters and put in table VARCHAR2S

    21 v_upperbound: = ceil ((v_large_sql) dbms_lob.getlength / 256);

    22 because me at 1.v_upperbound

    23 loop

    24 v_sql (i): = dbms_lob.substr (v_large_sql

    25, 256 - amount

    26, ((i-1) * 256) + 1 - offset

    27                                 );

    28 end of loop;

    29-

    30. now analyze and execute the SQL statement

    31 v_cur: = dbms_sql.open_cursor;

    32 dbms_sql.parse (v_cur, v_sql, 1, v_upperbound, dbms_sql.native, false);

    33 v_ret: = dbms_sql.execute (v_cur);

    34 dbms_output.put_line ("' view created");

    35 dbms_sql.close_cursor (v_cur);

    36 end;

    37.

    Length: 40015

    NUM:548

    View created

    PL/SQL procedure successfully completed.

    SQL > select count (*) in the vw_tmp;

    COUNT (*)

    ----------

    548

    SQL > select * from vw_tmp where rownum<=>

    COL1

    -----------------------------------

    The number of this line is: 0000000

    The number of this line is: 0000001

    The number of this line is: 0000002

    The number of this line is: 0000003

    The number of this line is: 0000004

    The number of this line is: 0000005

    The number of this line is: 0000006

    The number of this line is: 0000007

    The number of this line is: 0000008

    The number of this line is: 0000009

    10 selected lines.

    SQL >

  • Dynamic Query(execute immediate)

    Greetings,

    VERSION:-10 g

    Name of the table column is the name of the month which I store in a condition variable that I have to pass the names of columns at runtime of the value

    TABLE DEALER_MAST

    NUMBER OF DEALER_DIM_ID
    NUMBER OF APR
    MAY ISSUE
    JUNE ISSUE
    NUMBER OF JUL
    AUGUST ISSUE
    NUMBER OF MS


    I now have the code example below in my procedure


    v_dealer VARCHAR2 (3);
    XYZ varchar2 (2000);

    SELECT TO_CHAR (SYSDATE, 'MY') IN THE DOUBLE V_DEALER;


    DECLARE CURSOR a1 IS SELECT DEALER_ID FROM DEALER_MAST;

    BEGIN

    FOR j IN a1
    loop

    COUNT (*) SELECT IN DEALER_COMM FROM subs_fact
    WHERE TO_CHAR (ACTIVATION_DATE, 'Mon - yy') = (select to_char (add_MONTHS(sysdate,-2), 'mon-yy') FROM dual)
    - AND TAB_ELEG = 1
    and DEALER_ID = j.DEALER_ID;


    -Dynamicaly passing the name of column

    XYZ: = 'SELECT'. V_DEALER | "IN DEALER_MAST FROM DEALER_MAST WHERE DEALER_DIM_ID =' | j.DEALER_DIM_ID;

    run immediately (XYZ);

    /*

    AFTER immediate execution of the query should be as
    SEVEN ELECTED IN DEALER_MAST FROM DEALER_MAST WHERE DEALER_DIM_ID = 24345

    But not to store the data in the variable & gives error like key word missing on run immediately (XYZ);

    */

    If (DEALER_MAST > 2) can
    ---
    --
    end if;

    ERROR:-do not store data in the variable & gives error like key word missing on run immediately (XYZ);

    Thanks in advance

    Maybe

    l_var: = j.DEALER_DIM_ID;

    XYZ: = "SELECT" | TO_CHAR (sysdate, 'MY'). ' FROM DEALER_MAST WHERE DEALER_DIM_ID =: l_var';

    EXECUTE IMMEDIATE XYZ
       INTO DEALER_MAST
       USING l_var;


    Concerning

    Etbin

  • DROP TABLE performance

    Hello

    could someone share advice on improving the execution time of the abandonment of the tables?

    I have a blank table with more than 200 columns and it takes 23-25 s to drop. Smaller tables take something around 0.1 s of course. Problem is I have let fall from thousands of these tables and then re-create them. The recreate itself takes not more than one second.

    What is the origin of more time? Is it because of an implicit validation in the drop table command?

    I tried this with almost identical times noarchivelog mode. I also tried different settings and commit_logging optimizer_mode, none showed any usable results, but I'm still at the experimental stage. The goal is to minimize the execution time once I need to run the entire batch, perhaps in the course of running several sessions can work to be faster (while times are maybe longer), don't know yet.

    Here is an example of output:
    SQL> CREATE TABLE "SYSADM"."DRIVERTEST"
      2    (
      3      "PROCESS_INSTANCE"   NUMBER(10,0) NOT NULL ENABLE,
      4      "INTFC_ID"           NUMBER(*,0) NOT NULL ENABLE,
      5      "INTFC_LINE_NUM"     NUMBER(*,0) NOT NULL ENABLE,
      6      "TRANS_TYPE_BI"      VARCHAR2(4 CHAR) NOT NULL ENABLE,
      7      "TRANS_TYPE_BI_SEQ"  NUMBER(*,0) NOT NULL ENABLE,
      8      "HDR_FIELDS_KEY"     VARCHAR2(30 CHAR) NOT NULL ENABLE,
      9      "HDR_FIELDS_BILL_BY" VARCHAR2(1 CHAR) NOT NULL ENABLE,
     10      "ADJ_TRANS_TYPE"     VARCHAR2(5 CHAR) NOT NULL ENABLE,
     11      "CREATE_NEW_BILL"    VARCHAR2(1 CHAR) NOT NULL ENABLE,
     12      "TMP_BILL_FLG"       VARCHAR2(1 CHAR) NOT NULL ENABLE,
     13      "ENTRY_TYPE"         VARCHAR2(5 CHAR) NOT NULL ENABLE,
     14      "ENTRY_REASON"       VARCHAR2(5 CHAR) NOT NULL ENABLE,
     15      "ENTRY_EVENT"        VARCHAR2(10 CHAR) NOT NULL ENABLE,
     16      "LOAD_STATUS_BI"     VARCHAR2(3 CHAR) NOT NULL ENABLE,
     17      "ERROR_STATUS_BI"    VARCHAR2(4 CHAR) NOT NULL ENABLE,
     18      "BUSINESS_UNIT"      VARCHAR2(5 CHAR) NOT NULL ENABLE,
     19      "BUSINESS_UNIT_GL"   VARCHAR2(5 CHAR) NOT NULL ENABLE,
     20      "BILL_TO_CUST_ID"    VARCHAR2(15 CHAR) NOT NULL ENABLE,
     21      "ADDRESS_SEQ_NUM"    NUMBER(*,0) NOT NULL ENABLE,
     22      "BILL_TO_COPIES"     NUMBER(*,0) NOT NULL ENABLE,
     23      "CNTCT_SEQ_NUM"      NUMBER(*,0) NOT NULL ENABLE,
     24      "NAME1"              VARCHAR2(40 CHAR) NOT NULL ENABLE,
     25      "INTERUNIT_FLG"      VARCHAR2(1 CHAR) NOT NULL ENABLE,
     26      "BUSINESS_UNIT_TO"   VARCHAR2(5 CHAR) NOT NULL ENABLE,
     27      "DIRECT_INVOICING"   VARCHAR2(1 CHAR) NOT NULL ENABLE,
     28      "RANGE_SELECTION_ID" VARCHAR2(30 CHAR) NOT NULL ENABLE,
     29      "BILL_SOURCE_ID"     VARCHAR2(10 CHAR) NOT NULL ENABLE,
     30      "BILL_TYPE_ID"       VARCHAR2(3 CHAR) NOT NULL ENABLE,
     31      "BILL_CYCLE_ID"      VARCHAR2(10 CHAR) NOT NULL ENABLE,
     32      "BILL_BY_ID"         VARCHAR2(10 CHAR) NOT NULL ENABLE,
     33      "PAYMENT_METHOD"     VARCHAR2(3 CHAR) NOT NULL ENABLE,
     34      "PYMNT_TERMS_CD"     VARCHAR2(5 CHAR) NOT NULL ENABLE,
     35      "BANK_CD"            VARCHAR2(5 CHAR) NOT NULL ENABLE,
     36      "BANK_ACCT_KEY"      VARCHAR2(4 CHAR) NOT NULL ENABLE,
     37      "BI_CURRENCY_CD"     VARCHAR2(3 CHAR) NOT NULL ENABLE,
     38      "BASE_CURRENCY"      VARCHAR2(3 CHAR) NOT NULL ENABLE,
     39      "CUR_RT_TYPE"        VARCHAR2(5 CHAR) NOT NULL ENABLE,
     40      "RATE_MULT"          NUMBER(15,8) NOT NULL ENABLE,
     41      "RATE_DIV"           NUMBER(15,8) NOT NULL ENABLE,
     42      "CUR_RT_SOURCE"      VARCHAR2(1 CHAR) NOT NULL ENABLE,
     43      "INVOICE_DT" DATE,
     44      "ACCOUNTING_DT" DATE,
     45      "ACCRUE_UNBILLED"    VARCHAR2(1 CHAR) NOT NULL ENABLE,
     46      "TARGET_INVOICE"     VARCHAR2(22 CHAR) NOT NULL ENABLE,
     47      "INVOICE"            VARCHAR2(22 CHAR) NOT NULL ENABLE,
     48      "DOC_TYPE"           VARCHAR2(8 CHAR) NOT NULL ENABLE,
     49      "CONSOL_SETID"       VARCHAR2(5 CHAR) NOT NULL ENABLE,
     50      "CONSOL_CUST_ID"     VARCHAR2(15 CHAR) NOT NULL ENABLE,
     51      "CONSOL_KEY"         VARCHAR2(22 CHAR) NOT NULL ENABLE,
     52      "INVOICE_TO_ADJ"     VARCHAR2(22 CHAR) NOT NULL ENABLE,
     53      "ADJ_DELTA_ACTION"   VARCHAR2(3 CHAR) NOT NULL ENABLE,
     54      "LINE_SEQ_TO_ADJ"    NUMBER(*,0) NOT NULL ENABLE,
     55      "LINE_SEQ_NUM"       NUMBER(*,0) NOT NULL ENABLE,
     56      "LINE_DST_SEQ_NUM"   NUMBER(*,0) NOT NULL ENABLE,
     57      "LINE_DFR_SEQ_NUM"   NUMBER(*,0) NOT NULL ENABLE,
     58      "LINE_UAR_SEQ_NUM"   NUMBER(*,0) NOT NULL ENABLE,
     59      "LAST_NOTE_SEQ_NUM"  NUMBER(*,0) NOT NULL ENABLE,
     60      "NOTES_SEQ_NUM"      NUMBER(*,0) NOT NULL ENABLE,
     61      "LINE_TYPE"          VARCHAR2(4 CHAR) NOT NULL ENABLE,
     62      "IDENTIFIER"         VARCHAR2(18 CHAR) NOT NULL ENABLE,
     63      "DESCR"              VARCHAR2(30 CHAR) NOT NULL ENABLE,
     64      "UNIT_OF_MEASURE"    VARCHAR2(3 CHAR) NOT NULL ENABLE,
     65      "QTY"                NUMBER(15,4) NOT NULL ENABLE,
     66      "ORIG_QTY"           NUMBER(15,4) NOT NULL ENABLE,
     67      "UNIT_AMT"           NUMBER(15,4) NOT NULL ENABLE,
     68      "LIST_PRICE"         NUMBER(15,4) NOT NULL ENABLE,
     69      "PPRC_PROMO_CD"      VARCHAR2(20 CHAR) NOT NULL ENABLE,
     70      "MERCH_TYPE"         VARCHAR2(10 CHAR) NOT NULL ENABLE,
     71      "TAX_CD"             VARCHAR2(8 CHAR) NOT NULL ENABLE,
     72      "TAX_EXEMPT_CERT"    VARCHAR2(30 CHAR) NOT NULL ENABLE,
     73      "TAX_EXEMPT_FLG"     VARCHAR2(1 CHAR) NOT NULL ENABLE,
     74      "TAX_EXEMPT_RC"      VARCHAR2(2 CHAR) NOT NULL ENABLE,
     75      "TAX_JOB_NUM"        VARCHAR2(10 CHAR) NOT NULL ENABLE,
     76      "BI_TAX_TIMING"      VARCHAR2(1 CHAR) NOT NULL ENABLE,
     77      "CUSTOMER_GROUP"     VARCHAR2(10 CHAR) NOT NULL ENABLE,
     78      "VAT_TXN_TYPE_CD"    VARCHAR2(4 CHAR) NOT NULL ENABLE,
     79      "TAX_CD_VAT"         VARCHAR2(8 CHAR) NOT NULL ENABLE,
     80      "VAT_APPLICABILITY"  VARCHAR2(1 CHAR) NOT NULL ENABLE,
     81      "VAT_PRODUCT_GROUP"  VARCHAR2(10 CHAR) NOT NULL ENABLE,
     82      "PROD_GRP_SETID"     VARCHAR2(5 CHAR) NOT NULL ENABLE,
     83      "IST_TXN_FLG"        VARCHAR2(1 CHAR) NOT NULL ENABLE,
     84      "IDENTIFIER_TBL"     VARCHAR2(3 CHAR) NOT NULL ENABLE,
     85      "SHIP_FROM_LOC"      VARCHAR2(10 CHAR) NOT NULL ENABLE,
     86      "ORD_ACCEPT_LOC"     VARCHAR2(10 CHAR) NOT NULL ENABLE,
     87      "ORD_ORIGIN_LOC"     VARCHAR2(10 CHAR) NOT NULL ENABLE,
     88      "STORE_LOC"          VARCHAR2(10 CHAR) NOT NULL ENABLE,
     89      "TITLE_PASSAGE"      VARCHAR2(1 CHAR) NOT NULL ENABLE,
     90      "TAX_GROUP"          VARCHAR2(10 CHAR) NOT NULL ENABLE,
     91      "TAX_USER_AREA"      VARCHAR2(25 CHAR) NOT NULL ENABLE,
     92      "TAX_TRANS_TYPE"     VARCHAR2(1 CHAR) NOT NULL ENABLE,
     93      "TAX_TRANS_SUB_TYPE" VARCHAR2(1 CHAR) NOT NULL ENABLE,
     94      "NET_EXTENDED_AMT"   NUMBER(26,3) NOT NULL ENABLE,
     95      "GROSS_EXTENDED_AMT" NUMBER(26,3) NOT NULL ENABLE,
     96      "REV_RECOG_BASIS"    VARCHAR2(3 CHAR) NOT NULL ENABLE,
     97      "PROJECT_ID"         VARCHAR2(15 CHAR) NOT NULL ENABLE,
     98      "BUSINESS_UNIT_OM"   VARCHAR2(5 CHAR) NOT NULL ENABLE,
     99      "ORDER_NO"           VARCHAR2(10 CHAR) NOT NULL ENABLE,
    100      "ORDER_INT_LINE_NO"  NUMBER(*,0) NOT NULL ENABLE,
    101      "SCHED_LINE_NBR"     NUMBER(*,0) NOT NULL ENABLE,
    102      "DEMAND_SOURCE"      VARCHAR2(2 CHAR) NOT NULL ENABLE,
    103      "DEMAND_LINE_NO"     NUMBER(*,0) NOT NULL ENABLE,
    104      "BUSINESS_UNIT_RMA"  VARCHAR2(5 CHAR) NOT NULL ENABLE,
    105      "RMA_ID"             VARCHAR2(10 CHAR) NOT NULL ENABLE,
    106      "RMA_LINE_NBR"       NUMBER(*,0) NOT NULL ENABLE,
    107      "PRODUCT_ID"         VARCHAR2(18 CHAR) NOT NULL ENABLE,
    108      "ORDER_DATE" DATE,
    109      "PO_REF"       VARCHAR2(30 CHAR) NOT NULL ENABLE,
    110      "PO_LINE"      NUMBER(*,0) NOT NULL ENABLE,
    111      "CONTRACT_NUM" VARCHAR2(25 CHAR) NOT NULL ENABLE,
    112      "CONTRACT_DT" DATE,
    113      "CONTRACT_TYPE"     VARCHAR2(15 CHAR) NOT NULL ENABLE,
    114      "CONTRACT_LINE_NUM" NUMBER(*,0) NOT NULL ENABLE,
    115      "FREIGHT_TERMS"     VARCHAR2(10 CHAR) NOT NULL ENABLE,
    116      "BILL_OF_LADING"    VARCHAR2(30 CHAR) NOT NULL ENABLE,
    117      "COUNTRY_SHIP_FROM" VARCHAR2(3 CHAR) NOT NULL ENABLE,
    118      "COUNTRY_SHIP_TO"   VARCHAR2(3 CHAR) NOT NULL ENABLE,
    119      "SHIP_TO_CUST_ID"   VARCHAR2(15 CHAR) NOT NULL ENABLE,
    120      "SHIP_TO_ADDR_NUM"  NUMBER(*,0) NOT NULL ENABLE,
    121      "SHIP_ID"           VARCHAR2(10 CHAR) NOT NULL ENABLE,
    122      "SHIP_TYPE_ID"      VARCHAR2(10 CHAR) NOT NULL ENABLE,
    123      "SHIP_FROM_BU"      VARCHAR2(5 CHAR) NOT NULL ENABLE,
    124      "SHIP_DATE" DATE,
    125      "SHIP_TIME" TIMESTAMP (6),
    126      "PACKSLIP_NO"      VARCHAR2(22 CHAR) NOT NULL ENABLE,
    127      "LC_ID"            VARCHAR2(12 CHAR) NOT NULL ENABLE,
    128      "LOC_DOC_ID"       VARCHAR2(15 CHAR) NOT NULL ENABLE,
    129      "SEQUENCE_NBR"     NUMBER(*,0) NOT NULL ENABLE,
    130      "SOLD_TO_CUST_ID"  VARCHAR2(15 CHAR) NOT NULL ENABLE,
    131      "SOLD_TO_ADDR_NUM" NUMBER(*,0) NOT NULL ENABLE,
    132      "BUSINESS_UNIT_PC" VARCHAR2(5 CHAR) NOT NULL ENABLE,
    133      "BUSINESS_UNIT_CA" VARCHAR2(5 CHAR) NOT NULL ENABLE,
    134      "RT_EFFDT" DATE,
    135      "BILL_PLAN_ID"      VARCHAR2(10 CHAR) NOT NULL ENABLE,
    136      "PC_DISTRIB_STATUS" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    137      "BPLAN_LN_NBR"      NUMBER(*,0) NOT NULL ENABLE,
    138      "EVENT_OCCURRENCE"  NUMBER(*,0) NOT NULL ENABLE,
    139      "XREF_SEQ_NUM"      NUMBER(*,0) NOT NULL ENABLE,
    140      "CONTRACT_PPD_SEQ"  NUMBER(*,0) NOT NULL ENABLE,
    141      "ANALYSIS_TYPE"     VARCHAR2(3 CHAR) NOT NULL ENABLE,
    142      "RESOURCE_ID"       VARCHAR2(40 CHAR) NOT NULL ENABLE,
    143      "RESOURCE_TYPE"     VARCHAR2(5 CHAR) NOT NULL ENABLE,
    144      "RESOURCE_CATEGORY" VARCHAR2(5 CHAR) NOT NULL ENABLE,
    145      "RESOURCE_SUB_CAT"  VARCHAR2(5 CHAR) NOT NULL ENABLE,
    146      "ACTIVITY_ID"       VARCHAR2(15 CHAR) NOT NULL ENABLE,
    147      "ACTIVITY_TYPE"     VARCHAR2(5 CHAR) NOT NULL ENABLE,
    148      "DIST_CFG_FLAG"     VARCHAR2(1 CHAR) NOT NULL ENABLE,
    149      "PRODUCT_KIT_ID"    VARCHAR2(18 CHAR) NOT NULL ENABLE,
    150      "SYSTEM_SOURCE"     VARCHAR2(3 CHAR) NOT NULL ENABLE,
    151      "EMPLID"            VARCHAR2(11 CHAR) NOT NULL ENABLE,
    152      "EMPL_RCD"          NUMBER(*,0) NOT NULL ENABLE,
    153      "START_DT" DATE,
    154      "END_DT" DATE,
    155      "FROM_DT" DATE,
    156      "TO_DT" DATE,
    157      "SERVICE_CUST_ID"    VARCHAR2(15 CHAR) NOT NULL ENABLE,
    158      "SERVICE_ADDR_NUM"   NUMBER(*,0) NOT NULL ENABLE,
    159      "NOTE_TYPE"          VARCHAR2(10 CHAR) NOT NULL ENABLE,
    160      "STD_NOTE_FLAG"      VARCHAR2(1 CHAR) NOT NULL ENABLE,
    161      "INTERNAL_FLAG"      VARCHAR2(1 CHAR) NOT NULL ENABLE,
    162      "HDR_OR_LINE_NOTE"   VARCHAR2(1 CHAR) NOT NULL ENABLE,
    163      "AR_LVL"             VARCHAR2(1 CHAR) NOT NULL ENABLE,
    164      "AR_DST_OPT"         VARCHAR2(1 CHAR) NOT NULL ENABLE,
    165      "GL_LVL"             VARCHAR2(1 CHAR) NOT NULL ENABLE,
    166      "ENABLE_DFR_REV_FLG" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    167      "BILLING_SPECIALIST" VARCHAR2(8 CHAR) NOT NULL ENABLE,
    168      "BILLING_AUTHORITY"  VARCHAR2(8 CHAR) NOT NULL ENABLE,
    169      "BILLING_FREQUENCY"  VARCHAR2(3 CHAR) NOT NULL ENABLE,
    170      "BILL_INQUIRY_PHONE" VARCHAR2(24 CHAR) NOT NULL ENABLE,
    171      "SALES_PERSON"       VARCHAR2(8 CHAR) NOT NULL ENABLE,
    172      "COLLECTOR"          VARCHAR2(8 CHAR) NOT NULL ENABLE,
    173      "CR_ANALYST"         VARCHAR2(8 CHAR) NOT NULL ENABLE,
    174      "INVOICE_FORM_ID"    VARCHAR2(10 CHAR) NOT NULL ENABLE,
    175      "STD_NOTE_CD"        VARCHAR2(10 CHAR) NOT NULL ENABLE,
    176      "TOT_LINE_DST_AMT"   NUMBER(26,3) NOT NULL ENABLE,
    177      "TOT_LINE_DST_PCT"   NUMBER(5,2) NOT NULL ENABLE,
    178      "TOT_LINE_DFR_PCT"   NUMBER(5,2) NOT NULL ENABLE,
    179      "TOT_LINE_DFR_AMT"   NUMBER(26,3) NOT NULL ENABLE,
    180      "TOT_LINE_UAR_AMT"   NUMBER(26,3) NOT NULL ENABLE,
    181      "TOT_LINE_UAR_PCT"   NUMBER(5,2) NOT NULL ENABLE,
    182      "SSN"                VARCHAR2(9 CHAR) NOT NULL ENABLE,
    183      "CHARGE_FROM_DT" DATE,
    184      "CHARGE_TO_DT" DATE,
    185      "SUBCUST_QUAL1"      VARCHAR2(15 CHAR) NOT NULL ENABLE,
    186      "SUBCUST_QUAL2"      VARCHAR2(15 CHAR) NOT NULL ENABLE,
    187      "REIMB_AGREEMENT"    VARCHAR2(25 CHAR) NOT NULL ENABLE,
    188      "TOT_DISCOUNT_AMT"   NUMBER(26,3) NOT NULL ENABLE,
    189      "TOT_SURCHARGE_AMT"  NUMBER(26,3) NOT NULL ENABLE,
    190      "ACCUMULATE"         VARCHAR2(1 CHAR) NOT NULL ENABLE,
    191      "VAT_TREATMENT_GRP"  VARCHAR2(4 CHAR) NOT NULL ENABLE,
    192      "COUNTRY_VAT_BILLFR" VARCHAR2(3 CHAR) NOT NULL ENABLE,
    193      "COUNTRY_VAT_BILLTO" VARCHAR2(3 CHAR) NOT NULL ENABLE,
    194      "VAT_TREATMENT"      VARCHAR2(4 CHAR) NOT NULL ENABLE,
    195      "PHYSICAL_NATURE"    VARCHAR2(1 CHAR) NOT NULL ENABLE,
    196      "COUNTRY_LOC_BUYER"  VARCHAR2(3 CHAR) NOT NULL ENABLE,
    197      "STATE_LOC_BUYER"    VARCHAR2(6 CHAR) NOT NULL ENABLE,
    198      "COUNTRY_LOC_SELLER" VARCHAR2(3 CHAR) NOT NULL ENABLE,
    199      "STATE_LOC_SELLER"   VARCHAR2(6 CHAR) NOT NULL ENABLE,
    200      "VAT_SVC_SUPPLY_FLG" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    201      "VAT_SERVICE_TYPE"   VARCHAR2(1 CHAR) NOT NULL ENABLE,
    202      "COUNTRY_VAT_PERFRM" VARCHAR2(3 CHAR) NOT NULL ENABLE,
    203      "STATE_VAT_PERFRM"   VARCHAR2(6 CHAR) NOT NULL ENABLE,
    204      "COUNTRY_VAT_SUPPLY" VARCHAR2(3 CHAR) NOT NULL ENABLE,
    205      "STATE_VAT_SUPPLY"   VARCHAR2(6 CHAR) NOT NULL ENABLE,
    206      "STATE_SHIP_FROM"    VARCHAR2(6 CHAR) NOT NULL ENABLE,
    207      "STATE_SHIP_TO"      VARCHAR2(6 CHAR) NOT NULL ENABLE,
    208      "MAST_CONTR_ID"      VARCHAR2(25 CHAR) NOT NULL ENABLE,
    209      "TAX_CUST_ID"        VARCHAR2(15 CHAR) NOT NULL ENABLE,
    210      "BUSINESS_UNIT_AM"   VARCHAR2(5 CHAR) NOT NULL ENABLE,
    211      "BUSINESS_UNIT_AMTO" VARCHAR2(5 CHAR) NOT NULL ENABLE,
    212      "ASSET_ID"           VARCHAR2(12 CHAR) NOT NULL ENABLE,
    213      "PROFILE_ID"         VARCHAR2(10 CHAR) NOT NULL ENABLE,
    214      "COST_TYPE"          VARCHAR2(1 CHAR) NOT NULL ENABLE,
    215      "STATE_VAT_DEFAULT"  VARCHAR2(6 CHAR) NOT NULL ENABLE,
    216      "SO_ID"              VARCHAR2(15 CHAR) NOT NULL ENABLE,
    217      "BUSINESS_UNIT_RF"   VARCHAR2(5 CHAR) NOT NULL ENABLE,
    218      "SOURCE_REF_TYPE"    VARCHAR2(3 CHAR) NOT NULL ENABLE,
    219      "SOURCE_REF_NO"      VARCHAR2(35 CHAR) NOT NULL ENABLE,
    220      "SOURCE_REF_KEY"     VARCHAR2(5 CHAR) NOT NULL ENABLE,
    221      "USER_AMT1"          NUMBER(26,3) NOT NULL ENABLE,
    222      "USER_AMT2"          NUMBER(26,3) NOT NULL ENABLE,
    223      "USER_DT1" DATE,
    224      "USER_DT2" DATE,
    225      "USER1" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    226      "USER2" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    227      "USER3" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    228      "USER4" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    229      "USER5" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    230      "USER6" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    231      "USER7" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    232      "USER8" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    233      "USER9" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    234      "SETID" VARCHAR2(5 CHAR) NOT NULL ENABLE,
    235      "ADD_DTTM" TIMESTAMP (6),
    236      "LAST_UPDATE_DTTM" TIMESTAMP (6),
    237      "DELETE_ROWS" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    238      "BOOK"        VARCHAR2(10 CHAR) NOT NULL ENABLE,
    239      "DTTM_STAMP" TIMESTAMP (6),
    240      "VAT_RVRSE_CHG_GDS"  VARCHAR2(1 CHAR) NOT NULL ENABLE,
    241      "TAX_CD_VAT_RVC"     VARCHAR2(8 CHAR) NOT NULL ENABLE,
    242      "TAX_CD_VAT_RVC_PCT" NUMBER(7,4) NOT NULL ENABLE,
    243      "VAT_AMT_RVC"        NUMBER(26,3) NOT NULL ENABLE,
    244      "VAT_AMT_RVC_BSE"    NUMBER(26,3) NOT NULL ENABLE,
    245      "VAT_AMT"            NUMBER(26,3) NOT NULL ENABLE,
    246      "VAT_AMT_BSE"        NUMBER(26,3) NOT NULL ENABLE,
    247      "TAX_CD_VAT_PCT"     NUMBER(7,4) NOT NULL ENABLE
    248    )
    249    SEGMENT CREATION DEFERRED PCTFREE 10 PCTUSED 80 INITRANS 1 MAXTRANS 255 N
    OCOMPRESS LOGGING STORAGE
    250    (
    251      INITIAL 16384 NEXT 16384 MAXEXTENTS 2147483645 PCTINCREASE 0
    252    )
    253    TABLESPACE "AMAPP" ;
    
    Table created.
    
    Elapsed: 00:00:00.76
    SQL> CREATE UNIQUE INDEX "SYSADM"."DRIVERTEST1" ON "SYSADM"."DRIVERTEST"
      2    (
      3      "PROCESS_INSTANCE", "INTFC_ID", "INTFC_LINE_NUM", "TRANS_TYPE_BI", "TRA
    NS_TYPE_BI_SEQ"
      4    )
      5    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
      6    (
      7      INITIAL 16384 NEXT 106496 MAXEXTENTS 2147483645 PCTINCREASE 0
      8    )
      9    TABLESPACE "PSINDEX" ;
    
    Index created.
    
    Elapsed: 00:00:00.04
    SQL>
    SQL> drop table DRIVERTEST;
    
    Table dropped.
    
    Elapsed: 00:00:24.90
    This is company Oracle 11.2.0.3 on 64-bit Windows.

    Thanks for any input.

    Mika wrote:
    >
    user as a result of the drop statement

    Let fall the waterfall DRIVERTEST table purge constraints;
    >

    Translates into a decline of almost immediate table, why is this? Does this mean that the longest execution time has been only because the table has been preserved in the trash?

    If correctly, I assume you're on Peoplesoft, you should try turn off the recyclebin before running the script generated by the application Designer, or purge the first recyclebin which could be huge because of the mechanism of migration of Peoplesoft.
    Or probably better, in the configuration settings, tab "Alter", check "Alter in place" instead of "Alter by changing the Table name". "." The first will modify the table, to create a temporary table (fill in the former), drop the old, then rename the temporary table.

    And don't forget to add crazy missing "when sqlerror exit" at the beginning of the script, otherwise you could have a very sad surprise.

    Nicolas.

    Comment added to configuration settings
    Published by: Gasparotto N on April 12, 2013 13:07

Maybe you are looking for

  • sessionstore.js cannot be created.

    I checked all my settings, all about: config is very good for what is the session storage is, I tried to use an add-on to save my session, but also the creation of "sessionstore.js" is simply impossible. "

  • Plug in update checker does not

    When I click to check the plug in updates, it goes to the website to update but nothing happens. the plugins are not checked for updates that I noticed this since upgrading to FF 18.02.

  • Is it possible that I can put in place to make the firefox browser will automatically close if it is sitting idle for more than a specified time

    its simple, my mother and her boyfriend have a real bad habit away from their computers, leaving their browsers on and no matter how many times I tell them that they need to close the browser down when their fact use it unless they know that they wil

  • Skype for Windows 8

    I run Windows 8 and I am very very unhappy with the interface of Skype, I am forced to use... I want the no touch screen of this software version and I never ever evr want review the touchscreen of Skype version... does anyone know how to defeat for

  • Pressure.VI help

    Hello Im a student working to the test with the polymer PDMS under pressure. I hope you can help me with a little problem I have met. I use a Honeywell P40 series pressure sensor connected in a 6218 USB of NOR. It is a program to measure the pressure