in reply to Re^7: Using perl to parse a file and update values into a database
in thread Using perl to parse a file and update values into a database
database_update.txt havingsub read_initial_data { my $config = Config::Tiny->read('/home/database_update.txt'); foreach my $section (sort keys %$config) { print "[$section]\n"; foreach my $parameter ( keys %{$config->{$section}}) { $parameter = $config->{$section}->{$parameter} +; my $sth = $dbh->prepare(qq{update $section set + Account_balance=20000 where Id = 101}); $sth->execute(); $sth->finish(); print"$parameter\n"; } } }
Here I am hard coding the 'set' and 'where' parameters... I don't want to hard code those thing.. I have used '?' its is not working.. please help me on this[Subscriber] Id=101 Account_balance=2000000
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: Using perl to parse a file and update values into a database
by marto (Cardinal) on Jul 14, 2015 at 09:56 UTC | |
|
Re^9: Using perl to parse a file and update values into a database
by poj (Abbot) on Jul 14, 2015 at 16:47 UTC |