467,201 Members | 1,029 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,201 developers. It's quick & easy.

How to Drop data from table quickly

Hi,

I am using a DB2 table of size 100 thousand records in it, which does
not have any relationship with other tables. When i tried to delete the
data in the table by using the command

IMPORT FROM /dev/null OF DEL REPLACE INTO MyTable;

I am passing this command from a java program running in a client
machine in windows operating system. The server is a unix machine. I am
getting getting the following error message,when use the above command.

com.ibm.db2.jcc.b.SQLException: An unexpected token "IMPORT FROM
/dev/null OF DEL REPLACE" was found following "BEGIN-OF-STATEMENT".
Expected tokens may include: "<insert>".

Thank you
Mike Murugan

Apr 3 '06 #1
  • viewed: 5717
Share:
3 Replies

The following sql will also do the needed
ALTER TABLE TAB1 ACTIVATE NOT LOGGED INITIALLY WITH EMPTY TABLE. (this would
require alter privileges on this table)

-Sumanth

"mike" <me*********@gmail.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
Hi,

I am using a DB2 table of size 100 thousand records in it, which does
not have any relationship with other tables. When i tried to delete the
data in the table by using the command

IMPORT FROM /dev/null OF DEL REPLACE INTO MyTable;

I am passing this command from a java program running in a client
machine in windows operating system. The server is a unix machine. I am
getting getting the following error message,when use the above command.

com.ibm.db2.jcc.b.SQLException: An unexpected token "IMPORT FROM
/dev/null OF DEL REPLACE" was found following "BEGIN-OF-STATEMENT".
Expected tokens may include: "<insert>".

Thank you
Mike Murugan

Apr 3 '06 #2
Ian
mike wrote:
Hi,

I am using a DB2 table of size 100 thousand records in it, which does
not have any relationship with other tables. When i tried to delete the
data in the table by using the command

IMPORT FROM /dev/null OF DEL REPLACE INTO MyTable;

I am passing this command from a java program running in a client
machine in windows operating system. The server is a unix machine. I am
getting getting the following error message,when use the above command.


IMPORT is not an SQL statement - it is a DB2 command - and therefore
isn't accessible via JDBC.

You can do:

ALTER TABLE MyTable ACTIVATE NOT LOGGED INITIALLY WITH EMPTY TABLE

Or, write a stored procedure in C that calls the IMPORT api, and then
call the stored proc from your Java code.

Apr 3 '06 #3
mike wrote:
IMPORT FROM /dev/null OF DEL REPLACE INTO MyTable;


I don't think that you can do this over a JDBC connection.

Bernd
Apr 3 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by David Link | last post: by
3 posts views Thread by excel_hari@yahoo.com | last post: by
2 posts views Thread by tpaulson@nsc-inc.com | last post: by
5 posts views Thread by Markus | last post: by
reply views Thread by statlerw@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.