Re: beginning with informix.. HELP
Posted in 2005
adrian.baceanu@gmail.com said:
>
> Please excuse my style and language, but I hope someone will
> understand.
> I started working with informix for about 2 weeks. Where I use it,
> Informix is installed on SCO version 5. I don't the Informix version
> used.
> The problem is that I have a big table,among others, with about 40,000
> records per month, in average. At this moment it keeps record back from
> march 2005.
> I have a 4gl application that's using the database and a number of
> around 4-5 users runing it all the time.
> Imagine this: I define a cursor, then, in the foreach - end foreach
> statement I want to update this big table with a clause searching for a
> certain client which has records in the database. There will be many
> records found, thousands. In random moments, I get an error SQL error
> -244 Could not do a physical-order read to fetch next row. and ISAM
> error -107 ISAM error: record is locked.
> What I believe is that, while the foreach cycle is running (it looks
> like this:
SET LOCK MODE TO WAIT -- goes here
> declare curs cursor for select * from .....
> foreach curs into xy.*
> .....
> update f103 set tax=0 where data=..... and name=xy.name ....
> end foreach)> someone else is updating the table, so it's getting locked.
> I found an answer, that I can use SET LOCK MODE TO WAIT, but ...I don't
> know about the deadlocks...
Try:
SET LOCK MODE TO WAIT 2 -- try this first.
> Can someone please help me? It's this the best solution? Where to put
> this statement, just before update f103....?
>
> The previous person that worked in my place said that it's cause the
> table is so big, so I must move and after that delete some of the
> records from previous months.
Bad application design more like.
--
Bye now,
Obnoxio
"C'est pas parce qu'on n'a rien ` dire qu'il faut fermer sa gueule"
- Coluche
did i mention i like nulls? heck, i even go so far as to say that all
columns in a table except the primary key could/should be nullable. this
has certain advantages, for example, if you need to insert a child record
and you don't have a parent row for it, just do an insert into the parent
table with the primary key value (everything else null), and voila,
relational integrity is preserved. but this is, admittedly, a bit
controversial among modellers.
--r937, dbforums.com
sending to informix-list