Problem on DELETE CASCADE

my following tables not allow me to delete the parent table student and the corperate recode in child table also get delete , why
create table Student(       student_id  int(10) not null  ,       sure_name VARCHAR(25)  not null,       english_name Varchar(25) default null,       chinese_name varchar(35) CHARACTER SET utf8 COLLATE utf8_general_ci not NULL,       student_hkid  varchar(12) not null,       address varchar(100) default null,       mobile_No  varchar(15) default null,       home_Telephone  varchar(15) default null,       email    varchar(20) not null,       faculty  varchar(70) default null,       department varchar(100) default null,       local_student varchar(3) default 'No',       fresh_student varchar(3) default 'No',       fulltime_student varchar(3) default 'No',       first_Ustudent varchar(3) default 'No',        userIp  VARCHAR(45)  not NULL,       accessTime  VARCHAR(45)  not NULL,       primary key(student_id))TYPE=MyISAM CHARACTER set utf8; create table Student_financial_info(   student_id  int(10) not null,   grant_loan varchar(3) default 'No',   uploadfile  text default null,   notification_time varchar(10) default null,   father_name  varchar(25) default null,   father_HKID  varchar(12) default null,   father_Salary decimal(6,2) ,   father_live_together varchar(3),   mother_name  varchar(25) default null,   mother_HKID  varchar(12) default null,   mother_Salary decimal(6,2) ,   mother_live_together varchar(3),   1th_sibling_name  varchar(25) default null,   1th_sibling_HKID  varchar(12) default null,   1th_sibling_Salary decimal(6,2) ,   1th_sibling_together varchar(3),   2th_sibling_name  varchar(25) default null,   2th_sibling_HKID  varchar(12) default null,   2th_sibling_Salary decimal(6,2) ,   2th_sibling_together varchar(3),   3th_sibling_name  varchar(25) default null,   3th_sibling_HKID  varchar(12) default null,   3th_sibling_Salary decimal(6,2) ,   3th_sibling_together varchar(3),   4th_sibling_name  varchar(25) default null,   4th_sibling_HKID  varchar(12) default null,   4th_sibling_Salary decimal(6,2) ,   4th_sibling_together varchar(3),   addition_income Varchar(200) default null,   primary key(student_id ),   FOREIGN KEY(student_id) REFERENCES student(student_id) ON DELETE CASCADE ON UPDATE CASCADE)TYPE=MyISAM CHARACTER set utf8;

HJava wrote:
hi thank you!
I change my table Engine under Mysql Query Browser, but Foreign Key settinis not action at all ( thank you you mention the foreign key is ignore), quite stronge for me, I have to drop the table and change the table engine to InnoDB in my create table code and run it under command line client,
now, It work.
are there any different to  use command line Client and Mysql Query Brower?
thank you!Not really, other than appearance. But, the "GUI" might let you simply change the type of table on an already created database (I don't know, haven't tried it), unfortunately, that won't activate any foreign keys when changing a MyISAM to InnoDB (although it will destroy keys on an InnoDB when changing to MyISAM), as, like the above quote says, the keys are not only not used, they are not even stored. I.E. MySQL no longer even knows, nor cares, that you even attempted to create a foreign key for that table. So, you must drop and recreate the table, you can't simply "change" it. Although you could change it (if the GUI even does this) and then add the foreign key constraints.

