Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2002
    Posts
    3

    Unanswered: Oracle and mySQL script prob;

    Can someone please help me make this SQL script from Oracle to work with mySQL ? Any help would be appreciated.

    select c.table_name child_table,
    c.column_name child_column,
    p.table_name parent_table,
    p.column_name parent_column
    from sys.all_constraints l,
    sys.all_cons_columns c,
    sys.all_cons_columns p
    where l.constraint_type = 'R'
    and l.constraint_name = c.constraint_name
    and l.r_constraint_name = p.constraint_name
    and l.owner = c.owner
    and l.r_owner = p.owner
    and c.position = p.position

  2. #2
    Join Date
    Jul 2001
    Location
    Germany
    Posts
    1
    Mysql actually does not have such repository tables like sys_*, User_* etc. and it does not support the schemaDOTtable-notion as well.... so there is no sense/way to migrate this to mysql

  3. #3
    Join Date
    Feb 2002
    Location
    Baltimore, MD
    Posts
    26
    You'll have to rewrite the script completely (as Piper suggested), but the functionality should be available. Unfortunately, I'm working on an Oracle DB at the moment and don't have access to a MySQL resource. When I free up later today, I'll see if I can put together a similar query that's MySQL-centric.

    On the other hand, I think Piper might be wrong about the notation. Unless I misunderstand the issue, I've used said notation to access one database from another as long as it's on the same box and I've got proper permissions on each. It's worked fine.

    Of course, I'm pretty new to MySQL (coming from an Oracle/SQL Server environment) so I may have misunderstood the point.
    Rob Wilkerson

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •