Truncate Table generates cancel?

What I understand, TRUNCATE TABLE resets the high water and after some discussions and information on the web creates a small amount of cancellation. For example, http://www.orafaq.com. However, documentation of Oracle 11 g 2 to truncating Tables and Clusters makes clear that it does not generate just undo.

Quote: A TRUNCATE statement does not generate the cancellation information and committed immediately. It is a DDL statement and cannot be cancelled.

TRUNCATE is apparently done a COMMIT before and after he runs, which would explain why there is no ROLLBACK. And if I'm not mistaken, any DML or DDL statement must create an entry in the log again first, before you run.

Which is correct? Does TRUNCATE really create no CANCELLATION and implicit VALIDATION is perhaps only a protection measure, or what is the real story here? I tried a few tests, playing with the employee_demo table, but I have not been able so far to know what has changed in the UNDO tablespace. Unfortunately, I'm not a great expert on PL/SQL and do not use it much. Is there a way to simply to query or compare the cancellation of table before and after a truncate table operation to see the difference? By comparing the size is not.

Thank you!

Summary/Conclusion:

The answer, in other words, is that TRUNCATE TABLE Undo. This cancellation information cannot be used by the user to RESTORE a TRUNCATE TABLE, which also applies to the other DDL statements, but may be required by the body to perform the database crash recovery.

Because TRUNCATE TABLE changes the metadata in the data dictionary and resets the high tide of the object, it produces much less that cancel the DML statements as DELETE. However, it would probably not be the Oracle database if everything were that easy.

If you happen to find this interesting question and wish to know more on it again and cancel the process regarding the DDL statements, some of the responses I received the case very resourceful and provided information you many not know or will not find in the usual documentation.

I can mark only one answer is right and just caught the first response that provided an answer to my original question. The answers that I've marked as useful are those replies which I think has provided good explanations or added interesting new aspects or information thereon.

Thank you all for your time and your contributions!

To check the generation of cancellation (example):

SQL > select count (*) from t1;

COUNT (*)

----------

1000000

1 selected line.

SQL > select name, value of V$ mystat ms, v$ statname sn where sn.statistic # ms.statistic # and sn.name like '% cancellation' and ms.value =! = 0 ;

NAME                                                                  VALUE

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

cancel changes vector size 192

1 selected line.

SQL > truncate table t1;

Table truncated.

SQL > select name, value of V$ mystat ms, v$ statname sn where sn.statistic # ms.statistic # and sn.name like '% cancellation' and ms.value =! = 0 ;

NAME                                                                  VALUE

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

cancel the change in size of vector 31272

1 selected line.

The cancellation that would have been generated by a deletion would have been of the order of one hundred twenty megabytes - but you'll have to take my word for it.

This small amount of cancellation would have been associated a few blocks management cleared space, the day and possibly put segment header some updating of the data dictionary (your changes of $ tab_stats).

