As you write your code in somewhat pseduo code format, I can't comment on the 
exact syntax. You may use PERL-DBI-DBD:MySQL to implement your code. However, 
it may some problems with your logic. First of all, if the quote_for_family 
table already exist, the create table sql do nothing and it definitely not 
something you wanted. You may use INSERT instead of CREATE in this case. You 
may experiment with other logic. If you want further help, you may email me 
your actual code.

For temporary and heap, they are two different table attributes but often use 
together. Temporary means the table will automatically drop after the 
connection close and will not appear in other connections. Heap means to 
create table in server's memory. So, they may use together to make high 
access speed temporary table.

Of course, heap table will eat your server RAM.

Best regards,


--
Yours,
KH Chiu
C&A Computer Consultants Ltd.
Tel: 3104 2070 Fax: 3010 0896
Email: [EMAIL PROTECTED]
Website: www.caconsultant.com


> Hi All,
> 
> After googling around and checking out the archives I still haven't found
> the exact answer to my following question:
> 
> First off the goal is to give a family multiple quotes from different
> companies for insurance based on several factors: age, length of coverage
> and coverage limits. All the different rates for different companies 
> will be in a rate table that I will have to query to get the correct 
> premium per person and then group the resulting recordset by company 
> and sum the premium. So I figure I have to do something like:
> 
> for each member in $number_of_family_members
> 
> CREATE TABLE IF NOT EXISTS quote_for_family TYPE=HEAP
> SELECT * FROM rates WHERE
> age >=minimum_age AND
> age <=maximum_age AND
> limit >=minimum_limit AND
> limit <=maximum_limit AND
> length_days < maximum_days
> 
> next member
> 
> SELECT company_name, sum(rate), plan_name FROM quote_for_family 
> GROUP BY company_name
> 
> DROP TABLE quote_for_family
> 
> And if all is well I have a list of all the different companies' 
> plans with a the premium totaled for all family members.
> 
> What makes this a little more interesting is that I want to do it 
> from a Perl script - from want I've seen this looks possible. What 
> I'm wondering is:
> 
> Does this look like the right way to tackle the problem?
> 
> Should I use a HEAP table or TEMPORARY table to do this? Its going 
> to be on a webserver with hopefully some steady traffic so 
> performance is a concern.
> 
> Any help is greatly appreciated,
> 
> Justin
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <mysql-unsubscribe-
[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to