Well Dave, its like this ..
I am trying to write a module which can give the
functionality of a database created using arrays and hashes ..
i.e. create a virtual in memory database using arrays and hashes which could act as tables.
And then allow running simple SQL statements to process data in these arrays/hashes just like database tables.
eg. 1
If the user choses to create the database using one "two dimensional array" named sales,
I want him to be able to process the data in array sales using a simple query like ..
select 0,sum(1) from sales group by 0 order by 0
where 0 n 1 are the columns of array sales.
O/P would be an array.
This avoids the need for writing nested for loops in the calling program ..
eg. 2
user creates a database using a one "two dimensional" salary array and one "hash" parameters..
Then he could use a query like below to select all the rows
from array salary which have the salary value above a specified min salary.
select salary.* from salary,parameters where salary.1 > parameters.minsal order by salary.0
Ofcourse these are hypothetical examples and one would be
better off getting processed o/p from the database itself.
But this module which I am writing is for cases where my datasource is not database,
and I need to have the ease of processing my datastructures like database tables.
Let me know if more details are required.
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.