Board index » delphi » updateable query in DBGrid?

updateable query in DBGrid?

I guess what I'm looking to do may be impossible. Maybe someone can point
me in the right direction. I'm using Delphi 2.0 and Oracle 7.3.2  on DEC
UNIX. I want to have a DBGrid of the items on a sale
transaction, ie a subset of a large table of all items on all
trasactions. That I can do. But I want that DBGrid to be updateable. I
thought that the best way to isolate the records would be to use a TQuery
datasource, not a TTable (I don't want the whole table going over the
network, just the one sale). I created a view in Oracle, which behaves
properly from SQL Plus, that is, if I change a line's quantity, a trigger
updates the total, etc.
I created a TQuery with SQL Select from the view where id = theparameter,
basically. How can I make the lines in the DBGrid updateable?

TIA
John Holland

 

Re:updateable query in DBGrid?


Quote
holla...@clark.net (John Holland) wrote:
> I guess what I'm looking to do may be impossible. Maybe someone can point
> me in the right direction. I'm using Delphi 2.0 and Oracle 7.3.2  on DEC
> UNIX. I want to have a DBGrid of the items on a sale
> transaction, ie a subset of a large table of all items on all
> trasactions. That I can do. But I want that DBGrid to be updateable. I
> thought that the best way to isolate the records would be to use a TQuery
> datasource, not a TTable (I don't want the whole table going over the
> network, just the one sale). I created a view in Oracle, which behaves
> properly from SQL Plus, that is, if I change a line's quantity, a trigger
> updates the total, etc.
> I created a TQuery with SQL Select from the view where id = theparameter,
> basically. How can I make the lines in the DBGrid updateable?

I guess it's not the obvious and that you did set RequestLive to true?
As you're sure your view is updatable, the straight select on it
should be too. Did you try it with SQL*Plus? Sending an update
statement ON THE VIEW with the same condition as what's in your
TQuery? Did you type the select in the TQuery all uppercase (at least
for Oracle's objects)? What error message do you actually get?

Delphi2 talking to Oracle 7.3 on Unix and updating shouldn't be a
problem. My users do that the whole day long, though my db server is
HP-UX10, not DEC.

You're right about the use of the TQuery. Stick to it!

Jasper

Re:updateable query in DBGrid?


In article <5d7qlq$...@clarknet.clark.net>,
  holla...@clark.net (John Holland) wrote:

Quote
> I created a TQuery with SQL Select from the view where id = theparameter,
> basically. How can I make the lines in the DBGrid updateable?

Have you Tried setting the RequestLive propery of the TQuery to true ?

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet

Other Threads