Subject Re: [IBO] Syntax for passing variable to insert query
Author mitch_landor
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@...> wrote:
>
> At 05:04 PM 11/09/2006, you wrote:
> >--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@> wrote:
> >
> > > >I have read that perhaps I should use the OnNewRecord event
> > >
> > > Nope. OnNewRecord is an event of a dataset.
> >
> >Apologies for being baffled.
>
> I'm even more baffled than you think *you*are.
>
>
> >Is not the result of a TIBOQuery a dataset?
>
> No, TIBOQuery is a class that encapsulates a SELECT statement. The
> result of a SELECT statement is a dataset.
>
> >It has an OnNewRecord event handler.
>
> Indeed. OnNewRecord is an event that fires when the Insert() method
> of the dataset is called. If there is no dataset, there is no
> OnNewRecord event.
>
> >Also, the SQL code I posted was in the insert window of the TIBOQuery.
>
> What is "the insert window"?
>
> >Can I just modify the code in the insert window to achieve what I want?
>
> I don't know. Could you describe this "insert window" ?
>
> Helen
>


Right Click on TIBOQuery Component & "Edit Query".
Select "UpdateSQL" tab.
There are 3 boxes - "EditSQL", "InsertSQL", "DeleteSQL".
What I described as the "insert window" is the "InsertSQL" box.

Can I modify the code in the "InsertSQL" box that was created when I
pressed the button "Generate for Table" so that I can make one of the
columns receive a delphi global variable, and have the other columns
take their values as normal from an dbgrid?

If not, is there an easy way to do this using the TIBOQuery component?

Thanks

Mitch