Re: RE: Select on empty table return status
Posted in 2000
Paul Watson <PWatson@Lastminute.com> wrote: >Sounds like an uninitialized variable some where That probably would account for the garbage, but should that affect the the value of status? I really don't care about the data selected. All I'm testing for is whether the row already exists or not. I know I could just select count(*) into a variable and test that value, but I'm trying to understand what's going on here (why I'm not getting the results I would expect) and determine if it might be causing other problems for this client. > >-----Original Message----- >From: Carlos Benjamin [mailto:benj@linuxstart.com] >Sent: Monday, April 17, 2000 5:08 PM >To: informix-list@iiug.org >Subject: Select on empty table return status > > >I have an empty table created to hold open and closure dates for projects. >I'm adding the 4gl code to populate this table >and am running across a strange problem. Since none of the existing projects >have dates associated with them any >closure will not find a date record to update, so I decided to use a select >to determine if a record exists and give the >operator the opportunity to input an open date based on their knowledge of >the project and then do an insert instead of >an update. > >Here's the problem. The select on the empty table return status indicates a >row was found. I put in a display to find the >open date (the column I am selecting) and I get the following garbage on the >first attempt: > >Open date is :04/1ޭ''ޭ: > >Subsequent attempts display a date of 12/31/1899 until I exit the program >and reenter, at which time it reverts back to >garbage. Neither of these results are valid or useful, as you can imagine, >since the program goes on to try to update a >row that does not exist rather than create one. > >I have run update statistics to no avail. > >Platform is RS6000 running AIX 4.3.2 >Informix 7.31.UC2X3 > >I would appreciate the benefit of your accumulated wisdom. Cash >contributions would also be nice as an early >retirement would also relieve me from this problem. > >Thanks, > >carlos > >Currently on hiatus from unemployment. >---------------------- >Do you do Linux? :) >Get your FREE @linuxstart.com email address at: http://www.linuxstart.com carlos Currently on hiatus from unemployment. ---------------------- Do you do Linux? :) Get your FREE @linuxstart.com email address at: http://www.linuxstart.com