Similar Messages

  • Delete Cascade and Composition problem.

    As it's well known into a DB You can have more than one Fk and more than one FK could have Delete cascade set.
    A typical situation is an intersection table between 2 tables wich solves a N to M relationship.
    In BC4J is impossible to manage that situation because Delete Cascate is related to composition and composition tries to lock the owning entity (JBO-25030) however if we try to get the detail row from a ViewLink the other one is invalid and viceversa.
    How can I solve that issue ?
    I read the Steve's http://radio.weblogs.com/0118231/stories/2003/01/17/whyDoIGetTheInvalidownerexception but we normaly don't know, at the create monent all values (the user should select them) and then the createAndInitRow is not a good solution.
    Could someone help.
    TIA
    Tullio

    I've the same Problem and solved it the following way:
    Assuming you have the following VOs:
    MasterView1
    MasterView2
    IntersectionView
    and two Associations of the composition type (each with the Cascading Delete Option between them):
    Ma1InterAssoc
    Ma2InterAssoc
    If you first select a row in MasterView1 and in MasterView2 you can create a new Row in IntersectionView as both "owning Entities" now have a valid current row. BC4J automatically creates the keys to the two Master Entities for you in the Intersection Entity.
    MasterView1Impl vo1 = getMasterView1();
    vo1.selectMyRow(...);
    vo1.executeQuery();
    vo1.next();
    MasterView2Impl vo2 = getMasterView2();
    vo2.selectMyRow(...);
    vo2.executeQuery();
    vo2.next();
    IntersectionView detVo = getIntersectionView);
    Row detRow = detVo.createRow()
    detRow.setValueX(...); // it is important to set at least one value!!
    detVo.insertRow(detRow);
    This method works well since JDeveloper 9.0.3, but unfortunately it is not officially supported by Oracle, so you do it on your own risk :(
    Hope it helps
    Frank

  • Migration: sqlserver 2000 to oracle - delete cascade [resolved - tank you]

    hi
    no problems on migration... but...
    in the new oracle database, all foreign keys have the "cascade delete" as default...
    but i don't want this default (a stupid human error may be ruinous...)
    can somebody explain me how change this default in a "exception thrown"?
    maybe with an authomatic sql order????
    tank you a lot...
    Giovanni D.
    Message was edited by:
    user535473

    Hi Giovanni,
    Tools> Options> General
    Create Foreign Keys with "ON DELETE CASCADE" option
    Just untick the box and remap from the source to the oracle model.
    Hope this helps
    Dermot.

  • How do I delete cascade with a PL/SQL procedure?

    This script will create a PL/SQL procedure that deletes cascade. This is a post to contribute to the Oracle community. Take the code as is and test it before you use it in production. Make sure this is what you want.
    Procedure Delete Cascade (prc_delete_cascade)
    Description
    =============
    The principle is very simple. The procedure uses a table called TO_BE_DELETED to keep a list of records to be deleted. This
    table keeps the table name and the rowid of those records that need to be deleted. The procedure also uses a function called
    DELETE_BOTT_ROW which takes one record of the table and tries to delete it. If the deletion fails with a foreign key constraint
    violation, the function parses the SQL error message (SQLERRM) to get the name of the constraint. With the name of the constraint,
    the function finds the name of the child table, all the child records that have references to the parent table primary or unique key,
    and the parent key primary or unique key column name. Once the child records of the failed delete are identified, the function takes their table name and rowids
    and records them into the TO_BE_DELETED table by inserting records of their table name and their rowids. Al the records inserted also contain the level (which
    is 1 for the original records, 2 for child records, 3 for granchild records, etc.) and the sequence number of the order in wich they
    are recorded. This way, when the function picks up a record to be deleted, it takes the one with the highest level and the highest
    inserted sequence, or the "bottom" record. Once all the child records of the failed delete are appended to the TO_BE_DELETED table, it calls itself
    recursevely, and the function takes the record at the "bottom" of the table and tries to delete it. If it succeeds, it calls
    itself recursevely to delete the next record. If it fails, it goes and finds the child records as described before and once they are
    inserted into the TO_BE_DELETED table, it calls itself again recursevely to try to delete again the "bottom" record. All records
    that are successfully deleted are flagged as deleted usig the flag_del column so they are not pickt up again. Once all the (parent,
    child, grandchild, etc.) records are deleted, the procedure ends without commiting, giving the option to the user to commit or
    rollback deletions. The table TO_BE_DELETED is, at the end of the procedure, a list of all the records that were deleted, including their table names
    and the order in with they were deleted. The user then can review its content and decide to commit or rollback.
    Restrictions
    ============
    1. Single tables only. The procedure only takes one table name and a WHERE clause to identified the records to be deleted.
    2. Single columns only. Ther procedure only works with single-column primary, unique and foreign key constraints.
    3. Single schema only.
    4. Unpredictable results with circular references.
    drop table to_be_deleted purge;
    create table to_be_deleted
    (tname varchar2(30)       -- table name
    ,rid rowid                -- rowid
    ,lvl number               -- level: 1=parent, 2=child, 3=grandchild, etc.
    ,seq_ins number           -- sequence order of record inserted
    ,flg_del char             -- flag deleted: Y=record deleted
    ,seq_del number           -- global order of record deletion
    set serveroutput on size 1000000
    create or replace procedure prc_delete_cascade
    (p_tname varchar2  -- table name
    ,p_where varchar2  -- where clause identifying records to be cascade deleted
    is
      dummy         char;
      v_sqlcode     number;
      v_sqlerrm     varchar2(32767);
      v_param_val   integer := 0;
      v_sql         varchar2(4000);
      v_ret_cde     number;
      e_bad_params  exception;
      v_iter        number;
      v_plvl        number;
      v_seq_del     number;
      v_max_iter    number := 1000000000;
      function delete_bott_row
      return number
      is
        v_sql        varchar2(4000);
        v_ptname     varchar2(30);  -- parent table name
        v_ppkname    varchar2(30);  -- parent primary key constraint name
        v_ppkcname   varchar2(30);  -- parnet primary key column name
        v_prowid      rowid;
        v_crowid      rowid;
        v_ctname     varchar2(30);  -- child table name
        v_cfkname    varchar2(30);  -- child foreign key constraint name
        v_cfkcname   varchar2(30);  -- child foreign key column name
        v_ins        number;
        v_seq_ins    number;
        v_sqlerrm    varchar2(4000);
        v_sqlcode    number;
        e_const_viol exception;
        pragma exception_init(e_const_viol, -2292);
        e_max_iter_reached exception;
      begin
        v_iter := v_iter + 1;
        if v_iter >= v_max_iter then
          raise e_max_iter_reached;
        end if;
        dbms_output.put_line('- Iter '||to_char(v_iter));
        dbms_output.put_line('----------');
        dbms_output.put_line('- Starting function delete_bott_row');
        v_sql := 'select tname, rid, lvl, seq_ins from (select * from to_be_deleted where flg_del = ''N'' order by lvl desc, seq_ins desc) where rownum=1';
        --  dbms_output.put_line('- SQL: '||v_sql);
        execute immediate v_sql into v_ptname, v_prowid, v_plvl, v_seq_ins;
        dbms_output.put_line('- Selected row: table name: '||v_ptname||', level: '||v_plvl||', seq: '||v_seq_ins);
        v_sql := 'delete from '||v_ptname||' where rowid='''||v_prowid||'''';
        dbms_output.put_line('- SQL: '||v_sql);
        execute immediate v_sql;
        dbms_output.put_line('- Row deleted !!!');
        v_ret_cde := 1;
        v_seq_del := v_seq_del + 1;
        dbms_output.put_line('- Mark the row deleted');
        v_sql := 'update to_be_deleted set flg_del = ''Y'', seq_del = '||to_char(v_seq_del)||' where tname='''||v_ptname||''' and rid='''||v_prowid||'''';
        -- dbms_output.put_line('- SQL: '||v_sql);
        execute immediate v_sql;
        -- dbms_output.put_line('- Updated table to_be_deleted, row marked deleted');
        -- dbms_output.put_line('- End of iter '||to_char(v_iter));
        dbms_output.put_line('----------');
        -- call function delete_bott_row recursively
        v_ret_cde := delete_bott_row;
        return 0;
      exception
        when no_data_found then
          dbms_output.put_line('- Table to_be_deleted is empty, delete cascade has completed successfully.');
          v_ret_cde := 0;
          return 0;
        when e_const_viol then
          v_sqlcode := SQLCODE;
          v_sqlerrm := SQLERRM;
          v_ret_cde := v_sqlcode;
          dbms_output.put_line('>Constraint Violation. Record has children');
          -- dbms_output.put_line('Error code: '||to_char(v_sqlcode));
          v_cfkname := substr(v_sqlerrm,instr(v_sqlerrm,'.')+1,instr(v_sqlerrm,')') - instr(v_sqlerrm,'.')-1);
          dbms_output.put_line('>Child FK name: '||v_cfkname);
          select table_name, column_name
            into v_ctname, v_cfkcname
            from user_cons_columns
           where constraint_name=v_cfkname;
          dbms_output.put_line('>Child table name: '||v_ctname||'. FK column name: '|| v_cfkcname);
          select constraint_name, column_name
            into v_ppkname, v_ppkcname
            from user_cons_columns
           where constraint_name = (select r_constraint_name
                                      from user_constraints
                                      where constraint_name=v_cfkname);
          dbms_output.put_line('>Parent PK/UK name: '||v_ppkname||'. Parent PK/UK column: '||v_ppkcname);
          v_sql := 'insert into to_be_deleted(tname, rid, lvl, seq_ins, flg_del) '||
                   'select '''||v_ctname||''', rowid, '||to_char(v_plvl+1)||', rownum, ''N'' '||
                   'from '||v_ctname||' '||
                   'where '||v_cfkcname||' =any (select '||v_ppkcname||' from '||v_ptname||' where rowid =any (select rid from to_be_deleted where tname = '''||v_ptname||'''))';
          -- dbms_output.put_line('- SQL: '||v_sql);
          execute immediate v_sql;
          select count(*)
            into v_ins
            from to_be_deleted
           where lvl = v_plvl+1
             and tname = v_ctname
             and flg_del = 'N';
          dbms_output.put_line('>Found '||to_char(v_ins)||' child records which were added to table to_be_deleted');  
          v_ret_cde := delete_bott_row;
          return  v_ret_cde;
        when e_max_iter_reached then
          dbms_output.put_line('Maximum iterations reached.  Terminating procedure.');
          raise;
        when others then
          raise;
      end delete_bott_row;
    begin
      dbms_output.put_line('Beginning');
      dbms_output.put_line('================================');
      -- validate p_table
      begin
        select 'Y'
          into dummy
          from user_tables
         where table_name=upper(p_tname);
      exception
        when no_data_found then
        v_param_val := 1;
        dbms_output.put_line('Table '||p_tname||' does not exist.');
        raise e_bad_params;
      end;
      dbms_output.put_line('- Parameter p_tname validated');
      -- validate p_where
      begin
        execute immediate 'select ''Y'' from '||p_tname||' where '||p_where INTO dummy;
      exception
        when no_data_found then  -- where clause returns no records
          dbms_output.put_line('Record(s) not found.  Check your where clause parameter');
          v_param_val := 2;
          raise e_bad_params;
        when too_many_rows then  -- found multiple records means it is ok
          null; 
        when others then  --  any other records means where clause has something wrong.
          dbms_output.put_line('Where clause is malformed');     
          v_param_val := 2;
          raise e_bad_params;
      end;   
      dbms_output.put_line('- Parameter p_where validated');
      if v_param_val > 0 then raise e_bad_params; end if;
      v_iter := 0;
      v_plvl := 1;
      v_seq_del := 0;
      v_sql := 'insert into to_be_deleted(tname, rid, lvl, seq_ins, flg_del) select '''||upper(p_tname)||''', rowid, '||to_char(v_plvl)||', rownum, ''N'' from '||p_tname||' where '||p_where;
      dbms_output.put_line('- Inserting initial record');
      dbms_output.put_line('- SQL: '||v_sql);
      execute immediate v_sql;
      dbms_output.put_line('- Record(s) inserted');
      dbms_output.put_line('- Calling function delete_bott_row to delete last row of table to_be_deleted');              
      dbms_output.put_line('-----------------------------------');              
      v_ret_cde :=  delete_bott_row;
      -- dbms_output.put_line('- Back from function delete_bott_row');              
      -- dbms_output.put_line('Return code: '||to_char(v_ret_cde));              
      dbms_output.put_line('- End of procedure');              
    exception
      when e_bad_params then
        dbms_output.put_line('Bad parameters, exiting.');
    end;
    show errors
    spool prc_delete_cascade.log
    --  Call to the procedure
    exec prc_delete_cascade('xent','xent_id between 1669 and 1670')
    select tname "Table Name", count(*) "Rows deleted"
      from to_be_deleted
    group by tname;
    spool off
    set lines 120
    select *
      from to_be_deleted
    order by seq_del;
    prompt  Now commit or rollaback deletions.
    -- commit;
    -- rollback;Edited by: Rodolfo4 on Mar 23, 2011 10:45 AM

    Interesting.
    I see a few areas where this could be useful. Elimiating specific test records from a Test DB for example.
    Some comments:
    <li>Since this is a recursive logic you must add a stop criteria. In this case I would add a max iteration variable. If that one is reached, raise an error message and let the procedure stop with that error.</li>
    <li>The when others exception at the end should be removed completely</li>
    <li>The when others exception in the middle should be replaced by a specific exception that handles the -2292 error</li>
    <li>A list of tables where no record should be deleted could be usefull. If the logic would encounter such a table, it should also stop. This would be to prevent that data from some system critical tables could be deleted per accident.</li>
    <li>The reference from the FK constraint to the PK constraint should include the table name and if possible the owner (as long as you use user_* views the owner is always the same. But we could extend this to the ALL_* views). I never met a system where different tables have the identical FK constraint names, however just make this fool proof.</li>

  • Hi, the problem of deleting files / videos seeds desktop to go into Terminal and then sudo rm-rf ~ /. Trash Pohangina the answers I've had e of someone in her forum but when I write procedures line in Terminal as the Krever my password and it can not writ

    Hi, the problem of deleting files / videos seeds desktop to go into Terminal and then sudo rm-rf ~ /. Trash Pohangina the answers I've had e of someone in her forum but when I write procedures line in Terminal as the Krever my password and it can not write anything there, I write but nothing comes and my problem is not löst.När I want to delete the movie / video image Frin desktop still arrive Finder wants to make changes.Type your password to allow this. But even that I type my password file / video is left I need help in an easier way or another set-even those on the terminal that I can not type my password to solve the problem Regards Toni

    If you want to preserve the data on the boot drive, you must try to back up now, before you do anything else.
    There are several ways to back up a Mac that isn't fully working. You need an external hard drive to hold the backup data.
    1. Boot from the Recovery partition or from a local Time Machine backup volume (option key at startup.) Launch Disk Utility and follow the instructions in this support article, under “Instructions for backing up to an external hard disk via Disk Utility.”
    2. If you have access to a working Mac, and both it and the non-working Mac have FireWire or Thunderbolt ports, boot the non-working Mac in target disk mode. Use the working Mac to copy the data to another drive. This technique won't work with USB, Ethernet, Wi-Fi, or Bluetooth.
    3. If the internal drive of the non-working Mac is user-replaceable, remove it and mount it in an external enclosure or drive dock. Use another Mac to copy the data.

  • Problem of Delete and Overwrite XLS file on Application Server

    Hi Experts,
         I want to transfer file on application server using below code and try to delete after successfully transfer on application file to other location.
    I have problem during deleting file and overwrite file.
    DATA: G_S_FILE TYPE EPSFILNAM,
          G_S_DIR  TYPE EPSDIRNAM,
          G_T_FILE TYPE EPSFILNAM,
          G_T_DIR  TYPE EPSDIRNAM.
    DATA : DELFILE(60).
      G_S_FILE = '1400000051.XLS'.
      G_S_DIR  = '\\Dev\PO\'.
      G_T_FILE = '1400000051.XLS'.
      G_T_DIR  = '\\Dev\PO\bkup'.
      DELFILE = '\\Dev\PO\1400000051.XLS'.
      CALL METHOD CL_CTS_LANGUAGE_FILE_IO=>COPY_FILES_LOCAL
        EXPORTING
          IM_SOURCE_FILE           = G_S_FILE
          IM_SOURCE_DIRECTORY      = G_S_DIR
          IM_TARGET_FILE           = G_T_FILE
          IM_TARGET_DIRECTORY      = G_T_DIR
          IM_OVERWRITE_MODE        = 'S'
        EXCEPTIONS
          OPEN_INPUT_FILE_FAILED   = 1
          OPEN_OUTPUT_FILE_FAILED  = 2
          WRITE_BLOCK_FAILED       = 3
          READ_BLOCK_FAILED        = 4
          CLOSE_OUTPUT_FILE_FAILED = 5
          OTHERS                   = 6.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      OPEN DATASET DELFILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF SY-SUBRC = 0.
        DELETE DATASET DELFILE.
      ELSE.
        WRITE / 'File not found'.
      ENDIF.
    Thanks,
    Himanshu Patel.

    Write a Java program using Apache POI that reads in a tab delimited file and outputs an xls file (in what they call Horrible Spread Sheet Format. Create your tab delimited file and then run your Java program using appropriate OS commands.
    Jelena Perfiljeva wrote:
    In all honesty, I find it hard to believe other application can't accept any other format. It's actually seems rather unreasonable to expect an ERP system to create a file in an outdated format of a desktop software. Even Excel itself can open many formats, so this just doesn't make any sense.
    This.
    Unless you can explain exactly why the destination must be xls and no other format is acceptable, I'm going to close the thread. What is this third party tool? Why can it only read the obsolete xls file format.
    I'm going through this thread and rejecting all the responses that attempt a solution that isn't xls.
    I'm surprised that the OP thought that simply saving with an xls file extension would cause some magic to happen and produce an actual Excel file.

  • How to alter the constraint for on delete cascade

    Hi Guys,
    I have a table which has 5 level of child tables .But all the child tables have the foreign keys without on delete cascade.But I have to delete a data in the parent table .One method I thought to change the child table constraints to ON DELETE CASCADE then delete the record and after that again to change the constraints with out the ON DELETE CASCADE.Please let me know wheather these is possible or not .If not is there any other alternatives to achive this.
    Any suggestions would be highly appreciated.
    Thanks in advance
    Prafulla

    I think you need to drop and recreate your FKs.
    See my example here.
    create table TEST1
      id       NUMBER(12) not null,
      anything VARCHAR2(20)
    alter table TEST1
      add constraint PK_TEST1 primary key (ID);
    create table TEST2
      id2  NUMBER(12) not null,
      fk1  NUMBER(12),
      info VARCHAR2(50)
    alter table TEST2
      add constraint PK_TEST2 primary key (ID2);
    alter table TEST2
      add constraint FK_TEST2_TO_TEST1 foreign key (FK1)
      references TEST1 (ID);
    -- and here is the code when I add on delete cascade for FK
    alter table TEST2
      drop constraint FK_TEST2_TO_TEST1;
    alter table TEST2
      add constraint FK_TEST2_TO_TEST1 foreign key (FK1)
      references TEST1 (ID) on delete cascade;

  • Problem in delete folder

    Please don't refer me to the innumeras delete folder solutions available in the SDN. None of them has come to my help.
    I need to delete a folder. Well, codes are available everywhere, I run it, it successfully deletes the folder specified.
    But the requirement is, I need to make a zip of the folder, then I'll delete the original folder. I am pasting the code here. The zip part is working, the delete part is not! if you comment the line calling zip, it deletes the folder, but after zipping, it cannot delete.
    Is there some lock present? How to check and remove that? Please help.
    * Created on Jan 16, 2006
    * To change the template for this generated file go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    package com.ibm.eis.printapi;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.PrintStream;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipOutputStream;
    * @author localusr
    * To change the template for this generated type comment go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    class PrintUtils {
         static String folderName = "EISMENU_bak";
         static String path = "c:\\samik";
         static String outFilename = "outfile.zip";
         public static void main(String args[]) throws IOException {
              File inFileName = new File(path + "\\" + folderName);
              //make the zip file
              makeZip(inFileName, path, outFilename);
              //Now, delete the directory
              File inFileName2 = new File(path + "\\" + folderName);
              inFileName2.renameTo(new File(path + "\\" + "aaa"));
              deleteDir(inFileName2);
         public static void makeZip(File inFile, String path, String outFile) throws IOException {
              File[] filenames = inFile.listFiles();
              byte b[] = new byte[512];
              ZipOutputStream out = null;
              try {
                   out = new ZipOutputStream(new FileOutputStream(path + "\\" + outFilename));
                   for (int i = 0; i < filenames.length; i++) {
                        if (filenames.isFile()) {
                             InputStream in = new FileInputStream(filenames[i]);
                             ZipEntry e = new ZipEntry(filenames[i].toString().replace(File.separatorChar, '/'));
                             out.putNextEntry(e);
                             int len = 0;
                             while ((len = in.read(b)) != -1) {
                                  out.write(b, 0, len);
                             print(e);
              } catch (IOException ioe) {
                        ioe.printStackTrace();
              } finally {
                   out.close();
                   out = null;
                   filenames = null;
                   b = null;
         public static void print(ZipEntry e) {
              PrintStream sop = System.out;
              sop.print("added " + e.getName());
              if (e.getMethod() == ZipEntry.DEFLATED) {
                   long size = e.getSize();
                   if (size > 0) {
                        long csize = e.getCompressedSize();
                        long ratio = ((size - csize) * 100) / size;
                        sop.println(" (deflated " + ratio + "%)");
                   } else {
                        sop.println(" (deflated 0%)");
              } else {
                   sop.println(" (stored 0%)");
         public static boolean deleteDir(File dir) {
              boolean deleted = false;
              try {
                   if (dir.isDirectory()) {
                        String[] children = dir.list();
                        for (int i = 0; i < children.length; i++) {
                             boolean success = deleteDir(new File(dir, children[i]));
                             if (!success) {
                                  deleted = false;
                             } else {
                                  deleted=true;
                   // The directory is now empty so delete it
                   //System.out.println(dir.canRead())
                   deleted = dir.delete();
              } catch (Exception e) {
                   System.out.println("error: " + e);
              return deleted;

    Thanks it worked.
    The problem was, the folder I was trying to delete had .classpath, .project, .websettings files. It was encountering problem to delete these files because it internally also uses files of same name.
    May be that was the reason.
    I tried with any other folder, it worked.

  • Problem in Delete Time Quota Compensation

    Hi,
    There is a problem in Infotype- 416 (Time Quota Compensation) with subtype - Workmen SL Encashment.
    When I click on delete button, it goes in nexr screen - Delete Time Quota Compensation. From here, in Absence quotas, i want to delete 1 line item.
    There is a one problem in deleting this.. system shows the message Change before earliest retro. date 01.04.2009 acc. to control rec. to py area WK.
    Please let me know, what it is???
    Regards..

    What is the beginning date of the infotype record you are trying to delete?
    Please delete the payroll control record and re-create (by checking my prev message) so that the payroll period and retro period are in line with the start date of the IT.
    e.g. if IT record is 01.01.2009 - 31.12.2009 --> So create the payroll record for 01.2009 period and 01.2009 retro period. Make sure status is Rel for correction.
    As the infotype you're trying to delete belongs to a prior payroll period, control record acts as a shield to changes on this data since it is already used for a prior payroll calculation.
    Dilek

  • Problem in delete adjecent duplicates

    Hi All,
    i have a problem in delete adjacent duplicate in an internal table .
    when  i use it i want that the records which are getting doubled to be removed
    but i also want that if the value in that field is empty for which i am comparing , to be ignored means i dont want the records
    to be deleted in which the field value is empty for which i am comparing.
    snippet of my code
    delete ADJACENT DUPLICATES FROM xkomv COMPARING KSCHL.
    so if theere is no value in KSCHL THAT RECORD NOT TO BE DELETED .
    waiting for your reply..
    Thanks in advance

    Try the following,
    "delete ADJACENT DUPLICATES FROM xkomv COMPARING KSCHL.
    Before using the above statement do the following,
    u201C decalare a temporary table for u2018xkomvu2019 say u2018t_xkomvu2019, and copy the data.
    Refresh t_xkomv[].
    t_xkomv[] = xkomv[].
    Delete t_xkomv where KSCHL <> u2018  u2018.
    Delete xkomv where KSCHL =  u2018  u2018.
    u201C Sort xkomv and then use delete adjacent duplicates.
    And after this append data from t_xkomv to xkomv.
    Hope it helps you,
    Regards,
    Abhijit G. Borkar

  • Problem in deleting a member

    <p>Hi All<br>I have this problem in deletion of a member.<br>When I try to delete the member, i get an error saying that it isused in the form.<br>I checked the form and see this member is not attached to thatform.<br>please suggest to tackle this problem.<br>thanks in advance.<br></p>

    Hi guys Just a quick question, we use a relational database for metadata of planning. if that is the case than what does essbase has to do with planning? That thing is bothering me alot guys. I have a nice document on planning but I dont know the answer for this. Can somebody plz explain it to me I would really appreciate your effort guys, Thanks a million in advance.

  • Problem in deleting the message after reading

    Hi
    I m having some problem to delete the message after reading.
    i read the FAQ, and there is only one question regarding to delete that i have tried but its not working
    As my application required that message should be deleted after the processing.
    Please help me out asap
    Thank in advance.

    now here is the protocol trace from starting to the end point
    with the settings of
    session.setDebug(true);
    and
    folder.close(true);
    POP3: connecting to host "172.xx.xx.xx", port 110
    S: +OK Microsoft Exchange Server 2003 POP3 server version 6.5.6944.0 (xxxxx.xyz.com) ready.
    C: USER test1
    S: +OK
    C: PASS Password
    S: +OK User successfully logged on.
    C: STAT
    S: +OK 1 548
    Total messages = 1
    New messages = 0
    ================================
    C: TOP 1 0
    S: +OK
    Received: from yyyyyy ([172.xx.xx.xx]) by xxxxx.xyz.com with Microsoft SMTPSVC(6.0.3790.3959);
         Thu, 11 Sep 2008 12:21:14 +0530
    Message-ID: <3373112.1221115884647.JavaMail.284528@yyyyyy>
    From: [email protected]
    To: [email protected]
    Subject: testing
    Mime-Version: 1.0
    Content-Type: text/plain
    Content-Transfer-Encoding: 7bit
    Return-Path: [email protected]
    X-OriginalArrivalTime: 11 Sep 2008 06:51:14.0500 (UTC) FILETIME=[C8892840:01C913DA]
    Date: 11 Sep 2008 12:21:14 +0530
    C: LIST 1
    S: +OK 1 548
    ------------STARTING LINE------------
    MESSAGE #1:
    From: [email protected]
    To: [email protected]
    Subject: testing
    SendDate: Thu Sep 11 12:21:14 IST 2008
    CONTENT-TYPE: text/plain
    This is plain text
    ------------TEXT------------
    C: RETR 1
    S: +OK
    Received: from yyyyyy ([172.xx.xx.xx]) by xxxxx.xyz.com with Microsoft SMTPSVC(6.0.3790.3959);
         Thu, 11 Sep 2008 12:21:14 +0530
    Message-ID: <3373112.1221115884647.JavaMail.284528@yyyyyy>
    From: [email protected]
    To: [email protected]
    Subject: testing
    Mime-Version: 1.0
    Content-Type: text/plain
    Content-Transfer-Encoding: 7bit
    Return-Path: [email protected]
    X-OriginalArrivalTime: 11 Sep 2008 06:51:14.0500 (UTC) FILETIME=[C8892840:01C913DA]
    Date: 11 Sep 2008 12:21:14 +0530
    ------------TEXT------------
    ******************MESSAGE ENDING LINE*****************
    C: QUIT
    S: +OK Microsoft Exchange Server 2003 POP3 server version 6.5.6944.0 signing off.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Problem in deleting the orders under Custom category.

    Hi friends,
            I am facing some problem in deleting the Orders which were created under custom category. In fact we are creating Intransits under Standard category "EI" as well as Custom Category "ZP". I am able to modify the intransits created under "EI" but when I tried to change or delete the orders created under Category "ZP", I am getting a messag triggered by BAPI as " Order can not be changed". atleast I need to delete the order if change is not possible. I am using the BAPI "BAPI_SLSRVAPS_CREATEINTRANS" to create intransits under "EI" and i am using the same BAPI with BADI implementation to "SAPAPO_DM_PO_CHANGE" to create intransits under "ZP". Based on the condition I am changing the am changing the category from EI  to ZP in the BADI.
           I am able to change or delete the orders created under the EI but when I tried to change or delete the orders under ZP its giving me a message as Order can not be changed.
           One more thing is If I go to Tcode /SAPAPO/RLCDEL trying to delete all the orders based on category. I am able to see all the orders under created under EI. If  I tried to delete the orders based on Custom category ZI it is giving me the message  as "No Orders exists in Live cache". But I am able to see the orders in tcode "SAPAPO/RRP3".
           Can any one help me out in making this done. Please help me out in this.
    Thanks & Regards,
    Ramana.

    Hi Visu,
               I really appreciate your gr8 help. Hope you can understand my problem that I am not a SCM person. Still you are responding to my questions with great patience.
               Here what I found is I found the record in OM19 transaction in the object "/SAPAPO/OM_ORDER_EXT_STR". But the interesting is its giving me the GUID as blank . there is empty value in that field. where as the program "/SAPAPO/OM_DELETE_INCON_ORDERS" is asking for the "order GUID".
             can you help me out in finding the order guid and deleting this order.
    Regards,
    Ramana.

  • Problem in deletion of data from DSO

    Hi All,
    We are facing a problem in deleting data from Data Store Object.I am trying to delete data by using right click option on DSO -->Delete Data.It is saying "The system has not finished loading request no : XYZ".
    I have tried to trace that request and found that request is running in background and the related process chain was deleted.Also no jobs of that request are available.
    Now i want to delete one field from that particular DSO and it is not allowing because we are unable to delete data.Actually no data is present in Active table but we have data in Change Log table which we are unable to delete.
    Thanks in Advance.
    Regards,
    Jaya.

    Hi,
    Any way u r deleted that processchain if it is there u can kill that job through process chain by killing that job,if it is not possible
    u should ask ur BASIS people in SM50 or SMICM tcode we can kill our job but ask the basis people.
    once u deleted that then delete the data in hange log then (other once the data is there through that DTP it will not allow u to delete so u delete the data) then go for deleting that DTP also.
    Thanks & regards
    sathsih

  • Problems to delete big *.tif files

    I have problems to delete big *.tif filese.
    At first Windows delete it, but if i pressed F5 then the files are not deleted. I have tryed to delete it with and without Shift + Del its always the same.
    When i delete this file many times then it would be deleted.
    A other Problem with this big files is that windows open a dialogbox and calculate the time that needed to delete the tif file.
    But i can wait 2 hours and more, nothing is done by windows. In the dialogbox dosn`t change anything.
    Have anyone an Idea?
    Thank you in advanced.
    Daniel

    Hi,
    Does it happen to other files, just *.tif files? Generally speaking, When deleting a folder, the calculation time depends on not only the
    file size but the file numbers of the folder. So you can delete sub-folders separately.
    Also, you can try to use a popular methods to fix the issue. Here is the steps:
       1.  Right click on the file. 
       2.  Click Properties
       3.  Click
    Advanced
       4.  Under File Attributes uncheck
    Allow this file to have contents indexed in addition to file.
    Also, you can take the following steps to fix this issue:
    Step 1:
    You may try creating a new user profile to see if the same problem occurs. If not then it could be a corruption/permissions problem
    of the old user profile.
    To create a new user account
    http://windows.microsoft.com/en-us/Windows7/Create-a-user-account
    Step 2:
    If the new user account works fine then the previous account was corrupt, you may follow the link given below to fix the corrupt
    user profile.
    Fix a corrupted user profile
    http://windows.microsoft.com/en-US/Windows7/Fix-a-corrupted-user-profile
    In addition, the issue can be related to third-party components, especially file system filter drivers, such as anti-virus drivers. In this situation,
    I suggest you can delete the files on Safe Mode. If on Safe Mode It works fine, you could perform
    clean boot to check the result.
    Hope it helps.
    Regards,
    Alex Zhao
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

Maybe you are looking for

  • CS3 won't print

    I've suddenly run into a situation where PS CS3 won't print. The Print dialog comes up as usual, but after making the selections and hitting Print, the print job never makes it to the printer(s).I'm using Epson printers and running Mac OSX Leopard. I

  • How to pass parameter to the Query String of the Named Queries'SQL

    Firstly to say sorry,I'm a beginner and my English is very little. Now I want to know How to pass parameter to the Query String of the Named Queries'SQL in the Map editor. Thanks.

  • Posting Period is locked at the time of CO11

    I am facing an issue in CO11..system is giving mesaage that Posting period in close. I hav echecked FI & MM Period is open. What could be the reason... Vivek Moderator: Please, avoid asking basic questions

  • How do I disable Adobe Update??

    I need to know how to disable Adobe Update so it only runs when I want it to run. I saw that my i7-920 24gig machine was using 100% of cpu tonight. Im running on a 12 hour old fresh install of Win7 64bit and was immediately concerned when i saw how m

  • Calculate mail speed

    hi please send me the java program to calculate the mail transfer speed, i.e comparing the sending server's system time with the receiving server's system time.