CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: DBI:
HOw to load a small database table into a hash in perl

 



jamshaidali
New User

Dec 29, 2009, 12:52 AM

Post #1 of 2 (6058 views)
HOw to load a small database table into a hash in perl Can't Post

I have a database table with 8 colums.I selected row using two colums(primary key based on two colums).I know how to query database using dbi.Now i want load the table in hash.Table is small with only 700 rows.I want very fast searching this is why i intend to use hash.

Okay i know hash has key value pairs.Can key be composed of two colums.Or we will have to use hashs of hashes ????????i am not sure ...if u can share sample code that would be a big help


FishMonger
Veteran / Moderator

Dec 29, 2009, 6:30 AM

Post #2 of 2 (6053 views)
Re: [jamshaidali] HOw to load a small database table into a hash in perl [In reply to] Can't Post

See:
http://search.cpan.org/~timb/DBI-1.609/DBI.pm#fetchrow_hashref
http://search.cpan.org/~timb/DBI-1.609/DBI.pm#fetchall_hashref

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives