MySQL Forums
Forum List  »  Triggers

trigger wich select field from another DB
Posted by: Francis Goblet
Date: March 18, 2013 03:32PM

In my after update trigger,a select from another DB return table `db`.`table` doesn't exists. I am sure that the DB and tables exists !

Mysql 5.1
2 DB, DB1 & DB2

when inserting record into a table of DB1, I need a value comming from a table of DB2
so I use this code to ask for value

SET inum = (SELECT num FROM `DB2`.`t1` WHERE indexNum = localIndex);

The problem is that the "DB2.t1 doesn't exists" message.

Tried with or without Quotes is the same

The SELECT perform OK when used outside Trigger

What is the correct syntax for this command ?

Thanks for your help

Options: ReplyQuote

Written By
trigger wich select field from another DB
March 18, 2013 03:32PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.