Re: Deleting all rows from standard (with loggin) table on IDS 9.40
Posted in 2006
Topics: Error Codes & Troubleshooting, Connectivity: ODBC / JDBC / .NET, Versions, Editions & End-of-Life
I might be wrong but can't you just use ondblog to turn logging off, delete the rows, then turn it on again? It means not having to log all those deletes. But of course if you have to log all of the deletions then this isn't going to work for you. You can do this for loading data too. Very simple.
http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.admin.doc/admin464.htm
Hope this helps...
DE
Lukas Barton wrote:
> Hi,
>
> how can I delete all rows from standard (with loggin) table on IDS 9.40?
> - on tuncate table [table_name] server report synstax error (SQL
> State: 42000, Error Code: -201)
> - on delete from [table_name] causes long transaction error (SQL
> State: IX000, Error Code: -458)
>
> I use JDBC.
> There are about 300 000 rows in table.
> Locking mode is page.
> Database is non-ansi.
> Table have some foreing keys and indexes.
>
> Thanks helping me,
>
> Lukas
>
>
Double Echo wrote:
> I might be wrong but can't you just use ondblog to turn logging off, delete the rows, then turn it on again? It means not having to log all those deletes. But of course if you have to log all of the deletions then this isn't going to work for you. You can do this for loading data too. Very simple.
>
> http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.admin.doc/admin464.htm
>
> Hope this helps...
>
You may miss that I am using JDBC (Hibernate exactly).
So the only valid solution is to delete data in for (while) loop (only
if the Hibernate dialect is InformixDialect).
I have to have similar if (if (...Informix...)) on update/delete
statement with subselect over updated table in where.
Eg.:
Informix:
update Dotaz as dotaz set statusId=:status,
metaTypChyby=:metaTypChyby where dotaz.davka=:davka and exists(select
vstp.id from IdfKlient as vstp where vstp.dotaz=dotaz and
tabulkaVSablone=:tabulka)
Oracle, Postgres etc:
update Dotaz as dotaz set statusId=:status,
metaTypChyby=:metaTypChyby where dotaz.davka=:davka and dotaz.id in
(select vstp.dotaz.id from IdfKlient as vstp where
vstp.dotaz.davka=:davka and tabulkaVSablone=:tabulka)
The first stament does not pass on Interbase/Firebird :-(
That's the price of writing multidatabase application.
Lukas
> Lukas Barton wrote:
>> Hi,
>>
>> how can I delete all rows from standard (with loggin) table on IDS
>> 9.40?
>> - on tuncate table [table_name] server report synstax error (SQL
>> State: 42000, Error Code: -201)
>> - on delete from [table_name] causes long transaction error (SQL
>> State: IX000, Error Code: -458)
>>
>> I use JDBC.
>> There are about 300 000 rows in table.
>> Locking mode is page.
>> Database is non-ansi.
>> Table have some foreing keys and indexes.
delete from table_name
????
--
Bye now,
Obnoxio
"... no bill is required as no value was provided."
-- Christine Normile
--
This message has been scanned for viruses and
dangerous content by OpenProtect(http://www.openprotect.com), and is
believed to be clean.