Views/Triggers or equivalent
Posted on 2002-03-15
My question boils down to this: Does MySQL (or any additional package to MySQL) support views and triggers/rules? If not (which I don't think it does) then what is the best way to work around not having views and triggers?
My situation is this: I have created a database to contain information about network topology: hosts, subnets, interfaces, gateways, software running on each machine, etc. I am trying to use NetViz, a pretty cool commercial data viewing package, to access my database directly via ODBC in order to print out nice network pictures of the data in the database, as well as allowing the user to edit the data through NetViz. One of the biggest problems that I am running into with NetViz, though, is that it doesn't support many-to-many mappings. In my case, I have a table full of Software information (vendor, license type/key, version, etc.) and a table full of host information (hostname, type of machine, etc) and a mapping table to associate software with host in a many-to-many style mapping. Anyway, since NetViz doesn't support this sort of mapping, I had previously (in Postgres) created a view which simply joined the mapping table and the software table to produce a many-to-one mapping, which is exactly what Netviz wants. I then had to define rules (similar to triggers, Postgres specific, I think) to allow the view to be "writable" via NetViz.
Again, how/can I get this kind of functionality in MySQL? I could normally code around it, but this is a case of an external program accessing the DB directly through ODBC, so I don't know how to put any sort of code between that.
I have recently been forced to switch to MySQL from Postgres, and so far have been having success, except for this one issue. Any help would be greatly appreciated.