Re: prepare error 410
Posted in 2012
In general, your advice is good and the OP doesn't supply enough context to know if he is doing something he should not. Certainly if he later fragments his table he will have to do it WITH ROWID which has overhead effects that have to be considered. It is safe, in general, to use ROWID in a situation where you fetch a data set for users including the rowids then when a user selects a row to update to an UPDATE ... WHERE ROWID = <rowid>; the row's rowid will not change within that small context. It is exactly what all of your ISQL ACE form apps are doing under the hood, BTW. Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Thu, Aug 9, 2012 at 7:21 AM, FRANK J. COMPUTER <frank_in_pr@hotmail.com>wrote: > >>> > Frank, ROWID is indeed supported in IDS. The WITH ROWIDS clause ONLY > applies to fragmented tables which do not have a natural rowid pseudo value > because the rowids or each fragment begin with the same value (equivalent > of page 0 slot 1). But tables that are not fragmented do have a natural > ROWID that you can use. > > Art > >>> > > That's what I actually meant. But anyway, I feel its not a sound practice > for > the OP to use ROWID in his UPDATE statement since these values could > change. > > On Wed, Aug 8, 2012 at 9:23 PM, FRANK J. COMPUTER > <frank_in_pr@hotmail.com>wrote: > > > >>> > > I modified the application from > > > > EXEC SQL update rcpf20 set *=(:rcpf20) where rowid=:rowid" > > > > to > > > > exec sql prepare s2 from "update rcpf20 set *=(:?) where rowid=?" > > > > for (;;) > > >>> > > > > 1. Which version of ESQL/C and IDS are you using? > > 2. Why are you using ROWID? That doesn't work with IDS unless the table > was > > created with ROWID's, or your table is on an SE database. > > > > >>> > > { > > > > EXEC sql execute s2 using :rcpf20,:rowid > > > > } > > :rcpf20 is a structure. > > > > When I execute the program, it report -410 error. > > > > Prepare statement failed or was not executed. > > > > This EXECUTE statement refers to a statement id that has not been > prepared. > > Either no PREPARE statement was done, or one was done but returned an > error > > code. Review the program logic to ensure that a statement is prepared and > > the > > PREPARE return code is checked. A negative error code from PREPARE > usually > > reflects an error in the statement being prepared. > > > > Do anybody know what has happenend? How to avoid this problem? > > >>> > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --e89a8ff1cc60f9780304c6d3cff9