Astrocloud
Technical User
- May 29, 2007
- 13
I believe that Informix 9.4 is ANSI
I am updating a table from a temp table. The problem is that I am trying to update too many records and I believe that I am running out of room.
My temp table looks like this:
06116047933201|X2007:247:1188|01|
06116047933301|X2007:247:1189|01|
06116047933401|X2007:247:1191|01|
06116047954701|X2007:250:1121|01|
06116047996101|X2007:259:0136|01|
06116047996201|X2007:259:0136|02|
06116047996301|X2007:259:0136|03|
06116024013111|X2007:260:0456|01|
06116024013101|X2007:260:0456|02|
06116024013201|X2007:260:0456|03|
only it's big. (16000+ rows)
I load it like thus:
create temp table t_table (markcode CHAR(14), X_code CHAR (15), lines INT);
load from "/home/astrocloud/large.mark.list.txt"
insert into t_table;
Here is my update:
update rin1 set rin1.markcrn = (select t_table.markcode from
t_table, rin0 where
t_table.X_code = rin0.code and
rin0.skey = rin1.tkey
and t_table.lines = rin1.lineno)
Note that there is no "Where" statement after the embedded select. I have tested this code on a short version of the temp table and it works fine. Sometimes to avoid the query of "do you really want to update ..." -I insert a "where rin1.tkey > 0" but it's not necessary.
Here's the problem, when updating 16000 rows -it runs out of memory. Works fine on 100 rows. Works terrible on lots more.
I was told by a coworker that it is possible to insert a variable and increment it for every update -then after a certain amount of updates run a "Commit"
Does anyone know how to do this?
Thanks,
Astro
I am updating a table from a temp table. The problem is that I am trying to update too many records and I believe that I am running out of room.
My temp table looks like this:
06116047933201|X2007:247:1188|01|
06116047933301|X2007:247:1189|01|
06116047933401|X2007:247:1191|01|
06116047954701|X2007:250:1121|01|
06116047996101|X2007:259:0136|01|
06116047996201|X2007:259:0136|02|
06116047996301|X2007:259:0136|03|
06116024013111|X2007:260:0456|01|
06116024013101|X2007:260:0456|02|
06116024013201|X2007:260:0456|03|
only it's big. (16000+ rows)
I load it like thus:
create temp table t_table (markcode CHAR(14), X_code CHAR (15), lines INT);
load from "/home/astrocloud/large.mark.list.txt"
insert into t_table;
Here is my update:
update rin1 set rin1.markcrn = (select t_table.markcode from
t_table, rin0 where
t_table.X_code = rin0.code and
rin0.skey = rin1.tkey
and t_table.lines = rin1.lineno)
Note that there is no "Where" statement after the embedded select. I have tested this code on a short version of the temp table and it works fine. Sometimes to avoid the query of "do you really want to update ..." -I insert a "where rin1.tkey > 0" but it's not necessary.
Here's the problem, when updating 16000 rows -it runs out of memory. Works fine on 100 rows. Works terrible on lots more.
I was told by a coworker that it is possible to insert a variable and increment it for every update -then after a certain amount of updates run a "Commit"
Does anyone know how to do this?
Thanks,
Astro