Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2004
    Posts
    1

    Unanswered: Code for Emptying table inside a Stored Procedure

    There is a way of deleting data from table (emptying table) in DB2, which is more effective than the normal delete statement. Below is the command for that:

    import from nul: of del replace into <table_name>

    I have to use this kind of delete command inside a stored procedure. Can somebody please help me out on the way to do this?

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Import is not allowed in Stored Procedure. Only SQL is allowed with a few exceptions (see the SQL Reference section on "SQL Procedure Statement").

    Andy

  3. #3
    Join Date
    Mar 2004
    Posts
    448
    you can use

    alter table <table_name> activate not logged initially with empty table

    mujeeb

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    mujeeb,
    Only if the table was created with the NOT LOGGED INITIALLY clause.
    Andy

  5. #5
    Join Date
    Mar 2004
    Posts
    448
    thanks ARwinner.. that is very true.

    mujeeb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •