Re: PUT cursors and Locking w/o Logging
Posted in 1999
Anil I have not coded ESQL/C in a long while, so I will defer to Art for details, but AFAIK, you can declare insert cursors and you can use PUT cursorname (or something similar) to insert into a cursor. Check out the ESQL/C programmer's guide for details. I hope you mean a ESQL/C program when you say procedure since SPL cant do (dynamically specifying tabname and colname) what you ask. HTH Sujit com2k@my-deja.com on 07/22/99 08:29:50 AM Please respond to com2k@my-deja.com To: informix-list@iiug.org cc: (bcc: Sujit Pal) Subject: Re: PUT cursors and Locking w/o Logging Art, Sujit, Pardon me for busting in with what may be an unrelated question but you may have a solution for my problem, in brief: I need to duplicate a records in a few tables where columns have unique constraints. I'm presently retrieving to a cursor, fetching to a %rowtype variable and modifying the values in the variable. The problem is INSERTing the variable - is this possible ? Can I open a cursor to INSERT ? I'd like to write a procedure to do this where I can send it the Table Name, the column name, the value for the retrieval and the value it is to be replaced with in the copy. Thanks for your help, Anil Asher In article <7mon76$s9p$1@news.xmission.com>, Sujit.Pal@bankofamerica.com wrote: > > > Art > > I am not sure if this is a joke, but here goes anyway. > > Dont know if the PUT CURSOR will hold locks until the cursor is closed, but > you may want to consider locking the source and target tables in exclusive > mode by the data copying process. That way it will use only 1 lock per > table per database for the duration of the copy. I just created a unlogged > database and tried LOCKING a table in EXCLUSIVE MODE and it worked, so I > guess it will work on your system too. I am running IDS 7.30.UC8. Dont know > whether it was possible to lock a table in exclusive mode in 7.24, but you > may want to try that out on your source database. > > HTH > Sujit > > "Art S. Kagel" <kagel@bloomberg.net> on 07/16/99 09:46:17 AM > > Please respond to kagel@bloomberg.net > > To: informix-list@iiug.org > cc: (bcc: Sujit Pal) > Subject: PUT cursors and Locking w/o Logging > > Question for the community: > > If I have a database without logging (I know! It's one of the last few > of the databases created by my predecessor and I am migrating it to > 7.31 with logging next week, honest) and I am inserting using a PUT > CURSOR. Does the PUT CURSOR hold locks on all of the rows inserted > until the cursor is closed? If the database had logging I would open > the CURSOR...WITH HOLD and COMMIT every N rows to release the locks so > I have assumed that without logging that no locks would be held, except > briefly while the 200 or so row that fit in the PUT buffer are being > inserted on the engine side, and I would have no problem. But suddenly > I am nervous. I have to copy 2 - 20,000,000 row tables from one server > to another and I fear running out of lock (80,000 configured). This is > a critical job that I will not be able to monitor constantly for the > 15 hours or so that it will run, so I just want to increase my level of > comfort. Anyone have any thoughts, definite answers, "How can you be > so dumb?" comments? All graciously and gladly accepted. > > Thanks > Art S. Kagel > > Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.