To prove that some cancel the blocks of space for the table (and its indexes) management, you would probably have to spend just before truncation, then truncation of log files, then empty the current log file to get a picture of minimum log that you could review to see which blocks had been affected by again them and the bits from the redo had correspondent (or on the contrary (, reversing) entries created in cancel it. You would then be able to see exactly what had happened to the table (and index) blocks and how this action had been protected by the cancellation.

Bottom line - people often say that "truncate" generates no cancellation, what they really mean is that it generates no cancellation for data, although it always generates a relatively small amount of cancellation for the meta-data.

Concerning

Jonathan Lewis

P.S. before everybody does point out that there are always special cases - truncation of a table in a cluster is implemented as a deletion.

Tags: Database

Similar Questions

  • Hello Mr President! I have a few questions about the Word report generation please.1.How can I add a border to a page in word? 2. How can I add gridlines to a table generated related word?. Can 3. how I add a border to a picture of the Word report?. Thank

    Hello!

    Sir, I have a few questions about generating word reports using (C language in labwindows) please.

    1. How can I add a border to a page in word?

    2. How do I add border lines and grid to a table generated in Word report (not "cvi control table"inserted from gui, I wonder about the table generated in Word report)?

    3. How can I fill a table cell of report word with the data type other than 'character '.

    And sir a question on the use of the timer in labwindows cvi please.

    Sir, I'm trying to set a time minimum interval timer to 1millisecond (0.001 s), that I have set, timer cares about the interval set by me he only meets the minimum default time interval which is, I think as 10milliseconds (I'm using windows xp service Pack 3 version 2002).

    Concerning

    Imran

    Pakistan

    Have you read this statement ? It explains how to set the registry value:

    If the REG_SZ useDefaultTimer does not already exist, you must create it under HKEY_LOCAL_MACHINE\SOFTWARE\National Instruments\CVI Run-Time Engine\cvirte. "" This can be done navigate to the appropriate folder, and then click Edit "New" string value. Then, click on means the name of the new value created, select Rename, and then specify useDefaultTimer as the name. Finally, double click on the name and specify the value True or False.

  • How to get the selected row in a programmatic table of the ADF (table generated from a bean)

    Hi all


    We use JDeveloper Studio Edition Version 12.1.3.0.0 and deployed on GlassFish Server Open Source Edition 3.1.2.2 (build 5) and connect to the SQLServer database.


    How to get the selected line in a programmatic (using a SortableModel custom not a display object) ADF table (generated from a bean)?


    We are trying to get the selected row in a bean of a programmatic ADF table to retrieve data based on the selected line.


    Any idea?

    Well, you can use selectionListener to set the selected line to a variable of bean (but this bean must be in extended view or some superiors)

    Something like this: http://www.awasthiashish.com/2015/07/get-selected-row-singlemultiple-from.html

    Dario

  • Table generated by the system type: behavior or bug WAITED?

    I understand that Oracle, in the execution of a SQL statement, sometimes automatically generates objects SQL not explicitly created by the user. One such example is with table in pipeline defined functions to return a collection type of PL/SQL (as opposed to SQL): in this case, Oracle will automatically create an equivalent SQL collection type for the PL/SQL collection type. All well and good...

    However, here is an example where it would appear that oracle unnecessarily creates a SQL collection type, even when there is an explicit CONVERSION to an already existing SQL collection type. The problem seems to be related to the use of the function of COLLECTION (http://docs.oracle.com/database/121/SQLRF/functions034.htm#SQLRF06304).

    First the test script...

    prompt    -- The database version...
    
    select    *
    from    v$version
    /
    
    prompt    -- Create the test object and collection types...
    
    create or replace type OMyObject
    is object
    (
        a integer
    )
    /
    
    create or replace type NMyObjectTable
    is table of OMyObject
    /
    
    prompt    -- Check that no system-generated table types currently exist...
    
    select    C.COLL_TYPE, C.ELEM_TYPE_MOD, C.ELEM_TYPE_NAME, C.TYPE_NAME, C.UPPER_BOUND
    from    USER_COLL_TYPES c
    where    c.TYPE_NAME like 'SYS%'
    and    c.ELEM_TYPE_NAME = 'OMYOBJECT'
    /
    
    prompt    -- CAST with MULTISET does not create a system-generated table type...
    
    select    cast(multiset(
            select    new OMyObject(level)
            from    DUAL
            connect by
                level <= 10
        ) as NMyObjectTable) myObjects
    from    DUAL
    /
    
    select    C.COLL_TYPE, C.ELEM_TYPE_MOD, C.ELEM_TYPE_NAME, C.TYPE_NAME, C.UPPER_BOUND
    from    USER_COLL_TYPES c
    where    c.TYPE_NAME like 'SYS%'
    and    c.ELEM_TYPE_NAME = 'OMYOBJECT'
    /
    
    prompt    -- COLLECT without a CAST creates a new system-generated table type...
    
    select    collect(value(o)) myObjects
    from    table(cast(multiset(
            select    new OMyObject(level)
            from    DUAL
            connect by
                level <= 10
        ) as NMyObjectTable)) o
    /
    
    select    C.COLL_TYPE, C.ELEM_TYPE_MOD, C.ELEM_TYPE_NAME, C.TYPE_NAME, C.UPPER_BOUND
    from    USER_COLL_TYPES c
    where    c.TYPE_NAME like 'SYS%'
    and    c.ELEM_TYPE_NAME = 'OMYOBJECT'
    /
    
    prompt    -- (Drop the system-generated table type...)
    
    set    feedback off
    
    spool    "temp_drop_table_types.sql"
    
    select    'drop type "' || C.TYPE_NAME || '";'    as "-- Drop statement"
    from    USER_COLL_TYPES c
    where    c.TYPE_NAME like 'SYS%'
    and    c.ELEM_TYPE_NAME = 'OMYOBJECT'
    /
    
    spool    off
    
    set    feedback on
    
    @"temp_drop_table_types.sql"
    
    prompt    -- COLLECT with a CAST also creates a system-generated table type...
    
    select    cast(collect(value(o)) as NMyObjectTable) myObjects
    from    table(cast(multiset(
            select    new OMyObject(level)
            from    DUAL
            connect by
                level <= 10
        ) as NMyObjectTable)) o
    /
    
    select    C.COLL_TYPE, C.ELEM_TYPE_MOD, C.ELEM_TYPE_NAME, C.TYPE_NAME, C.UPPER_BOUND
    from    USER_COLL_TYPES c
    where    c.TYPE_NAME like 'SYS%'
    and    c.ELEM_TYPE_NAME = 'OMYOBJECT'
    /
    
    

    which outputs...

    -The version of database...

    BANNER                                                                               CON_ID

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

    Database Oracle 12 c Enterprise Edition Release 12.1.0.2.0 - 64 bit Production 0

    PL/SQL Release 12.1.0.2.0 - Production 0

    CORE 12.1.0.2.0 Production 0

    AMT for 64-bit Windows: Version 12.1.0.2.0 - Production 0

    NLSRTL Version 12.1.0.2.0 - Production 0

    5 selected lines.

    -Create the test object and collection types.

    Type of creation.

    Type of creation.

    -Check that there is currently no type of system-generated table...

    no selected line.

    -Cast IRON with MULTISET does not create a table generated by the system type...

    MYOBJECTS (A)

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

    NMYOBJECTTABLE (OMYOBJECT (1), OMYOBJECT (2), OMYOBJECT)

    (3), OMYOBJECT (4), OMYOBJECT (5), OMYOBJECT (6), OMYOBJECT

    ((7), OMYOBJECT (8), OMYOBJECT (9), OMYOBJECT (10))

    1 selected line.

    no selected line.

    -At expense LEDGES without a DISTRIBUTION creates a new type of system-generated table...

    MYOBJECTS (A)

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

    SYSTPUBsptM + HT5OlTJUtIcUfgg is (OMYOBJECT (1), OMYOBJEC)

    OMYOBJE, OMYOBJECT (4), (2) T, OMYOBJECT (5), OMYOBJECT (3)

    CT (6), OMYOBJECT (7), OMYOBJECT (8), OMYOBJECT (9), OMYOBJ

    ECT (10))

    1 selected line.

    COLL_TYPE ELEM_TYPE_MOD ELEM_TYPE_NAME TYPE_NAME UPPER_BOUND

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

    TABLE OMYOBJECT SYSTPUBsptM + HT5OlTJUtIcUfgg is

    1 selected line.

    -(Drop the type generated by the system of table...)

    -Drop statement

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

    ' Drop type' SYSTPUBsptM + HT5OlTJUtIcUfgg == ";

    Type fell.

    -At expense LEDGES with a CAST also creates a table generated by the system type...

    MYOBJECTS (A)

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

    NMYOBJECTTABLE (OMYOBJECT (1), OMYOBJECT (2), OMYOBJECT)

    (3), OMYOBJECT (4), OMYOBJECT (5), OMYOBJECT (6), OMYOBJECT

    ((7), OMYOBJECT (8), OMYOBJECT (9), OMYOBJECT (10))

    1 selected line.

    COLL_TYPE ELEM_TYPE_MOD ELEM_TYPE_NAME TYPE_NAME UPPER_BOUND

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

    TABLE OMYOBJECT is SYSTPds/KlYeDTnaiTKLsbcLJpg

    1 selected line.

    This behavior is expected, or should it be considered a bug? Thoughts?

    Gerard

    This known issue and how Oracle offers with him (i.e. the SMON process periodically cleans transitional objects) is described in the Doc ID 1603706.1.

    Gerard

  • Truncate table audit

    11.2.0.4.0

    Possible to truncate table of audit?  Ive tried some of the methods that are being pushed on the web, but nothing works.

    -clear the aud$

    truncate table sys.aud$

    create the table t1_trunc as

    (select * from dba_objects)

    Audit truncated;

    table of audit;

    truncate table t1_trunc;

    Select * from sys.aud$ not = no line.

    user47708, I don't think that you should open a SR because I can audit truncated.  First sysdba users are given unverified as regular users, then you need to perform the truncation of a new session started after the audit truncate was issued.  I have both audit and audit table truncate together.  The database must have naturally the audit_trail one value other than 'none '.

    - -

    > audit truncated;

    Verification succeeded.

    > table of audit;

    Verification succeeded.

    > connect mpowel01
    Enter the password:
    Connected.
    MPOWEL01 > truncate table marktest.

    Table truncated.

    MPOWEL01 > select count (*) in the dba_audit_trail where action_name like "TRUNC % % ';

    COUNT (*)
    ----------
    1

    - -

    HTH - Mark D Powell.

    PS - test ran on the 10.2.0.5 version

  • The truncated table rows

    Hi team,

    One of my colleague ran a batch which will truncate a table and insert the final table by extracting data from different tables in backup taking the old table.

    But today before 10 minutes he missed to keep the export backup of this table and ran the batch. All the old data of the truncated table and now we need these data.

    Flashback is DISABLED in our case and Undo retention is dry 7200 and since it is a DDL so it will change the definition of the table.

    Is it possible to get the data that truncated.

    Daily HT full backup will run and we are in the process of restoring the backup but the db size is 4 TB and it will take time and then let's apply archive logs, before that got truncated.

    Until can we try something else?

    Hemant seems good to me.

    Please check the Version of Oracle where you are restoring the database and the Oracle version of the primary database that saves youi have taken.

    I'm 100% sure that there could be the difference in the release.

    We faced this problem 2 times and every time the issue is different binary or different architecture was the problem.

  • I want to know when we issue statement truncate table in oracle.

    I want to know when we issue statement truncate table in oracle. No newspaper will be write in the redo log. But we can recover data using flashback or SNA. I want to know where the actually truncate table statement log is stored in the oracle database. Please explain to me in detail step by step.

    >
    I understand your SNA. But I want to know where the truncate statement stored log. But in the redo log, no entry for truncate.but I want to go which connect there is no market value back...
    >
    If you are still wondering after getting the answer so you don't "understand".

    You have received the reply above. Archive of flashback stores data.

    See the link provided above to CREATE an ARCHIVE of FLASHBACK in the doc of SQL language
    http://docs.Oracle.com/CD/E11882_01/server.112/e26088/statements_5010.htm
    >
    TABLESPACE clause

    Specify the table space where the data archived for this flashback data archive referring to be stored. You can specify that a tablespace with this clause. However, you can then add tablespaces to archive flashback with a statement ALTER FLASHBACK ARCHIVE database.
    >
    The data is moved to storage of archives and restored from there when you query for archive flashback.

  • Truncate table removes the corresponding LOB segment of the table or not?

    Hi all

    I have little table with BUSINESS segments, if I pull the table truncated on the table it will purge the LOB segment as well?

    About how long will take to truncate 100 GB LOB segments.

    Thank you

    903787 wrote:
    Hello

    1 Truncate will delete the LOB segment or not?

    It will not erase the LOB segments, but it must release the majority of the allocated space.

    >

    2. If you want to recover the space, we need to run the command, below is correct?

    ALTER TABLE CHANGE LOB (LOB_COLUMN) (SHRINK SPACE);

    Should not be necessary to 11.2:

    SQL> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for 32-bit Windows: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    
    SQL> select count(*) from user_segments;
    
      COUNT(*)
    ----------
             0
    
    SQL>
    SQL> create table t(x clob);
    
    Table created.
    
    SQL> select segment_name, segment_type, bytes
      2  from user_segments;
    
    SEGMENT_NAME                             SEGMENT_TYPE            BYTES
    ---------------------------------------- ------------------ ----------
    T                                        TABLE                   65536
    SYS_IL0000030908C00001$$                 LOBINDEX                65536
    SYS_LOB0000030908C00001$$                LOBSEGMENT              65536
    
    SQL>
    SQL> insert into t select lpad(segment_name,8192) from dba_segments;
    
    6312 rows created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL>
    SQL> select segment_name, segment_type, bytes
      2  from user_segments;
    
    SEGMENT_NAME                             SEGMENT_TYPE            BYTES
    ---------------------------------------- ------------------ ----------
    T                                        TABLE                  393216
    SYS_IL0000030908C00001$$                 LOBINDEX                65536
    SYS_LOB0000030908C00001$$                LOBSEGMENT           53477376
    
    SQL>
    SQL> truncate table t;
    
    Table truncated.
    
    SQL>
    SQL> select segment_name, segment_type, bytes
      2  from user_segments;
    
    SEGMENT_NAME                             SEGMENT_TYPE            BYTES
    ---------------------------------------- ------------------ ----------
    T                                        TABLE                   65536
    SYS_IL0000030908C00001$$                 LOBINDEX                65536
    SYS_LOB0000030908C00001$$                LOBSEGMENT              65536
    
    SQL>
    SQL> alter table t modify lob(x) (shrink space);
    
    Table altered.
    
    SQL>
    SQL> select segment_name, segment_type, bytes
      2  from user_segments;
    
    SEGMENT_NAME                             SEGMENT_TYPE            BYTES
    ---------------------------------------- ------------------ ----------
    T                                        TABLE                   65536
    SYS_IL0000030908C00001$$                 LOBINDEX                65536
    SYS_LOB0000030908C00001$$                LOBSEGMENT              65536
    
    SQL>
    
  • TRUNCATE Table - task failed

    Hi friends,

    Im making a loading SCM using R12.1.3 when running I met an error like below
    2012-08-07 15:24:07.734 TRUNCATE TABLE:OPI_OBIA_W_BOM_HEADER_DS:"Table Action: Override OPI truncate command" template has started.
    ANOMALY INFO::: Error while executing : TRUNCATE TABLE:OPI_OBIA_W_BOM_HEADER_DS:"Table Action: Override OPI truncate command" template
    MESSAGE:::com.siebel.analytics.etl.execution.exceptions.ActionFailedException: Running Custom Sql list TRUNCATE TABLE:OPI_OBIA_W_BOM_HEADER_DS:"Table Action: Override OPI truncate command" template
    Default retries for this custom SQL is 1.
    
    executing sql (Truncate OPI:EBS11i)
    TRUNCATE TABLE OPI.OPI_OBIA_W_BOM_HEADER_DS
    For the foregoing regarding the link below error, they said like to apply a path 10422612

    https://forums.Oracle.com/forums/thread.jspa?threadID=2386306 & tstart = 75_ +.

    But when I tried to download this patch to resolve the above issue, a password is required to download the file in mysupport.

    Is there an alternative link to download this patch file.

    Thank you

    Kind regards
    Saro

    Yes, you need to get the password of Oracle by SR.

    Given that you do not use these tables, you can make it inactive task force TASK_GROUP_Extract_BOM. Of course respective tasks of SDE and SIL are also inactive.
    Once you with changes assemble the business sector and build of EP.

    Hope this helps

  • Using 'STORAGE of REUSE' with the command 'TRUNCATE TABLE '.

    Because ' truncate table... reuse storage "speed up the tronquantes process?

    Sometimes statements truncation takes about 30 minutes and other times just a few minutes.

    What are the backs of uinsg print 'reuse storage?

    The RE-USE of STORAGE clause is used to prevent the allocated storage of back to the pool.
    Consider this scenario for a typical daily load of an intermediate table

    1. Empty the table of yesterday's data - TRUNCATE it
    2. Load the table with today's data - INSERT 
    

    If you load a large number of records it takes time for Oracle to allocate storage for records
    When you use Oracle TRUNCATED must return the storage allocated to the pool.
    Then when you INSERT new records, that oracle has to allocate the space that he could have used, but returned to the pool.

    If you use TRUNCATE... RE-USE of STORAGE Oracle truncates the table but keep the storage and it will reuse the same storage
    When you do the INSERT instead of having to take the time to allocate new storage.

    So, there are two options to speed up ETL processes like that.
    1. use TRUNCATED... RE-USE of STORAGE and a standard INSERT query

    2. use TRUNCATE and INSERT / * + APPEND * / and make the table NOLOGGING to INSERT it. This will make a big
    load. Oracle must allocate space, but the load mass will make them more effective than a standard INSERT.

    -editing to update after reading the reference asktom
    Storage of back to the pool takes time, so REUSE STORAGE of coding may be faster. The real advantage comes with the next load of data, however if you use a standard INSERT (and not in BULK or direct load) because Oracle failed to reallocate storage.

    If RE-USE eliminates the return of storage to the pool, as well as the allocation of the new storage for the next INSERTION.

    Published by: rp0428 on February 20, 2012 11:16

  • Grant to truncate table

    I truncate tables 4 to another user.

    I grant kind of what I need to to my user to perform this specific task in the table in another schema?

    Thank you
    Luciana

    The only way to be able to issue a command TRUNCATED on a table, you aren't owner would be to give the DROP ANY TABLE privilege. No worthy of their name DBA would allow that to happen.

    Another solution would be to create a stored procedure, owned by the owner of the tables (or a DBA account) who performs the dynamic SQL statements to truncate the tables in question. The owner of this procedure would then grant you EXECUTE access to the procedure.

    Justin

  • Truncate table issues

    Hi people,

    Environment: 10g Rel 2

    I am trying to prove the following two points by way of experimentation

    truncate table operation, her will reset the high water mark (HWM) on the first block of data for use in the segment of the table

    # Take a snapshot of HWM before the truncation operation
    select a.BLOCKS - b.EMPTY_BLOCKS -1 HWM
    from
      (SELECT BLOCKS
       FROM   DBA_SEGMENTS
       WHERE  OWNER=UPPER('JIM') AND SEGMENT_NAME = UPPER('EMPLOYEES')) a,
       (SELECT EMPTY_BLOCKS
        FROM   DBA_TABLES
        WHERE  OWNER=UPPER('JIM') AND TABLE_NAME = UPPER('EMPLOYEES')) b;
    Released: 7

    truncate table JIM. EMPLOYEES;

    Re ran the code above and got the same result (i.e. 7 blocks). I expect to see 0 instead blocks? The query above is the correct method of
    find the HWM?



    b, the truncate operation also truncates the corresponding indices of the table

    Q, is there a view that will show you all the values of indexes on the table? These values will probably be meaningless, but I would like to see them before
    and after the truncation operation.

    Thank you

    rogers42

    (a) If you would read on the empty_blocks column in dba_tables, you would have known that it is populated with dbms_stats.
    Did you run dbms_stats.analyze_table?

    (b)
    Didn't this view.
    All the dictionary views are documented in the DICT view and documentation online.

    ------------
    Sybrand Bakker

  • Truncate table procedure

    Hello
    I would like to create the following procedure on Oracle 10 g:
    ----------
    CREATE OR REPLACE PROCEDURE TEST2_RUN AS
    BEGIN
    truncate the storage of drop table TEST2;
    Insert into TEST2)
    FORMATTED_BATCH_ID,
    A_AKT_MYRAKT_CELL_1AIRE_BAF3,
    A_ALK_NPM_ALK_CELL_1AIRE_BAF3,
    A_ALK_NPM_ALK_CELL_2AIRE_BAF3,
    A_BCRABL_CELL_1AIRE_BAF3,
    A_BCRABL_CELL_2AIRE_BAF3,
    A_BCRABL_CELL_2AIRE_KU_812,
    A_BCRABL_T315I_CELL_1AIRE_BAF3,
    A_BCRABL_T315I_CELL_2AIRE_BAF3,
    A_BLK_TEL_BLK_CELL_1AIRE_BAF3,
    A_BRAF_WT_CELL_2AIRE_MEL_WO
    )
    Select formatted_batch_id
    a_AKT_MYRAKT_CELL_1AIRE_BAF3, a_ALK_NPM_ALK_CELL_1AIRE_BAF3, a_ALK_NPM_ALK_CELL_2AIRE_BAF3
    a_BCRABL_CELL_1AIRE_BAF3, a_BCRABL_CELL_2AIRE_BAF3, a_BCRABL_CELL_2AIRE_KU_812
    a_BCRABL_T315I_CELL_1AIRE_BAF3, a_BCRABL_T315I_CELL_2AIRE_BAF3, a_BLK_TEL_BLK_CELL_1AIRE_BAF3
    a_BRAF_WT_CELL_2AIRE_MEL_WO
    of cell_assays_union_all_piv_vw
    ;
    END TEST2_RUN;
    -----------------------

    I know I need to add permissions to use the 'truncate' function in a procedure, but I can't make it work adding 'WITH EXECUTE AS SELF"
    CREATE OR REPLACE PROCEDURE TEST2_RUN
    WITH EXECUTE AS SELF
    AS
    BEGIN
    ...

    I get the error "PLS-00103: encountered the symbol EXECUTE when expecting one of the following values: interface.

    Could someone help me please?
    I thank very you much in advance!

    Miriam

    DDL statements are to be executed using execute immediate PL/SQL code, for example

    ..
    ..
    EXECUTE IMMEDIATE 'TRUNCATE TABLE fred';
    ..
    ..
    

    Only SQL (DML statements) can be incorporated directly into the PL/SQL code.

  • truncate table another user via trigger?

    Oracle 10.2.0.4

    A user USER1 should be able to truncate a table of another user, user 2.

    I will not give drop any table, there are a lot of patterns in this PB. It must be transparent, because it happens from an application, so I can't substitute a procedure:

    exec ('table_name') drop_user2_table;

    but USER1 executes: truncate table table_name;


    Is there an any place of relaxation for this command?.

    You thought you found the solution. If so, please indicate the post as answer and correct.

  • Truncate table use in the procedure...

    Dear,

    I created the test table.

    Now, I have written a procedure like this.

    create or replace procedure trunc_test
    (ov_v_output OUT VARCHAR2) IS
    Start
    truncate table stable.
    end;

    I got error message like

    PLS-00103: encountered the symbol "TABLE" when the expected in the following way:

    := . ( @ % ;

    Someone help with this...

    Thank you and best regards,
    Raja.

    TRUNCATE is a DDL statement, so you cannot use it directly in PL/SQL. You must run dynimically using EXECUTE IMMEDIATE.

    So, your code should be

    create or replace procedure trunc_test (ov_v_output OUT VARCHAR2)
    is
    begin
     execute immediate 'truncate table testing';
     ov_v_output := 'Success';
    end;
    

Maybe you are looking for

  • 1000 errors and -54: itunes can not convert wma aac

    I installed itunes on my Windows 7 laptop that I wanted to use some of my vast library (currently in Media Player wma format) on my iphone. Whenever I try to add a file (or folder) to the library, I get a message saying that itunes will convert to AA

  • Is it still possible to put the URL bar on the front?

    Before the most recent change on my windows machines, I have had the firefox toolbar url and tabs button all on a single bar inside the "aero" windows style window decoration. Is it still possible to do? For the moment, I can't move the toolbar URL o

  • Release of subsidy, without the use of another carrier's Sim Card. ?

    I thought that I ask or ask this question, coming from Blackberry in general what you were doing was passing by AT & T, they unlock you in contact with the Dept, they you some inputs enter keys and you got the unlock screen, enter the Code and its be

  • Display Port-&gt; HDMI - no sound

    I connected my t410 to my HDTV using a DP-> HDMI adapter but no sound from the TV. don't you think it's a problem with my computer, which once connected claims that HDMI sound is on and all the way up, my DP connection, the adapter I use or my TV?

  • Disable keyboard shortcuts?

    Hi, I just bought a new laptop from Dell with Vista and I am very bored of all the keyboard shortcuts that appear constantly as I type... even if I do not seem to be hitting the shortcut keys.  I know it is a new keyboard that I need to get used to,