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 6604911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:13:13+00:00 2026-05-25T19:13:13+00:00

here i have 3 variable in perl and i m passing those variable in

  • 0

here i have 3 variable in perl and i m passing those variable in one db.sql file in sql query line then executing that db.sql file in same perl file but it’s not fetching those variable.

$patch_name="CS2.001_PROD_TEST_37987_spyy";
$svn_url="$/S/B";
$ftp_loc="/Releases/pkumar";
open(SQL, "$sqlfile") or die("Can't open file $sqlFile for reading");
while ($sqlStatement = <SQL>) 
{
   $sth = $dbh->prepare($sqlStatement) or die qq("Can't prepare $sqlStatement");

   $sth->execute() or die ("Can't execute $sqlStatement");
}
close SQL;
$dbh->disconnect;

following is the db.sql file query

insert into branch_build_info(patch_name,branch_name,ftp_path)
values('$patch_name','$svn_url','$ftp_loc/$patch_name.tar.gz');

pls help me how can i pass the variable so that i can run more the one insert query at a time.

  • 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-25T19:13:13+00:00Added an answer on May 25, 2026 at 7:13 pm

    If you can influence the sql-file, you could use placeholders

    insert into ... values(?, ?, ?);
    

    and then supply the parameters at execution:

    my $ftp_path = "$ftp_loc/$patch_name.tar.gz";
    $sth->execute( $patch_name, $svn_url, $ftp_path) or die ...
    

    That way you would only need to prepare the statement once and can execute it as often as you want. But I’m not sure, where that sql-file comes from. It would be helpful, if you could clarify the complete workflow.

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

Sidebar

Related Questions

Just wondering what little scripts/programs people here have written that helps one with his
I want to build a bunch of Perl subrotines that all have the same
I have the contents of a web page assigned to a variable $html Here's
Since upgrading to 2008 I and many people here have noticed that randomly VS
enter code here I have a table on SQL server 2005 with bigint primary
Okay, so I'm using perl to read in a file that contains some general
I have a working perl script that grabs the data I need and displays
Sort of a fringy, non-practical question coming along here. You know that in Perl
I have a whitespace delimited file with a variable number of entries on each
I am reviewing some ClearCase triggers written in Perl. I have noticed that in

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.