473,406 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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
3 5872

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ryan | last post by:
Just a quicky about temporarary tables. If using QA, when you create a temporary table, it gets dropped if you close the query. Otherwise you need to state 'DROP TABLE myTable' so that you can...
3
by: David Link | last post by:
Hi All, Here's a Conditional drop_table func for those interested. There was a thread on this a long time back. We do this all the time : DELETE TABLE sales; CREATE TABLE sales (...);
10
by: BuddhaBuddy | last post by:
Platform is DB2/NT 7.2.9 The table was created like this: CREATE TABLE MYTEST ( MYTESTOID bigint not null primary key, FK_OTHEROID bigint not null references other, FK_ANOTHEROID bigint not...
3
by: excel_hari | last post by:
Hi, I couldnt locate a Classic ASP group hence posting here. One of my colleagues has designed an intranet site and one of the pages has a drop-down box with close to 300 options. I want to...
2
by: tpaulson | last post by:
I have a couple of DIV's that I hide/display based on radio buttons. On the DIV's, I have multiple drop down boxes. The source shows that they are populated, but I can't make them drop down. Only...
5
by: Markus | last post by:
I tried this: ALTER TABLE Dokumente DROP COLUMN docPrioID but I get this errormessage: DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: COLUMN;ABLE Dokumente DROP;CONSTRAINT
0
by: statlerw | last post by:
I have successfully implemented drag and drop in my application to allow the reordering of columns by dragging and dropping them in the same datagridvire (Net 2.0). If i take it relatively...
1
by: sparksol | last post by:
I have a form with a drop down box. If you select an option in the drop down box (depending which option is selected) one or two textbox(es) and a submit button display. I would like to keep the...
4
by: Joseph | last post by:
Can i drop a cloumn from a table in DB2 for Z/OS?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.