I am currently migrating my DB and associated apps to MySQL from Postgres,
and I am running into a couple of limitations that I couldn't figure out
how to work around from the docs, mostly stemming from sequences, views,
and triggers.  I am currently using the "stock" RH7.1 MySQL 3.23.36,
please let me know if there are better solutions in 4.0.

1. Is there any way to create a "global" auto_increment variable?  In 
Postgres, I would have done this by creating a global sequence:

CREATE SEQUENCE global_id_seq;

and then defaulted the primary keys to the next value of the sequence:

CREATE TABLE onetable (
        onetable_id     INT PRIMARY KEY DEFAULT nextval('global_id_seq')
);

I know that this is not necessarily the "correct" way to do things, but I
am using an outside app which is stupid enough to need this, and I can't
change the app.

2. I know that MySQL does not yet have views, but I was wondering if there 
was
a way to work around this in the DB.  That same stupid application
(NetViz)  connects to the DB through ODBC and graphically displays the
data in the DB, in my case, a network topology.  I have a table full of
hosts and their associated information (name, ip, OS, etc.), a table full
of all the different types of software that can be running in the network
with its associated info (vendor, version, serial, etc.), and a mapping
table to create a joint primary key out of the two foriegn keys from the
software and hosts tables to show what host is running what software.  My
problem is that NetViz does not support many-to-many heirarchy mappings,
and I have (in Postgres) created a view which pretty much just joins the
map table and the software table to form a many-to-one mapping, which
NetViz uses just fine.  I then used rules (Postgres specific, I think,
similar to triggers) to make the view "writable" by NetViz.

Thanks
-Mike


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to