First, thanks for everyone's help.
Let me better explain what I am doing. I have 4 tables of data and I am trying to do joins between them without using a database.
I changed my hashes to arrays of arrays and tried to use DBI::AnyData. It seems to be having trouble getting my arrays into table format. I am getting the following error:
Can't coerce array into hash at C:/Perl/site/lib/DBD/AnyData.pm line 247.
Here is the some of the test code I am using for 1 join:
$dbh = DBI->connect('dbi:AnyData(RaiseError=>1):');
$dbh->func( 'rdbtable', 'ARRAY', @rdb, 'ad_import');
$dbh->func( 'asitable', 'ARRAY', @asi, 'ad_import');
$dbh->func( 'bomtable', 'ARRAY', @bom, 'ad_import');
$dbh->func( 'mpttable', 'ARRAY', @mpt, 'ad_import');
$rdbtable_sth = $dbh->prepare( "SELECT SIGNAL_NAME,LOCATION,X_COORDINA
+TE,Y_COORDINATE,Z_COORDINATE,COMPONENT_SIDE,ETCH_SIDE,GROUND,GROUND_L
+OCATION FROM rdbtable" );
$asitable_sth = $dbh->prepare( "SELECT SIGNAL_NAME,LOCATION,REFERENC
+E_DESIGNATOR,PIN_NUMBER,DEVICE_NAME,PACKAGE_TYPE,CS_PART_NUMBER FROM
+asitable WHERE LOCATION = ?" );
$rdbtable_sth->execute;
while (($location,$rdb_signal_name) = $rdbtable_sth->fetchrow_array) {
$asitable_sth->execute($location);
$row = $asitable_sth->fetchrow_arrayref;
$asi_signal_name = $row ? $row->[0] : '';
print "$rdb_signal_name : $asi_signal_name\n";
}
Here are the 2 tables:
rdbtable:
SIGNAL_NAME,LOCATION,X_COORDINATE,Y_COORDINATE,Z_COORDINATE,COMPONENT_SIDE,ETCH_SIDE,GROUND,GROUND_LOCATION
A_AD0,BP1.19E25,-895.0390,3277.3700,0.0000,0,1,GND,BP1.19245
A_AD0,F6_54.W4VIA,1825.0000,3975.0000,0.0000,0,1,GND,F6_54.W7VIA
A_AD1,F6_54.Y3VIA,1775.0000,3925.0000,0.0000,0,1,GND,F6_54.AB4VIA
A_AD1,BP1.18A3,-1210.0000,3513.5910,0.0000,0,1,,
A_AD2,BP1.19C25,-1052.5200,3277.3700,0.0000,0,1,GND,BP1.19254
A_AD2,F6_54.W3VIA,1825.0000,3925.0000,0.0000,0,1,GND,F6_54.AB4VIA
asitable:
SIGNAL_NAME,LOCATION,REFERENCE_DESIGNATOR,PIN_NUMBER,DEVICENAME,PACKAGE_TYPE,CS_PART_NUMBER
A_AD0,F6_54.W4VIA,F6_54,W4,XC2V4000,BGA957XBTF-XC2V4000_9B,059-000-408
A_AD1,F6_54.Y3VIA,F6_54,Y3,XC2V4000,BGA957XBTF-XC2V4000_9B,059-000-408
A_AD2,F6_54.W3VIA,F6_54,W3,XC2V4000,BGA957XBTF-XC2V4000_9B,059-000-408
A_AD3,F6_54.AA5VIA,F6_54,AA5,XC2V4000,BGA957XBTF-XC2V4000_9B,059-000-408
A_AD4,F6_54.Y5VIA,F6_54,Y5,XC2V4000,BGA957XBTF-XC2V4000_9B,059-000-408
A_AD5,F6_54.Y6VIA,F6_54,Y6,XC2V4000,BGA957XBTF-XC2V4000_9B,059-000-408
Any suggestions for fixing what I have or better ways to handle this situation would be greatly appreciated.
Thanks again,
Jim
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.