views:

29

answers:

1

Hi there! My application needs two sets of data, and I want to separate it logically on two parts. It's ideal to have namespaces for tables in one instance of mysql database, but I can't find any clues that this feature exists. So, I decided to split data onto two schemas (static & dynamic) in one instance of mysql. Though, my dynamic data depends on static part, and some of my stored procedures in dynamic selects data from static database.

What is the best practices to avoid hardcoding schema names in stored procedures, or splitting data in similar way I want?

A: 

This is often done with Synonyms, but MySQL does not support that. You didn't say exactly why you wanted to 'logically separate' the data; this could be done by just prefixing the table names with some sort of identifier. To avoid the hassle of hard-coding schema names I suggest rethinking separating the tables.