I think by now one of the other responses may have resolved your problem. My concern here is that your solution doesn't make much sense from a performance perspective. If I absolutely HAD to read from a file, the first thing I would probably do in your case is something like this:
use DBI; my $pathname = qq|webdb.db.db3|; my $cnstr = qq|DBI:SQLite:dbname=$pathname|; my $filename = q|afile.txt|; open(H, qq|afile.txt|) or die $!; my @lines = <H>; close(H); my $IN = '('; $IN .= join ',', map { qq|\'$_\'|} grep {chomp} @lines; $IN = 'select webpage from webpages_data WHERE id in ' . $IN . ')'; print $IN; #produces : select webpage from webpages_data WHERE id in ('koko.htm', +'koko1.htm','koko2.htm','koko3.htm')
This will reduce the number of separate calls to the database. Second, I simply do not know why in the world you would reduce the performance of your solution to reading a text file when you already have a database connection open. Just create another table with your indexes and join the two, like:
select webpage from webpages_data, mySelectedStuff WHERE webpage.id = +mySelectedStuff.id AND ...
Or a sub-select cannot have much worse performance:
select webpage from webpages_data where webpage in (select id from myS +electedStuff WHERE ...)

Celebrate Intellectual Diversity


In reply to Re: Script won't retrieve data from database by InfiniteSilence
in thread Script won't retrieve data from database by lampros21_7

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.