Truncate the table

When you run a stored procedure which loads a table,will it automatically truncate the data in the table before doing a load or the DBA has to truncate the data.

Hi,
SQL> CREATE TABLE test2222 (testcol VARCHAR2(20));
Table created.
SQL>
SQL> desc test
Name                                      Null?    Type
A                                                  NUMBER(19)
B                                         NOT NULL NUMBER
SQL>
SQL> INSERT INTO test2222 VALUES ('ABC');
1 row created.
SQL> INSERT INTO test2222 VALUES ('DEF');
1 row created.
SQL> INSERT INTO test2222 VALUES ('xyz');
1 row created.
SQL> COMMIT;
Commit complete.
SQL>
SQL> SELECT * FROM test;
no rows selected
SQL>
SQL> BEGIN
  2    EXECUTE IMMEDIATE 'TRUNCATE TABLE test2222';
  3  END;
  4  /
PL/SQL procedure successfully completed.
SQL>test is existing in DB....you can test with test2222;
- Pavan Kumar N
Edited by: Pavan Kumar on Oct 1, 2008 1:55 AM

Similar Messages

  • Space is not released after truncating the table

    Team,
    We have a table of size 550gigs in size and we truncated the table , truncated sucessfully but space is not released in os level, what action we can take to release the space and this table has only one row and contains the binary data.
    Thanks
    PGR

    Team,
    We have a table of size 550gigs in size and we truncated the table , truncated sucessfully but space is not released in os level, what action we can take to release the space and this table has only one row and contains the binary data.
    Thanks
    PGR
    Hello,
    Yes space wont be released immediately .If large extents are in picture which I assume is your case it goes into deferred drop a background process which will execute after some time( time may vary).See below link for details.
    As per BOL if extents are more than 128 it goes in deferred drop.
    http://msdn.microsoft.com/en-us/library/ms177495.aspx
    You should wait for some time .keep checking the free space
    Below discussion will surely help you in understanding.See Jonathan's reply
    http://social.msdn.microsoft.com/Forums/en-US/4aa2537e-246b-4bfe-818d-3482531d9149/sql-server-2005-massive-400gb-table-dropped-space-not-released
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • How to truncate the Table Subpartition ??

    Hi,
    I have 3 tables on my Oracle 10g database. They are interrelated as 1 --> 2 ---> 3,
    Table 1 & 2 are composite partiitoned with Partition By Rage and Sub Pratition by list. Now i have to truncate few listed subpartitions i.e
    Say If Subpartition ( 200501, 200601, 200701) , In this subpartition , I want to truncate only the values of say 200501 & 200601 ,
    How can i do that ?? I have gone throgh the documentation, i have'nt fot any solution for this.
    Chowdary K

    Let me more clear about the problem .,
    There are 3 table each one with interrelated as 1 --> 2 --> 3 , Now i have to truncate the old partitons. I can easly truncate the partitons of table 3 as it does'nt have any child tables and it's straight partitoned table. The problem is , 1 & 2 tables are composite partitioned with Partition By Range & subpartitioned by list., Now i have to truncate the few elements of subpartition of 1 & 2 tables.,
    Ex.,
    CREATE TABLE CUST_INVC
    MRKT_ID NUMBER NOT NULL,
    CUST_INVC_ID NUMBER NOT NULL,
    INVC_CMPGN_NR NUMBER(6) NOT NULL,
    CREAT_USER_ID VARCHAR2(100 BYTE) NOT NULL,
    CREAT_TS DATE NOT NULL,
    LAST_UPDT_USER_ID VARCHAR2(100 BYTE) NOT NULL,
    LAST_UPDT_TS DATE NOT NULL,
    ACCT_NR NUMBER(15) NOT NULL,
    CUST_ID NUMBER(15),
    ORD_CREATR_CD VARCHAR2(15 BYTE),
    CMPGN_YR_NR NUMBER(4),
    CMPGN_NR NUMBER(2),
    INVC_DT DATE,
    ORD_SBMSN_DT DATE,
    AVON_ORD_ID NUMBER,
    AVON_STOR_CNFRMTN_NR VARCHAR2(100 BYTE),
    MRGD_INVC_ID NUMBER,
    INVC_TYP VARCHAR2(15 BYTE),
    CUST_SERVC_CHRG_AMT NUMBER(15,2),
    TOT_INVC_AMT NUMBER(15,2),
    TOT_ITEM_CNT NUMBER(8),
    CUST_INVC_TAX_PCT NUMBER(8,3),
    CUST_INVC_TAX_AMT NUMBER(15,2),
    INVC_ADJSTMT_PCT NUMBER(8,3),
    EMAIL_ADDR_TXT VARCHAR2(100 BYTE),
    BILNG_ADDR_CARE_OF_NM VARCHAR2(100 BYTE),
    BILNG_STR_ADDR_TXT VARCHAR2(100 BYTE),
    BILNG_CITY_NM VARCHAR2(100 BYTE),
    BILNG_PRVNC_NM VARCHAR2(100 BYTE),
    BILNG_ST_CD VARCHAR2(5 BYTE),
    BILNG_PSTL_CD VARCHAR2(15 BYTE),
    BILNG_CNTRY_CD VARCHAR2(5 BYTE),
    SHPNG_STR_ADDR_TXT VARCHAR2(100 BYTE),
    SHPNG_CITY_NM VARCHAR2(100 BYTE),
    SHPNG_PRVNC_NM VARCHAR2(100 BYTE),
    SHPNG_ST_CD VARCHAR2(5 BYTE),
    SHPNG_PSTL_CD VARCHAR2(15 BYTE),
    SHPNG_CNTRY_CD VARCHAR2(5 BYTE),
    CUST_PRMRY_PHON_NR VARCHAR2(20 BYTE),
    SHPNG_FEE_AMT NUMBER(15,2),
    REFRG_REP_PHON_NR VARCHAR2(20 BYTE),
    PROMTNL_CPN_CD VARCHAR2(50 BYTE),
    APLCTN_SRCE_CD VARCHAR2(15 BYTE),
    INVC_PRSNL_CMNT_TXT VARCHAR2(500 BYTE),
    INVC_MRKTG_CMNT_TXT VARCHAR2(500 BYTE),
    READY_TO_PRNT_CD VARCHAR2(5 BYTE) DEFAULT 'N',
    ORD_CREATN_DT DATE,
    INVC_VWD_IND VARCHAR2(1 BYTE) DEFAULT 'N',
    INVC_PRCS_ID VARCHAR2(15 BYTE)
    TABLESPACE ECOM_ODS
    PCTUSED 0
    PCTFREE 10
    INITRANS 5
    MAXTRANS 255
    LOGGING
    PARTITION BY RANGE (MRKT_ID)
    SUBPARTITION BY LIST (INVC_CMPGN_NR)
    PARTITION CUST_INVC_US VALUES LESS THAN (76)
    NOLOGGING
    NOCOMPRESS
    TABLESPACE ECOM_ODS
    PCTFREE 10
    INITRANS 5
    MAXTRANS 255
    STORAGE (
    INITIAL 20M
    BUFFER_POOL DEFAULT
    ( SUBPARTITION CUST_INVC_US_SP01 VALUES (200501, 200604, 200707) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP02 VALUES (200502, 200605, 200708) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP03 VALUES (200503, 200606, 200709) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP04 VALUES (200504, 200607, 200710) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP05 VALUES (200505, 200608, 200711) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP06 VALUES (200506, 200609, 200712) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP07 VALUES (200507, 200610, 200713) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP08 VALUES (200508, 200611, 200714) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP09 VALUES (200509, 200612, 200715) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP10 VALUES (200510, 200613, 200716) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP11 VALUES (200511, 200614, 200717) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP12 VALUES (200512, 200615, 200718) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP13 VALUES (200513, 200616, 200719) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP14 VALUES (200514, 200617, 200720) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP15 VALUES (200515, 200618, 200721) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP16 VALUES (200516, 200619, 200722) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP17 VALUES (200517, 200620, 200723) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP18 VALUES (200518, 200621, 200724) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP19 VALUES (200519, 200622, 200725) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP20 VALUES (200520, 200623, 200726) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP21 VALUES (200521, 200624, 200727) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP22 VALUES (200522, 200625, 200801) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP23 VALUES (200523, 200626, 200802) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP24 VALUES (200524, 200627, 200803) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP25 VALUES (200525, 200701, 200804) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP26 VALUES (200526, 200702, 200805) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP27 VALUES (200527, 200703, 200806) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP28 VALUES (200601, 200704, 200807) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP29 VALUES (200602, 200705, 200808) TABLESPACE ECOM_ODS,
    SUBPARTITION CUST_INVC_US_SP30 VALUES (200603, 200706, 200809) TABLESPACE ECOM_ODS )
    NOCOMPRESS
    NOCACHE
    NOPARALLEL
    MONITORING
    ENABLE ROW MOVEMENT;
    Say I want to truncate the Subpartiton CUST_INVC_US_SP30 Values 200603 & 200706.
    Can anyone tell me syntax , how can i do that.,
    Chowdary K

  • Adaddnode.pl is failing after truncating the tables

    we are having db and apps on node A, and we have cloned(only apps) on new node B using adcfgclone.pl(without any errors).
    we are using adaddnode.pl to add this new node B to A. its failed with ORA-01403: no data found... then i run adsnapshot on node B.
    again we ran adaddnode.pl, its failed with ORA-00001: unique constraint (APPLSYS.AD_APPL_TOPS_U2) violated. then we took the backup and truncated ad_appl_tops and ad_timestamps.
    again we ran adaddnode.pl its failed with ORA-01403: no data found.
    we reinserted tables with old data and deleted only new node information, then its failed with APPLSYS.AD_APPL_TOPS_U2) violated.
    kindly let me know how to fix issue. its kind of urgent.i followed all the metalinks and forums. but no use.

    Were the following docs reviewed?
    Adaddnode.Pl Fails With Ora-00001: Unique Constraint (Applsys.Ad_appl_tops_u2) Violated (Doc ID 1435834.1)
    ORA-00001: unique constraint (APPLSYS.AD_TIMESTAMPS_U1) violated (Doc ID 727990.1)
    Thanks,
    Hussein

  • Audit : to trace who did truncate of the table  possible ?

    Hi,
    Yesterday some one has truncated the table data, any idea we can find out who did it? please see the configurations of my database.
    BANNER
    Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
    PL/SQL Release 8.1.7.4.0 - Production
    CORE 8.1.7.0.0 Production
    TNS for HPUX: Version 8.1.7.4.0 - Production
    NLSRTL Version 3.4.1.0.0 - Production
    SQL> !uname -a
    HP-UX db05 B.11.11 U 9000/800 1440856852 unlimited-user license
    SQL> show parameter audit;
    NAME TYPE VALUE
    audit_file_dest string ?/rdbms/audit
    audit_trail string NONE
    transaction_auditing boolean TRUE
    SQL>
    -rw-r----- 1 oracle dba 2547 Aug 4 11:30 ora_26430.aud
    -rw-r----- 1 oracle dba 4777 Aug 4 11:40 ora_1097.aud
    -rw-r----- 1 oracle dba 3410 Aug 4 11:50 ora_8746.aud
    -rw-r----- 1 oracle dba 2746 Aug 4 12:01 ora_14307.aud
    -rw-r----- 1 oracle dba 2062 Aug 4 12:01 ora_14435.aud
    -rw-r----- 1 oracle dba 4105 Aug 4 12:10 ora_18744.aud
    -rw-r----- 1 oracle dba 2052 Aug 4 12:20 ora_23523.aud
    -rw-r----- 1 oracle dba 4119 Aug 4 12:30 ora_28396.aud
    -rw-r----- 1 oracle dba 3411 Aug 4 12:40 ora_3120.aud
    -rw-r----- 1 oracle dba 3412 Aug 4 12:50 ora_9679.aud
    -rw-r----- 1 oracle dba 2737 Aug 4 13:10 ora_22368.aud
    -rw-r----- 1 oracle dba 1368 Aug 4 13:20 ora_28745.aud
    -rw-r----- 1 oracle dba 4094 Aug 4 13:30 ora_3831.aud
    -rw-r----- 1 oracle dba 4103 Aug 4 13:34 ora_6515.aud

    No, at this point because you did not have auditing turned on you cannot get the information desired. In my opinion you should configure all production databases to audit all DDL operations since you should create only once and reuse many times so auditing DDL should not generate much data.
    The TRUNCATE command is a general exception to the above since for work/reporting tables I would espect that the table would be cleared out every time it is used but I would also expect the clearing user to be an application user which executes a stored procedure to perform the truncate and these are easy to filter out of any reports you run and to report on the use of the truncate procedure by any user other than the expected username.
    If you set up auditing be sure to set up a purge at the same time.
    IMHO -- Mark D Powell --

  • Truncating a table from inside an application

    Hi all,
    Got a new problem to tackle. I am creating an application to calculate a very complex production bonus based on alot of different variables...
    I am working through retrieving all the data and created an apex temp table called site_bonus. I dump all the retireved values I get from Oracle for attendance, SIT data on discipline etc into the temp table as a count of number of occureneces to start the calculation of the bonus factors - here's the gotcha.....
    Prior to dumping the new run data into the temp table I want to truncate the table to remove anyprevious run data so that I dont get duplicate records cuased by a previous run. I created an on demand application process that basically does the following:
    truncate table "SITE_BONUS" /
    ( I basically copied it right from SQL workshop inside apex,by retrieving the SQL fromthe table truncate process where it works....
    When I run it anywhere inside my page as an on demand process It fails with the following error:
    ORA-06550: line 1, column 16: PLS-00103: Encountered the symbol "TABLE" when expecting one of the following: := . ( @ % ; The symbol ":= was inserted before "TABLE" to continue.
    Error
    OK
    I have tried it as a plsql process, an on demand process....and I get teh same error from any page inside my app and I cant figure out why I can do this from SQL worksop but cant call it from a page within my app.....
    Any ideas?
    Edited by: DSULLIVAN on Oct 28, 2009 3:13 PM - I corrected the typo

    You are trying : trucate
    trucate table "SITE_BONUS" /It should be : tuncate
    truncate table SITE_BONUSHope this helps,
    Sam
    +Please reward good answers by marking them correct or helpful!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Help with truncating a table using plsql procedure in different schema

    I have a plsql procedure in schema A that truncates a table that is given in as parameter.
    create or replace procedure truncate_table(schema, table_name)
    EXECUTE IMMEDIATE 'TRUNCATE TABLE '||schema||'.'||table_name;
    end;
    The above procedure has public execute grant.
    I need to truncate a table in schema B. I have a plsql procedure in schema B that calls the truncate_table procedure and passes in the schema B table name.
    Since the table is in schema B, should the delete grant on the table be given to user A or user B to truncate the table in schema B?
    Thanks in advance.

    Procedure created in schema A
    create or replace
    procedure truncate_table(l_schema varchar2, table_name varchar2) authid current_user
    as
    begin
    EXECUTE IMMEDIATE 'TRUNCATE TABLE '||l_schema||'.'||table_name;
    end;from schema B
    grant delete on table1 to Schema_A
    from schema A
    exec truncate_table('Schema_B','Table1');
    Hope this helps.
    Alvinder

  • Problem in enabling constraint - after disabling and truncation of table .

    Hello Friends,
    I have a table called DRR_TABLES that has list of table names . The requirement is to truncate the tables present in DRR_TABLES except KEY_IDS table and table_name like '%TYPE%' table.
    written a procedure . successfullly truncating the tables from DRR_TABLES but while enabling constraints after truncation , I am getting problem in enabling constraints .
    ERROR at line 1:
    ORA-02270: no matching unique or primary key for this column-list
    ORA-06512: at "schema123.TRUNCATE_DRR_TABLES ", line 49
    ORA-06512: at line 1
    Heres is the code .
    PROCEDURE TRUNCATE_DRR_TABLES is
    x varchar2(200);
    v_tablecount number := 0;
    cursor c is select TABLE_NAME from DRR_TABLES where population_source='PUBLISHING' and TABLE_NAME != 'KEY_IDS' and TABLE_NAME NOT LIKE '%TYPE%';
    BEGIN
    DBMS_OUTPUT.PUT_LINE (' TRUNCATING DRR TABLES ...........');
    OPEN c ;
    LOOP
    FETCH c INTO x ;
    EXIT WHEN c%NOTFOUND;
    for c1 in (select table_name, constraint_name from user_constraints where TABLE_NAME = x and status ='ENABLED' ORDER BY CONSTRAINT_TYPE DESC )
    loop
    begin
    execute immediate ('alter table '||c1.table_name||' disable constraint '||c1.constraint_name|| ' cascade');
    NULL;
    end;
    end loop;
    EXECUTE IMMEDIATE 'TRUNCATE TABLE ' || x ;
    v_tablecount := v_tablecount + 1 ;
    DBMS_OUTPUT.PUT_LINE('TABLE TRUNCATED :'|| x );
    END LOOP ;
    DBMS_OUTPUT.PUT_LINE (' TOTAL TABLES TRUNCATED ' || v_tablecount );
    CLOSE c;
    OPEN c ;
    LOOP
    FETCH c INTO x ;
    EXIT WHEN c%NOTFOUND;
    for c2 in (select table_name, constraint_name from user_constraints where TABLE_NAME = x and status = 'DISABLED' ORDER BY CONSTRAINT_TYPE)
    loop
    begin
    execute immediate ('alter table '||c2.table_name||' enable constraint '||c2.constraint_name);
    NULL;
    end;
    end loop;
    END LOOP ;
    CLOSE c ;
    END TRUNCATE_DRR_TABLES ;
    LINE 49 is the line corresponding to enable constraint statement.
    Edited by: kumar73 on 3 Sep, 2012 11:44 PM

    It is such a pity that a user having 321 posts till date is unaware of basics of Posting a Question.
    1. You need to provide us with your Oracle version
    select * from v$version;2. You need to understand and get accustomed to using tags before and after Code or SQL's for better readability.
    3. You need to provide us with the Table Structure and the Constraints Definition.
    There are many things that looks like Bad Coding practices:
    <font face="Times New Roman" size=2>
    1. Avoid RBAR (Loops).
    2. Implement Bulk Collect.
    3. Why do you need to disable the constraints before truncating? Are you kind of handling the Referential Integrity Constraints?
    4. Duplicate checking of Disabled Constraints.
    5. When the procedure is being executed at Production Environment, are you going to Monitor the DBMS_OUTPUT? Why not Log the Statements into a LOG Table?
    6. Why use a TableCount variable? Would the TableCount Variable be not equal to the Number of Records returned by Cursor C?
    7. What is the need to use a NULL statement after every Execute Immediate?
    8. What is the Need to surround each execute Immediate with Begin .. End block?
    9. Where is your Exception handling Block? Forgot to write?
    </font>
    What has been your effort in finding which Constraint/Table is causing you the trouble?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Replace the data in the table from other table

    Iam creating a backup of table Order by this query:
    create table orderbckup as select * from order; - this works
    For the first time i have to create a orderbckup table but every month i have to replace the data in orderbckup from order table. Is there any way where i can copy the data from order and repalce the data in orderbckp - I cannot use insert as it adds the rows. Or do i need to delete the old table and create it again or can i use update. If so can anyone plz let me know

    882431 wrote:
    Iam creating a backup of table Order by this query:
    create table orderbckup as select * from order; - this works
    For the first time i have to create a orderbckup table but every month i have to replace the data in orderbckup from order table. Is there any way where i can copy the data from order and repalce the data in orderbckp - I cannot use insert as it adds the rows. Isn't that exactly what you want to do - add rows?
    If I understand you, the problem isn't with adding new rows; the problem is how to remove the old rows.
    Or do i need to delete the old table and create it again or can i use update. If so can anyone plz let me knowInstead of dropping the table and re-creating it, you can TRUNCATE the table and then use INSERT:
    TRUNCATE TABLE orderbackup;
    -- At this point, orderbackup has 0 rows
    INSERT INTO  orderbackup
    SELECT  *
    FROM    orders       -- ORDER is a reserved word in Oracle, so it's not a good table name
    ;TRUNCATE TABLE is faster than DELETing all the rows, because it doesn't save redo information. (That means you can't ROLLBACK a TRUNCATE statement, but you can rollback a DROP TABLE statement, either.)

  • TRUNCATE multaple Tables???

    Hi,
    Is there any way to truncate multiple tables at the same time.
    i.e. i need to truncate the tables which names begin with 'AS'...
    Thanks...

    Hi,
    It is not possible with SQL.
    But you can do it from PL/SQL.
    BEGIN
      FOR TBL_LIST IN ( SELECT table_name FROM USER_TABLES WHERE table_name LIKE 'AS%')
    LOOP
    EXECUTE IMMEDIATE 'DROP TABLE '||tbl_list.table_name;
    END LOOP;
    END;** NOT TESTED **
    Regards,

  • How to truncate the values from the table

    Hi All,
    I am working on an issue..where we are first deleting all the records from the table and then based on few conditions we are putting the records back in that table...when we tried to run this program along with few others those who are doing almost the same stuff we are having issues...we tried to schedule few jobs related to these programs only...but after a ceratin amount of time couple of jobs got canceled...I was talking to my basis guy and he said the problem is ratehr then truncating the records from the table we are deleting the records and it's taking lots and lots of space to execute...so we need to truncate the records from the table insted of deleting it...we are using the following the statement right now:
        DELETE FROM ZTUS_PG.
        COMMIT WORK.
    So can you please tell me how can we truncate the values from this table instead of just deleting them and what would be effect of this.
    Thanks,
    Rajeev Gupta

    I don't think basis is saying you should delete all the records from the table. They are saying remove the table and it's contents (a much faster thing to do). I'm not sure this the right thing to do, but you can have a look at:
    http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.apdv.sample.doc/doc/admin_scripts/s-truncate-db2.htm
    Something like:
    EXEC SQL.
      TRUNCATE TABLE ZTUS_PG REUSE STORAGE
    ENDEXEC.
    COMMIT WORK.                      "Empty table is committed here
    Rob
    Edited by: Rob Burbank on Dec 1, 2008 4:06 PM

  • Test inside  the table is truncated when integrating Adobe forms with WD4A

    Hi All,
    I am facing issue in table when integrating adobe forms with web dynpro for ABAP.
    Whenever the pagination happens the text in the table row cells is truncated and it starts from next row in next page. Is there any properrty of table in Form builder which I can use to allow the test to go to the next page?
    Best Regards,
    Arti.

    Hi. You should place your question in "SAP Interactive Forms by Adobe" forum. You will get advice quicker there.

  • How to truncate all the tables of my database

    hi guys
    I am using SQL Server 2012 , i need to delete all  the data present in my database .I mean i want to truncate all the tables in my database , so please suggest me the easiest way .

    If the tables are referenced by FK it will be failed.... 
    Basically you can use the below statetemnt
    DECLARE @TruncateStatement nvarchar(4000)
    DECLARE TruncateStatements CURSOR LOCAL FAST_FORWARD
    FOR
    SELECT
        N'TRUNCATE TABLE ' +
        QUOTENAME(TABLE_SCHEMA) +
        N'.' +
        QUOTENAME(TABLE_NAME)
    FROM
        INFORMATION_SCHEMA.TABLES
    WHERE
        TABLE_TYPE = 'BASE TABLE' AND
        OBJECTPROPERTY(OBJECT_ID(QUOTENAME(TABLE_SCHEMA) +
            N'.' +
            QUOTENAME(TABLE_NAME)), 'IsMSShipped') = 0
    OPEN TruncateStatements
    WHILE 1 = 1
    BEGIN
        FETCH NEXT FROM TruncateStatements INTO @TruncateStatement
        IF @@FETCH_STATUS <> 0 BREAK
        RAISERROR (@TruncateStatement, 0, 1) WITH NOWAIT
        EXEC(@TruncateStatement)
    END
    CLOSE TruncateStatements
    DEALLOCATE TruncateStatements
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Truncating old partitions in the table.

    Hi,
    Can you pls helpme out in writing a job/script(procedure) to truncate 6 older partitons with date range partition 'YYYY-MM' in the table!!!
    Thanks,

    I have a 20 partitioned tables with more than year old data with range partitioning.
    I am trying to develop a package/job either to drop or truncate 6 months older partitions.
    I will truncate partitions periodically on each schema - not all at once.
    if you someone can send me the scripts/procudure - that really helps my task.
    Thanks,

  • Truncate all the tables

    How can I write a script which will truncate me all the tables defined by a query similar to this: select table_name where tablespace_name != 'SYSTEM' ?

    Look into dba_tables and spool a script/file that you can later run from SQLPlus:
    select 'truncate table ' || owner || '.' || table_name || ';'
    from dba_tables
    where owner <> 'SYSTEM'
    -Chuck

Maybe you are looking for

  • I am having trouble updating Photoshop Elements 12 to 12.1.

    Adobe Updater notified me of updates for both my Premier Elements and Photoshop Elements. The Premier updated okay, but Photoshop Elements keeps giving me this error message: "Adobe Photoshop Elements 12.1 update There was an error installing this up

  • Java.math package does not exist!!!

    hi java experts, i really desperately need some help. ihave been trying to compile a java program i have written that imports the java.math package as i am using the BigInteger class. I am using SUN ONE STUDIO ME 4 and have j2se SDk installed. when i

  • Data for weekedays only

    Dear All, I have Production environment I want to write a SQL query which should only return rows in database for weekdays only. There is one column in the table which contains transaction date. Is it possible if we skip weekend transaction for examp

  • Cant download lightroom 5..ERROR: Third party payload installer Adobe_Lightroom.msi failed with exit code: 1603

    every time i download lightroom 5 it fail and says the cause is this (errror: third party payload installer Adobe_Lightroom.msi failed with exit code: 1603..

  • Getting Logic Express 7.2 to read AU Plug-ins

    Hi all, I'm running Logic Express 7.2 on a Macbook Pro. I haven't had any problems so far, but recently a friend bought me Amplitube for my birthday and I can't get Logic to acknowledge its presence. I installed the AU file, which is sitting in the l