Re: Multi-Table Insert Strategy
Selon Don Parris [EMAIL PROTECTED]: O.k., this question is more about the best way to run a multi-table insert on a MySQL DB (4.0.18), given a console based interface (Python 2.3.x under SUSE Linux 9.2). My guess is that this would be a bit easier with a GUI, where I would have widgets to assign to various functions. However, I am currently building a console app. The GUI will come later. When I add a person to the DB, the main table impacted is called 'person'. However, a few other tables are affected as well - entity, address, affiliation, and aux_mbr. For example, the person table uses the keys from the others: person.affil_id = affil.affil_id, person.ent_id = entity.ent_id, etc. Somehow, the program will need to get the foreign keys from the other tables, and insert that into the person table. Technically, the program won't be very likely to know what the current primary_key is for each table. The 2 options I see so far are: (1) run insert queries on each table, ignoring the foreign key fields, and then running an update query on person to add the foreign keys from the respective tables: insert into person values (PK, 'blah', 'blab') insert into entity values (PK, 'bleep', 'blip') update person set ent_id=1 where person_id=1 #'1' should be a variable (2) run a query when the input form is launched to determine the current max value of the foreign keys, then use that info to automatically add the foreign keys into the person table: select entity_id MAX from entity ### run Python input form, ent_id is passed to the appropriate input statement ### insert into person tuple #(PK, ent_id, 'blah', 'blab') The commands here aren't intended to be precise, but rather to help paint the picture. A link to a previous thread or documentation on this would be fine. I don't mind doing the reading - but my Google search seems to turn up more info about multi-table deletes than inserts. I realize that MySQL doesn't support a single multi-table insert function, but are the two approaches I see good, bad, common?? Thanks, Don -- evangelinuxGNU Evangelist http://matheteuo.org/ http://chaddb.sourceforge.net/ Free software is like God's love - you can share it with anyone anytime anywhere. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] Hi, here are some links : http://www.php-resource.de/forum/showthread/t-54709.html http://dev.mysql.com/doc/mysql/en/insert.html http://bugs.mysql.com/bug.php?id=8732 http://bugs.mysql.com/bug.php?id=1980 http://archives.neohapsis.com/archives/mysql/2004-q3/3604.html http://forums.devshed.com/archive/t-51965/Insert-Into http://lists.nyphp.org/pipermail/talk/2003-September/005768.html http://dev.mysql.com/doc/mysql/en/innodb-multi-versioning.html http://www.issociate.de/board/post/26176/Ref:_WCL302_Subject:_UPDATE_multi-table_current_column_value_error.html Hope that helps :o) Mathias -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Help needed regarding MySQL-C Libraries on Linux....
Dear Friends, I'm Ashok here. first i'll tell my sys configuration. 1.Redhat-Linux 9 2.Intel Pentium chipset 3.MySQL 4.1 with Development Libraries For this i've downloaded the MySQL4.1 under the specification Linux x86 RPM downloads from the site. In my system, the MySQL Server is working well. I tried to run the C program that will make the connection to the MySQL database and create the user database and useracc table. It's finely working with Windows-VC++. But when i'm trying to run with Linux gcc, I'm getting lots of errors. I don't know what's the problem. I've attached the C-Pgm and the Error info. Pls, help me regarding this. Thanks and Regards, Ashok. Yahoo! Sports Rekindle the Rivalries. Sign up for Fantasy Football http://football.fantasysports.yahoo.com[EMAIL PROTECTED] CGI]# gcc -c -I/usr/lib/bcc/include -I/usr/include/mysql user.c In file included from /usr/include/pthread.h:20, from /usr/include/mysql/my_global.h:149, from user.c:3: /usr/include/sched.h:41: parse error before __THROW /usr/include/sched.h:44: parse error before __THROW /usr/include/sched.h:48: parse error before __THROW /usr/include/sched.h:51: parse error before __THROW /usr/include/sched.h:54: parse error before __THROW /usr/include/sched.h:57: parse error before __THROW /usr/include/sched.h:60: parse error before __THROW /usr/include/sched.h:63: parse error before __THROW In file included from /usr/include/mysql/my_global.h:149, from user.c:3: /usr/include/pthread.h:166: parse error before __THROW /usr/include/pthread.h:169: parse error before __THROW /usr/include/pthread.h:172: parse error before __THROW /usr/include/pthread.h:176: parse error before __THROW /usr/include/pthread.h:181: parse error before __THROW /usr/include/pthread.h:187: parse error before __THROW /usr/include/pthread.h:195: parse error before __THROW /usr/include/pthread.h:198: parse error before __THROW /usr/include/pthread.h:202: parse error before __THROW /usr/include/pthread.h:206: parse error before __THROW /usr/include/pthread.h:211: parse error before __THROW /usr/include/pthread.h:217: parse error before __THROW /usr/include/pthread.h:221: parse error before __THROW /usr/include/pthread.h:226: parse error before __THROW /usr/include/pthread.h:230: parse error before __THROW /usr/include/pthread.h:235: parse error before __THROW /usr/include/pthread.h:239: parse error before __THROW /usr/include/pthread.h:243: parse error before __THROW /usr/include/pthread.h:261: parse error before __THROW /usr/include/pthread.h:266: parse error before __THROW /usr/include/pthread.h:285: parse error before __THROW /usr/include/pthread.h:290: parse error before __THROW /usr/include/pthread.h:303: parse error before __THROW /usr/include/pthread.h:309: parse error before __THROW /usr/include/pthread.h:333: parse error before __THROW /usr/include/pthread.h:336: parse error before __THROW /usr/include/pthread.h:339: parse error before __THROW /usr/include/pthread.h:342: parse error before __THROW /usr/include/pthread.h:352: parse error before __THROW /usr/include/pthread.h:359: parse error before __THROW /usr/include/pthread.h:362: parse error before __THROW /usr/include/pthread.h:367: parse error before __THROW /usr/include/pthread.h:371: parse error before __THROW /usr/include/pthread.h:392: parse error before __THROW /usr/include/pthread.h:395: parse error before __THROW /usr/include/pthread.h:398: parse error before __THROW /usr/include/pthread.h:401: parse error before __THROW /usr/include/pthread.h:406: parse error before __THROW /usr/include/pthread.h:415: parse error before __THROW /usr/include/pthread.h:420: parse error before __THROW /usr/include/pthread.h:423: parse error before __THROW /usr/include/pthread.h:428: parse error before __THROW /usr/include/pthread.h:432: parse error before __THROW /usr/include/pthread.h:557: parse error before __THROW /usr/include/pthread.h:560: parse error before __THROW /usr/include/pthread.h:564: parse error before __THROW /usr/include/pthread.h:567: parse error before __THROW /usr/include/pthread.h:577: parse error before __THROW /usr/include/pthread.h:584: parse error before __THROW /usr/include/pthread.h:588: parse error before __THROW /usr/include/pthread.h:591: parse error before __THROW /usr/include/pthread.h:596: parse error before __THROW /usr/include/pthread.h:612: parse error before __THROW /usr/include/pthread.h:621: parse error before __THROW In file included from /usr/include/pthread.h:655, from /usr/include/mysql/my_global.h:149, from user.c:3: /usr/include/bits/sigthread.h:32: parse error before '*' token /usr/include/bits/sigthread.h:36: parse error before __THROW In file included from /usr/include/mysql/my_global.h:149, from user.c:3: /usr/include/pthread.h:673: parse error before __THROW /usr/include/pthread.h:678:
Post-Installation Procedures for Slackware
Hello All: I am most familiar with mysql thru RH 9.0 and win XP. I have set up a slackware partition (ver 10.0) with mysql ver 4.0.20. Are there any special instructions for Post-Installation Procedures? thanks tim -- Tim Johnson [EMAIL PROTECTED] http://www.alaska-internet-solutions.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: looking for a pure startup opportunity..
i've read way too many articles about the 3 kids/guys/etc... who managed to get $10 million in funding for esentially a basic idea, but they had/have traffic/eyeballs!!! Welcome to 1999. Blind reliance on Traffic and Eyeballs as a business plan was what (in part) caused the great runups in valuations that preceded the Internet crash. What counts, and what draws the venture capital is a well thought out business plan based on traditional and well proven business models (i.e. selling stuff with a healthy margin, offering in-demand services, etc). And even if you could get 10 million in funding, you think you and your partner get to walk away with 5 million each? That's not how it works. They invest that money into the COMPANY, and expect YOU to turn 10 million into at least 50 million. They also OWN YOU during that time - it's no cakewalk - just ask any VC funded startup what they think of having VC investors. Getting funding is only the first step in a very long road to eventually selling out, IF you're able to grow the company 5x or more. so, if you're looking at your shrinking retirement going to iraq That statement makes no sense whatsoever. but with the right combination of web development skills (perl/php/c/apache/linux/mysql/html/css) we can do some damage. there are numerous opportunities for the right 3-5 person team! For a serious business, it takes alot more than just raw development skills... like marketing, sales, management, finance, etc. I've read too many stories of smart guys who created amazing cutting-edge technology (i.e. Apple), only to lose it all because they had no idea how to correctly market or sell it. Anyway, this has little to do with mysql (,query). -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Help needed regarding MySQL-C Libraries on Linux....
The same source that you compiled under VC++ may not work at all under linux. Especially since the header files will be different. Make sure you have the proper header files for linux installed. Also I did not see any linking flags during compilation. On 7/3/05, Ashok Kumar [EMAIL PROTECTED] wrote: Dear Friends, I'm Ashok here. first i'll tell my sys configuration. 1.Redhat-Linux 9 2.Intel Pentium chipset 3.MySQL 4.1 with Development Libraries For this i've downloaded the MySQL4.1 under the specification Linux x86 RPM downloads from the site. In my system, the MySQL Server is working well. I tried to run the C program that will make the connection to the MySQL database and create the user database and useracc table. It's finely working with Windows-VC++. But when i'm trying to run with Linux gcc, I'm getting lots of errors. I don't know what's the problem. I've attached the C-Pgm and the Error info. Pls, help me regarding this. Thanks and Regards, Ashok. Yahoo! Sports Rekindle the Rivalries. Sign up for Fantasy Football http://football.fantasysports.yahoo.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]