RE: anything like MS-SQL "truncate" function in Informix?
Posted in 2004
What You propose is really equivalent to MS SQL 'truncate';
It is extremely slow - it is very inefficient to delete
record-by record, especially if table is indexed.
'Real' truncate should be equivalent to:
BEGIN WORK;
DROP TABLE..;
CREATE TABLE...;
CREATE INDEX...;
ALTER TABLE.. ADD CONSTRAINT...;
COMMIT WORK;
------------------------------------------
Alexey Sonkin
From: Rob Vorbroker [mailto:rvorbroker@yahoo.com]
Could do the old fashioned following unit of work:
BEGIN WORK;
LOCK TABLE tablename;
DELETE FROM tablename WHERE 1=1;COMMIT WORK;
I'm admittedly OLD SCHOOL....and my 4GL is a bit
rusty...but I think you get the gist... You could
write a Stored Procedure for each of the specific
tables in question.
Rob Vorbroker
--- sumGirl <emebohw@netscape.net> wrote:
> Is there something in Informix thats analagous to
> the truncate
> function in MSSQL Server truncate?
>
> Looking for a way to very quickly get rid of every
> row in a table. We
> have been dropping and recreating on the fly, but
> that has our
> programmers hard coding dbspaces into there apps
> which is probably not
> best practice.
>
=====
Rob Vorbroker Phone: 513/336-8695
Vorbroker Consulting, Inc. Fax: 513/336-6812
www.vorbroker.com robv@vorbroker.com
sending to informix-list
sending to informix-list