Subject RE: [IBO] Edit fields in grid supplied by Stored Procedure
Author Michael L. Horne
> >
> >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.
>

That sounds like it would work, but that would mean that the
changes will not get posted until the user exits the screen,
or I will need to setup a timer to fire the commit in a timely
manor.

>
> >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....

We are editing data, the field is non-nullable in the db how do
I make the program IBOBjects checkbox in the grid realize that
it is non-nullable and stop allowing it to change to null?