I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2008-03-26 11:29:46-07 by sparkie
Script hangs when I add WHERE clause to SQL. Not understanding 'Prepare'?
Hi all. New to Perl and new to DBI, though not new to scripting and databases in general.
My script hangs when I try to add a WHERE clause to the SQL. This code works fine
my $sql; $sql = "SELECT * FROM images order by file_number limit 20"; $dbh = DBI->connect($dsn, $user, $password) or die ($DBI::errstr); $sth = $dbh->prepare($sql) or die $DBI::errstr; $dbh->{RaiseError} = 1; $rv = $sth->execute;

If I put a where in the SQL, the script hangs indefinitely.
my $sql; $sql = "SELECT * FROM images WHERE file_number = 1000002"; $dbh = DBI->connect($dsn, $user, $password) or die ($DBI::errstr); $sth = $dbh->prepare($sql) or die $DBI::errstr; $dbh->{RaiseError} = 1; $rv = $sth->execute;

Not sure what's going on. Can I not pass an actual value into the prepare statement? Do I have to use a placeholder? Any light shed appreciated .... as the gardener said ;-)
Mark
Direct Responses: 7463 | Write a response
Posted on 2008-03-26 11:51:27-07 by sparkie in response to 7462
Re: Script hangs when I add WHERE clause to SQL. Not understanding 'Prepare'?
Sorry - forgot to mention - Vista SP1, MySQL 5 (latest), Perl latest.
Mark
Direct Responses: 9327 | Write a response
Posted on 2008-11-16 02:21:08-08 by alexinfanzon in response to 7463
Re: Script hangs when I add WHERE clause to SQL. Not understanding 'Prepare'?
I am running into the same problem, how did you resolved it? Cheers
Direct Responses: Write a response