Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 529341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:04:54+00:00 2026-05-13T09:04:54+00:00

Seems that it may not be possible, but hey I might as well ask,

  • 0

Seems that it may not be possible, but hey I might as well ask, I could be wrong. Was wondering if there’s anyway for perl to update multiple rows using one MySQL call, I’m using DBI.

Any help or feedback would be greatly appreciated, this is possible in MSSQL through ASP and ASP.net so was wondering if also possible through perl on MySQL.

Thank you for your feedback!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T09:04:55+00:00Added an answer on May 13, 2026 at 9:04 am

    First and most important, you absolutely should not interpolate variables directly into your SQL strings. That leaves open the possibility of SQL injection attacks. Even if those variables don’t come from user input, it leaves open the possibility of dangerous bugs that can screw up your data.

    The MySQL DBD driver does support multiple statements, though it’s turned off by default as a safety feature. See mysql_multi_statements under the Class Methods section in the DBD::mysql documentation.

    But a much better solution, which solves both problems at once and is more portable, is to use prepared statements and placeholder values.

    my $sth = $dbh->prepare("UPDATE LOW_PRIORITY TableName SET E1=?,F1=? WHERE X=?");
    

    Then, get your data in a loop of some sort:

    while( $whatever) { 
        my ( $EC, $MR, $EM ) = get_the_data();
        $sth->execute( $EC, $MR, $EM );
    }
    

    You only need to prepare the statement once, and the placeholder values are replaced (and guaranteed to be properly quoted) by the DBD driver.

    Read more about placeholders in the DBI docs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There may not be any real world use for this but i was wondering
This may seem a trivial question, but it's one that's bothered me a lot
Seems that This will be an easy question for you but this problem is
It seems that it is not advisable to use <meta http-equiv=REFRESH CONTENT=3;url=url> for redirects
It seems that there is a implementation of rope in my /usr/include/c++/4.5.1/ext/rope (and ropeimpl.h
I'm probably going about this all wrong, but hey. I am rendering a large
Based on my research, it seems that what I want to do is not
It seems that CListCtrl doesn't send mouse up events unless there is a double
This may be a more math focused question, but wanted to ask here because
This question may not relate specifically to Azure Virtual Machines, but I'm hoping maybe

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.