in reply to Re: Can SQL be used without a database?
in thread Can SQL be used without a database?
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Can SQL be used without a database?
by thegoaltender (Sexton) on Dec 31, 2003 at 17:11 UTC |