Subject Re: [IBO] Edit fields in grid supplied by Stored Procedure
Author Helen Borrie
At 05:22 PM 12/10/2005 -0400, you wrote:
>Hello,
>
>I have a IB_Grid that I am populating from a stored procedure,
>I use the updateSQL to update the underlying table fields when
>they are edited. But I have a couple of problems:
>
>1. When a field is edited and the user moves to the next record
>the changes they made to that field vanish from the screen.
>They where made to the underlying files, and a refresh will cause
>them to reappear. How do I get them to stay?

Don't use Autocommit. Wait until the user has finished doing the updates
s/he wants to do, then commit the changes as a whole. The reason is, of
course, that a selectable SP has no linkage whatsoever with the underlying
tables. It would have to be executed afresh to deliver the updated rows.


>2. A character field that we use for a Boolean (T,F) displays
>as a checkbox but when we click on it, it cycles through 3 states
>"gray checked", "checked", and "blank". I am just expecting
>to have "checked", and "blank". The "gray checked" seems to be
>null. I have set:
> ColumnAttributes.Strings = ('OD_INCOMING_RECVD=NOTNULL;BOOLEAN=T,F')
>but that hasn't solved the problem. How do I stop this?

Set the Default attribute to 'F' or 'T' (according to requirements). You
can use the DefaultValues property of the statement or the connection for
this (format [< tablename >.]< columnname >=< string value to be assigned >
or you can do it in the "Default" field of the Fields Editor for an IB_Query.

This takes care of inserts only. If it's a non-nullable column in the
database, existing rows should not be coming up with nulls. If it's
nullable in the database and you are forcing it non-null in the
application, then you've got a different problem, insofar as you have one
rule defined in the database and a conflicting rule in the
application. Not desirable....

Helen