Hello,
I am really baffled by this behavior. Does anyone have any idea what's
going on?
I have to get some data from a visual foxpro db. I'm using activestate
perl 5.6.1 on Windows 2000. DBI 1.14, DBD::ODBC 0.28.
As far as I can tell, the code is perfectly ordinary and
straightforward:
___________________________________
open (OUT, ">lc_dbi_log") or die
"Can't open new file: $!\n";
DBI->trace( 2 );
my $dbh = DBI->connect( 'dbi:ODBC:LawCareers',
undef,
undef , {
AutoCommit => 1
} ) or die "Whoa!: " . $DBI::errstr;
my $sth = $dbh->prepare( 'select emp_firm,emp_url
from employer,emp_vis
where (emp_id = vis_emp) and
vis_event IN ("P1", "P2") order by emp_firm');
$sth->execute();
while (my @row = $sth->fetchrow_array()) {
print OUT "@row\n";
}
______________________________________
When I run the program straight, Windows gives me an error and shuts it
down.
But when I step through it in the debugger, it works fine, except that I
get a "Signal SEGV: No such file or directory" at the end. Even so, I
seem to get the right output.
I thought maybe it had something to do with resources, but my computer's
memory, etc., do not seem to be overly taxed, and shouldn't be with this
query.
I must be totally missing something here. Anyone have any pointers for
me? The trace output (from running it without the debugger) appears
below. The column binding seems to be where the trouble begins....
Thanks,
Alan
_____________________________________________________
DBI 1.14-nothread dispatch trace level set to 2
-> DBI->connect(dbi:ODBC:LawCareers, , ****, HASH(0x1a7ef00))
-> DBI->install_driver(ODBC) for perl=5.006001 pid=1280 ruid=0
euid=0
install_driver: DBD::ODBC loaded (version 0.28)
<- install_driver= DBI::dr=HASH(0x1ba9f20)
-> default_user in DBD::_::dr for DBD::ODBC::dr
(DBI::dr=HASH(0x1ba9f20)~0x1
d0b11c undef undef HASH(0x1a75380))
<- default_user= ( undef undef ) [2 items] at DBI.pm line 405.
-> connect for DBD::ODBC::dr (DBI::dr=HASH(0x1ba9f20)~0x1d0b11c
'LawCareers'
undef **** HASH(0x1a75380))
Driver connect 'LawCareers', '', ''
SQLConnect 'LawCareers', '', ''
<- connect= DBI::db=HASH(0x1d0b0c8) at DBI.pm line 408.
-> STORE for DBD::ODBC::db (DBI::db=HASH(0x1d0b104)~INNER
'PrintError' 1)
<- STORE= 1 at DBI.pm line 433.
-> STORE for DBD::ODBC::db (DBI::db=HASH(0x1d0b104)~INNER
'AutoCommit' 1)
<- STORE= 1 at DBI.pm line 433.
<- connect= DBI::db=HASH(0x1d0b0c8)
-> prepare for DBD::ODBC::db (DBI::db=HASH(0x1d0b0c8)~0x1d0b104
'select emp_
firm,emp_url
from employer,emp_vis
where (emp_id = vis_emp) and
vis_event IN ("P1", "P2") order by
emp_firm')
dbd_st_prepare'd sql f30611576
select emp_firm,emp_url
from employer,emp_vis
where (emp_id = vis_emp) and
vis_event IN ("P1", "P2") order by
emp_firm
<- prepare= DBI::st=HASH(0x1d0a1f4) at lc_dbi.pl line 17.
-> execute for DBD::ODBC::st (DBI::st=HASH(0x1d0a1f4)~0x1a7efd8)
dbd_st_execute (for sql f30611576 after)...
dbd_describe sql 30611576: num_fields=2
col 1: CHAR len=200 disp=201, prec=200 scale=0
col 2: CHAR len= 80 disp= 81, prec= 80 scale=0
col 1: '' sqltype=CHAR, ctype=(unknown CType 0), maxlen=0
describe/SQLBindCol error -1 recorded: (DBD: describe/SQLBindCol err=-1)
!! ERROR: -1 '(DBD: describe/SQLBindCol err=-1)'
<- execute= undef at lc_dbi.pl line 22.
DBD::ODBC::st execute failed: (DBD: describe/SQLBindCol err=-1) at
lc_dbi.pl lin
e 22.
-> fetchrow_array for DBD::ODBC::st
(DBI::st=HASH(0x1d0a1f4)~0x1a7efd8)
no select statement currently executing error -1 recorded: (DBD: no
select state
ment currently executing err=-1)
!! ERROR: -1 '(DBD: no select statement currently executing err=-1)'
<- fetchrow_array= ( ) [0 items] at lc_dbi.pl line 24.
DBD::ODBC::st fetchrow_array failed: (DBD: no select statement currently
executi
ng err=-1) at lc_dbi.pl line 24.
-> DESTROY for DBD::ODBC::st (DBI::st=HASH(0x1a7efd8)~INNER)