By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,586 Members | 2,347 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,586 IT Pros & Developers. It's quick & easy.

How to Drop data from table quickly

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a

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

P: n/a
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

P: n/a
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.