List:General Discussion« Previous MessageNext Message »
From:Martijn Tonies Date:December 11 2007 12:46pm
Subject:Re: trigger question...
View as plain text  
Hi Bruce,

> delimiter |
> create trigger mfgtst after insert on masterHostTBL
> 
>  for each row begin
>         set @tmp = 55;
>     insert into masterTestResultStartTBL
> set hostID = NEW.id,
>             testResultVal =  88;
> 
> /*
>         set @q = masterTestResultStartValTBL.serverStartVal;
>         set @w = masterTestResultStartValTBL.serverSepVal;
> */
> /*
> set hostID = NEW.id,
>             testResultVal =  88;
> */
> 
> /*
> (NEW.id-1)*masterTestResultStartValTBL.serverSepVal;
> */
>  end;
> 
> |
> 
> delimiter ;
> 
> ------------------------------------------
> i can't seem to figure out where/when/how to get the values
> in the masterTestResultStartValTBL to be used...
> 
> -->   set @q = masterTestResultStartValTBL.serverStartVal;
> -->   set @w = masterTestResultStartValTBL.serverSepVal;
> 
> when i import the sql... i get an invalid table in the field..

Your trigger is on table "masterHostTBL", that means if you
want to get values from table "masterTestResultStartValTBL",
you need to SELECT them from that table.

Martijn Tonies
Database Workbench - development tool for MySQL, and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
Thread
trigger question...bruce11 Dec
  • Re: trigger question...Martijn Tonies11 Dec