Home » Developer & Programmer » Forms » update block based "from clause query"
update block based "from clause query" [message #542172] Sun, 05 February 2012 11:33 Go to next message
salrmmms
Messages: 7
Registered: February 2012
Location: algeria
Junior Member
i have a block based on "from clause query" but i do not know how to use transactionnel triggers to update this block
can any one help me ?
Re: update block based "from clause query" [message #542184 is a reply to message #542172] Sun, 05 February 2012 12:48 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As far as I can tell, blocks based on FROM clause query can only be queried (i.e. you can't update them, insert into these blocks nor delete records) because you'd UPDATE (SELECT <column list> FROM <some tables> WHERE ...) which doesn't make much sense.

Perhaps you could create a view based on that FROM clause, and then update underlying table(s) through an INSTEAD OF trigger.

Here's some reading about What do you base your block on?; I found it interesting.
Re: update block based "from clause query" [message #542187 is a reply to message #542184] Sun, 05 February 2012 13:49 Go to previous messageGo to next message
salrmmms
Messages: 7
Registered: February 2012
Location: algeria
Junior Member
thanks for replaying
the block based on view or on form clause query can be updated ... NOT DIRECTLY ,
you can use transactionel triggers like
on insert on update on delete
this triggers update the ORIGINAL tables and when you execute query the update done can be seen in the view
this is the idea but how to do this i do no know
Re: update block based "from clause query" [message #542188 is a reply to message #542187] Sun, 05 February 2012 13:51 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Well, did you try to put INSERT INTO ... statement into ON-INSERT trigger, UPDATE ... into ON-UPDATE and DELETE FROM ... into ON-DELETE?
Re: update block based "from clause query" [message #542189 is a reply to message #542188] Sun, 05 February 2012 13:58 Go to previous messageGo to next message
salrmmms
Messages: 7
Registered: February 2012
Location: algeria
Junior Member
yes i can do it by create a timer (1 milisocond) and create a trigger when timer exepired do "INSERT INTO ... statement into ON-INSERT trigger, UPDATE ... into ON-UPDATE and DELETE FROM"
Re: update block based "from clause query" [message #542193 is a reply to message #542189] Sun, 05 February 2012 14:19 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Do you really need a timer?

I don't know, it was just the other day when we have had some discussion about ON-INSERT trigger. I'd say that COMMIT (or, if deleting a record, <delete record> toolbar button (or KEY-DELREC key or DELETE_RECORD built-in)) would execute corresponding ON- triggers. Wouldn't it?
Re: update block based "from clause query" [message #542195 is a reply to message #542193] Sun, 05 February 2012 14:27 Go to previous messageGo to next message
salrmmms
Messages: 7
Registered: February 2012
Location: algeria
Junior Member
the timer is a solution of the probem of restreint procedure like (go_block) .. etc
Re: update block based "from clause query" [message #542258 is a reply to message #542195] Mon, 06 February 2012 03:05 Go to previous message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
Why do you need go_block?
Previous Topic: save button
Next Topic: how to base a block on left join
Goto Forum:
  


Current Time: Thu Sep 12 23:35:23 CDT 2024