Re: TRUNCATE TABLE
Posted in 2000
Topics: Server Administration
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 1Near character position 1
Database closed.
>
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.
>
>>
>
>
>
>
>
>
>
>
>