This seems like an ideal use for BIT() type fields; assuming none of your multi-value fields can have more than 64 possibilities.
Then in your program, you define constants for each of the bits in each of the fields:
use enum qw[ BITMASK:Usage_ cider juicer cooking eating display_and_th
+row_away ];
use enum qw[ BITMASK:Flowers_ spring summer autumn winter ];
use enum qw[ BITMASK:Ripe_ spring summer autumn winter ];
use constant Any => -1;
...
my $sth = prepare( 'select id from trees where usage = ? and flowers =
+ ? and ripe = ?;' );
$sth->execute( Usage_cider|Usage_juicer, Flowers_spring|Flowers_summer
+, Any );
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.