sigzero has asked for the wisdom of the Perl Monks concerning the following question:
I would like to pass a multi-level hash (which is, of course, better than multi-level marketing) to an insert statement to get some data into a Pg database.
The table is:
name date type federal active
The hash looks like:
my %holidays = ( "New Years Day" => { date => '20050101', type => 'US', federal => 'true', active => 'true', }, "Martin Luther King Day" => { date => '20050119', type => 'US', federal => 'true', active => 'true', }, "Groundhog Day" => { date => '20050202', type => 'US', federal => 'false', active => 'false', }, );
I can do simple inserts but I haven't tried anything like this before. How would I code the "insert" statement?
Humbly submitted,
Robert
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using a multi-level hash in an insert statement...
by dragonchild (Archbishop) on Apr 21, 2005 at 14:47 UTC | |
|
Re: Using a multi-level hash in an insert statement...
by sigzero (Novice) on Apr 21, 2005 at 15:25 UTC | |
|
Re: Using a multi-level hash in an insert statement...
by Transient (Hermit) on Apr 21, 2005 at 14:49 UTC | |
by davidrw (Prior) on Apr 21, 2005 at 15:07 UTC | |
by Transient (Hermit) on Apr 21, 2005 at 15:09 UTC |