DIVX5 Posted May 4, 2006 Report Share Posted May 4, 2006 Palidziet ludzu! Kas ir par problemu, ka man neizdodas izveidot triggeri mysql. Rakstu query: CREATE TRIGGER izmaksas BEFORE INSERT ON finanses FOR EACH ROW BEGIN UPDATE KAMAND_INFO SET IZMAKSAS = NEW.ID WHERE id = NEW.USER_ID; END ; ---------------------------------------------------- Sanemu atpakal : SQL vaicājums : CREATE TRIGGER izmaksas BEFORE INSERT ON finanses FOR EACH ROW BEGIN UPDATE KAMAND_INFO SET IZMAKSAS = NEW.ID WHERE id = NEW.USER_ID MySQL teica: #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRIGGER izmaksas BEFORE INSERT ON finanses FOR EACH ROW BE -------------------------------------------------------------- Ir divas tabulas : finanses(id int ,user_id int ,utt) komand_info(id int ,izmaksas int, utt) Kad tiek ierakstits ieraksts tabula "finanses", nepieciesams veikt UPDATE "komand_info" tabulas laukam "izmaksas", kur šim laukam jāsaņem "finanses" tabulas "id" lauka vērtība WHERE "finanses" tabulas lauiks "user_ir" = "id" lauku no "komand_info" tabulas. Link to comment Share on other sites More sharing options...
v3rb0 Posted May 5, 2006 Report Share Posted May 5, 2006 begin ir, end nau! Link to comment Share on other sites More sharing options...
DIVX5 Posted May 5, 2006 Author Report Share Posted May 5, 2006 Jā - bet nah tas PHPMYADMIN toolis izvaro manu query? Link to comment Share on other sites More sharing options...
Delfins Posted May 5, 2006 Report Share Posted May 5, 2006 nah tu lieto phpmyadmin? Link to comment Share on other sites More sharing options...
DIVX5 Posted May 5, 2006 Author Report Share Posted May 5, 2006 Es pameģināju arī bez myadmina, nekas nemainās. Arī bez Begin end Mosh probas ar mysql 4.0.15 ??? Link to comment Share on other sites More sharing options...
KAC Posted May 5, 2006 Report Share Posted May 5, 2006 tu paskatiijies, no kuras versijas mysqlam ir trigeri? Link to comment Share on other sites More sharing options...
DIVX5 Posted May 5, 2006 Author Report Share Posted May 5, 2006 Man ir aizdommas, ka tie sākās tikai no 5.0! Ehh - labāk tās vērtības ierakstīšu ar PHP koda palīdzību - tas nepiekāsīs =] Link to comment Share on other sites More sharing options...
Delfins Posted May 5, 2006 Report Share Posted May 5, 2006 Mjā, un vēl smaida... būtu labāk nokaunējies... Link to comment Share on other sites More sharing options...
Recommended Posts