Yes.. I need the help in this.. question is pretty clear or not ?? This code is not working at all:
sub 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"; } } }
database_update.txt having
[Subscriber] Id=101 Account_balance=2000000
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

In reply to Re^8: Using perl to parse a file and update values into a database by bhushanQA
in thread Using perl to parse a file and update values into a database by bhushanQA

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.