3dbc has asked for the wisdom of the Perl Monks concerning the following question:
$sql1 = “select * from table1”; $sql2 = “select * from table2”; my $table1= $dbh->selectall_hashref($sql1, "primary_key"); my $table2= $dbh->selectall_hashref($sql2, "primary_key"); foreach (keys(%$table1)) { $table1_foreign_key = $table2->{$table1->{$_}{foreign_key}}{primary_key}; }
update2foreach $tbl1_primary (keys(%$table1)) { foreach (keys(%$table3)) { while ( $table3->{$_}{$table1->{$tbl1_primary}{foreign_key}} == $table3->{$_}{foreign_key} ) { $table1_foreign_key_table3 = $table3->{$_}{$table1->{$tbl1_primary}{foreign_key}}; } } }
$sql_obfuscate = qq { SELECT * FROM clinvest.dbf a, clinvpmt.dbf b, clinvchg.dbf c, ernames.dbf d, ercontct.dbf e WHERE a.CID = b.INVESTID and a.CID = c.INVESTID and a.NAMEID = d.NAMEID and a.NAMEID = e.NAMEID };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: associating subkeys of separate HoH's
by Steve_p (Priest) on Apr 09, 2004 at 20:25 UTC | |
by 3dbc (Monk) on Apr 15, 2004 at 18:58 UTC | |
by EdwardG (Vicar) on Apr 15, 2004 at 19:15 UTC | |
|
Re: associating subkeys of separate HoH's
by sgifford (Prior) on Apr 09, 2004 at 20:16 UTC |