Hello everyone.

I have successfully created a trigger for experimentation and I would like your 
help for implementing the concept behind of it.

My table pollaplasiasmos (which stands for multiplication in Greek, even though 
I used English characters to write it [Gree-glish]), takes 3 values:
        * Quantity [int]
        * amount [real(0,2)]

        * VAT [real(0,2)]I have created the triggers to make the necessary 
calculations for vat_value (per item), vat_included (item price), and 
total_price (which includes vat).

Now what I want to do is to take two tables, (let's call them temp_01 and 
temp_02) that would both have columns id and val, and I want with a trigger to 
add temp_01.val with temp_02.val and put their result in a new table named 
total.

I have tried something like this:

create trigger [after_insert_temp_01]
after insert on temp_01
begin
     update total
     set val = temp_01.val + temp_02.val
     where rowid = old.rowid;
end;

I know that this is wrong of what I am doing, because there is no way to call 
the temp_02 table using this method; this is not an inner join where I can 
compare IDs and make the necessary adjustments on my code.

I am really out of ideas and if there's a link with more information that I 
should know already about it, by all means let me know because I need to learn 
these things.

Regards,

Stefanos
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to