Re: TRUNCATE TABLE
Posted in 2000
Topics: Server Administration, Triggers, Constraints & Referential Integrity
Ben
You dont have to manually recreate these tables, just disable the constraints.
Anyway, Harry tells me that TRUNCATE is supported on 9.2 - its in the FM.
HTH
Sujit
Ben Draper <bdraper@mathworks.com> on 04/26/2000 12:58:02 PM
Please respond to Ben Draper <bdraper@mathworks.com>
To: informix-list@iiug.org
cc:
Subject: Re: TRUNCATE TABLE
And say another table has foreign key constraints (not necessarily any rows)
against this table, what then?
Do you have to manually recreate these tables as well?
Sujit.Pal@bankofamerica.com wrote in message
<8e7h3l$f8q$1@news.xmission.com>...
>
>
>
>Harry
>
>TRUNCATE is an Oracle-ism, it does not exist in Informix. You can do the
same
>thing by:
>
>dbschema -d <yourdb> -t <yourtable> -ss cr_<yourtable>.sql>
>echo "drop table <yourtable>;" | dbaccess <yourdb>
>dbaccess <yourdb> cr_<yourtable>.sql
>
>where <yourdb> = hib
>and <yourtable> = ipporttnp
>
>HTH
>Sujit
>
>
>
>
>
>
>Harry Sheng <hsheng@crosskeys.com> on 04/27/2000 08:54:42 AM
>
>Please respond to Harry Sheng <hsheng@crosskeys.com>
>
>To: informix-list@iiug.org
>cc:
>Subject: TRUNCATE TABLE
>
>
>
>Hello, there
>
>I use IDS9.2. I tried to delete from a table using "TRUNCATE".
>The table is a fragmented table and is there, and I have checked
>all constraints on executing "truncate table". The statement is
>very simple, but I do not know why I can not successfully execute
>it. Any idea is appreciated.
>
>Harry
>
>------
>> echo "truncate table ipportnp" | dbaccess hib
>
>Database selected.
>
>
> 201: A syntax error has occurred.
>Error in line 1>Near character position 1
>
>
>Database closed.
>
>>
>
>
>
>
>
>
>
>
>
If this table you are dropping/recreating is referenced by these
constraints, wont the reference be broken and cause these constraints to
become invalid or dropped themselves?
Sujit.Pal@bankofamerica.com wrote in message
<8e9r3o$mmh$1@news.xmission.com>...
>
>
>
>Ben
>
>You dont have to manually recreate these tables, just disable the
constraints.
>Anyway, Harry tells me that TRUNCATE is supported on 9.2 - its in the FM.
>
>HTH
>Sujit
>
>
>
>
>
>Ben Draper <bdraper@mathworks.com> on 04/26/2000 12:58:02 PM
>
>Please respond to Ben Draper <bdraper@mathworks.com>
>
>To: informix-list@iiug.org
>cc:
>Subject: Re: TRUNCATE TABLE
>
>
>
>And say another table has foreign key constraints (not necessarily any
rows)
>against this table, what then?
>Do you have to manually recreate these tables as well?
>
>
>Sujit.Pal@bankofamerica.com wrote in message
><8e7h3l$f8q$1@news.xmission.com>...
>>
>>
>>
>>Harry
>>
>>TRUNCATE is an Oracle-ism, it does not exist in Informix. You can do the
>same
>>thing by:
>>
>>dbschema -d <yourdb> -t <yourtable> -ss cr_<yourtable>.sql>>
>>echo "drop table <yourtable>;" | dbaccess <yourdb>
>>dbaccess <yourdb> cr_<yourtable>.sql
>>
>>where <yourdb> = hib
>>and <yourtable> = ipporttnp
>>
>>HTH
>>Sujit
>>
>>
>>
>>
>>
>>
>>Harry Sheng <hsheng@crosskeys.com> on 04/27/2000 08:54:42 AM
>>
>>Please respond to Harry Sheng <hsheng@crosskeys.com>
>>
>>To: informix-list@iiug.org
>>cc:
>>Subject: TRUNCATE TABLE
>>
>>
>>
>>Hello, there
>>
>>I use IDS9.2. I tried to delete from a table using "TRUNCATE".
>>The table is a fragmented table and is there, and I have checked
>>all constraints on executing "truncate table". The statement is
>>very simple, but I do not know why I can not successfully execute
>>it. Any idea is appreciated.
>>
>>Harry
>>
>>------
>>> echo "truncate table ipportnp" | dbaccess hib
>>
>>Database selected.
>>
>>
>> 201: A syntax error has occurred.
>>Error in line 1>>Near character position 1
>>
>>
>>Database closed.
>>
>>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
>
>
>
>
>
>
>