help pls

Marek Reichenbach reichenbach.marek at gmail.com
Wed Mar 14 13:58:16 EDT 2012


Hi Pete.
Thank you very much for the reply
I dont have to put data (no INSERT)... i meant something like thig

put "SELECT isv_laik,atv_laik,atstum,(select kaina from tarifai use index
(tarifas) where (kg_nuo<'"& sGalutine1 &"' and '"& sGalutine1 &"'<=kg_iki)
and (km_nuo<atstum and atstum<=km_iki) as dynamicCol FROM reisas where
gal='"& sResaultSave & "'ORDER BY isv_laik" into tSQL
put revDataFromQuery(tab, cr, sDatabaseID, tSQL) into tData

atstum - it must take different value ot "atstum" in every row from column
2... but in the end column 4 must show (select kaina...) , where "kaina" is
from the other table.

updated:
http://forums.runrev.com/viewtopic.php?f=12&t=11360&p=53370#p53370


On 14 March 2012 19:25, Pete <pete at mollysrevenge.com> wrote:

> Hi Marek,
> I have to admit I'm not fully understanding the requirement you described
> on the forum but if you need to have a calculated value column based on
> other columns, you can have the database do that by defining a triggers
> that will happen every time an INSERT or UPDATE is done to the table in
> question.  That way, the db does all the work for you and all you have to
> do is a simple SELECT for the calculated column.
>
> The syntax for creating a mySQL trigger is at
> http://dev.mysql.com/doc/refman/5.5/en/create-trigger.html.  It would look
> something like:
>
> CREATE TRIGGER mytrigger AFTER INSERT ON thetable FOR EACH ROW
>   UPDATE thetable SET PRICE to (NEW.Col1 * New.Col2) WHERE id=NEW.id
>
> You would also have a second trigger defined as AFTER UPDATE.
>
> With those triggers in place, just SELECT PRICE FROM theTable.
>
> Hope that helps.
>
> Pete
>
> On Wed, Mar 14, 2012 at 9:30 AM, Marek Reichenbach <
> reichenbach.marek at gmail.com> wrote:
>
> > Hi , any suggestions on this post ?
> > http://forums.runrev.com/viewtopic.php?f=12&t=11360&p=53356#p53356
> > Help please
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> >
>
>
> --
> Pete
> Molly's Revenge <http://www.mollysrevenge.com>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list