homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

Perl/MySql Multiple Insert Question

Msg#: 4418241 posted 3:56 am on Feb 16, 2012 (gmt 0)

Hi, I have a question as to how perl processes scripts. When a script is activated by a user, say by submitting a form does the script have to finish processing before another request can begin? The reason I ask this is has to do with mysql insert statements.

If a perl script involves multiple mysql inserts and one of the columns has a auto increment it seems as though some type of havoc could be wreaked if more than one request were being processed at any given time. What I mean is if there are more than one table with auto increment involved and more than one script were being processed couldn't a table end up with a number that does not match the number in an adjacent table. If this is possible problem is there a work around? The question came to me when I found out that multiple table inserts are not possible with one insert statement. Although this is not the mysql forum this does have something to do with the way input is inserted by perl. Or....am I over reacting over something that is really no cause for alarm?

I can only hope I'm being clear enough with this question and will try to re-word it if necessary.



WebmasterWorld Administrator phranque us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

Msg#: 4418241 posted 7:31 am on Feb 16, 2012 (gmt 0)

welcome to WebmasterWorld, rugrat!

in most cases the issues you are pondering are handled by the db server.
you should probably read the mysql reference sections on table locking and concurrent inserts.
MySQL 5.0 Reference Manual :: 7.7 Locking Issues:
http://dev.mysql.com/doc/refman/5.0/en/locking-issues.html [dev.mysql.com]

also from your description it sounds like you are relying on related rows in separate tables having the same primary index values.
if this is your intent you probably want to use something like a foreign key to cross-reference between tables.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved