Rajeev Rumale wrote:
> 
> 1.
> @del_list = split(",", $in{del_industry});
> foreach $id (@del_list) {
>      $id= "(industry_id='$id')";
> }
> $where = join(" or ", @del_list);
> $sql ="update industry_list set deleted='y' where ($where)";
> $dbh = DBI->connect($site{dsn});
> &displayError("Unable to delete the option.<br> $sql")
> unless($dbh->do($sql));

my $query = qq{update industry list set deleted='y' };
$query .= qq{where industry_id in (} . $in{del_industry} . qq{)};
$dbh->do($query);

this will create a query statement that says:

update industry list set deleted='y' where industry_id in
(001,002,003,004,005)

or whatever you supply to $in{del_industry}.  whenever you want to do
anything to a list of records, it's best to use in ().

Reply via email to