in reply to Re: Re: Stringified hash
in thread Stringified hash

This way worked out nicely for me. I guess I immediately thought of hash when an array would do. I'm not too worried about security. There is no interface, I'm processing files and loading them into a dB and I'm using ODBC. Thanks for the hand.
use strict; use warnings; my @array = ( "A = 'a'", "B = 'b'", "C = 'c'", "D = 'd'", "E = 'e'", "F = 'f'" ); print "@array\n"; my $query = 'SELECT row_id FROM Table WHERE '.join(' AND ', @array); print "\n\n$query\n";

Replies are listed 'Best First'.
Re: Re: Re: Re: Stringified hash
by dragonchild (Archbishop) on Apr 12, 2004 at 16:56 UTC
    You just lost the whole point of my rewrite. The idea was to use placeholders, which ODBC supports, and allow the driver to do the quoting for you.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose