From: Warren Young Date: December 3 2008 7:03pm Subject: Re: Using macros to compose SSQLS structures. List-Archive: http://lists.mysql.com/plusplus/8224 Message-Id: <4936D7EC.4080803@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Ryan W. Frenz wrote: > I can't make this work under MSVC 2005 (not enough actual parameters > for macro 'sql_create_2'). I'm sure there some macro-related reason > that this can't work. Or maybe not? GCC 4.1 rejects it, too, so it's probably illegal, not just a limitation of VC++ 2005. I question how well this is going to work with MySQL to begin with, since it isn't an OODB. You could have a separate table per subtype, but then it's impossible to keep the keys synchronized among the subtype tables, so joins are impossible. You could have a table for the base class and tables for all of the subtypes declaring only the additional data members, but populating SSQLSes from multiple tables ranges from tricky to impossible, depending on which SSQLS feature we're talking about. Unless you've discovered a better method, or are willing to put up with these limitations, I'd give up on trying to arm-twist MySQL into becoming an OODB. If I had to have multiple C++ types, I'd probably just define a single table that has a superset of columns for all the subtypes, declare one SSQLS for that, then define a static factory method on the base class that knows how to make subtypes from the SSQLS based on the contents of the row: Base* Base::Create(const MySsqlsType& ssqls) ...