Re: =?ISO-8859-1?Q?Can=B4t_recreate_index_on_temp_tab?=
Posted in 2005
You know, from time to time it would help if people would tell the whole story...
My bet goes has follows:-
- you have begun work
- created a temp table as part of the transaction
- declared and opened a cursor with hold on the table (this is the crucial bit)
- for some reason you have decided to rollback
- the temp table is now gone, but the cursor is still open (it was with hold...)
- you now create a new temp table by the same name (you know you have to close
and reopen the cursor, don't you?)
- the create index now fails with a 242/106
If the picture above is correct, you are running into B171443. Workaround:
don't declare the cursor WITH HOLD (in this particular case, it's a debatable
practice, anyway). Or close the cursor after the rollback and reopen it after
you recreate the table.
Wasn't it lucky for you that I was asked to work on this bug just last week?
J?rg Spilker wrote:
> We're running Informix Dynamic Server 9.40.FC3 on a HP alpha cluster
> node. One of our applications is creating temp table's with indexes
> within a transaction. When the transaction is rolled back, the temp
> tables are gone. However if the application tries to recreate the temp
> tables and indexes in the same session, creating the indexes always
> fails with:
>
> SQL statement error number -242.
> Could not open database table (12spilk.t_tmp_fasumme)
> SYSTEM error number -106.
> ISAM error: non-exclusive access.>
> How can i avoid this problem?
>
--
Ciao,
Marco
______________________________________________________________________________
Marco Greco /UK /IBM Standard disclaimers apply!
Informix faq http://www.iiug.org/techinfo/faq/informix.htm
4glworks http://www.4glworks.com
Informix on Linux http://www.4glworks.com/ifmxlinux.htm
sending to informix-list