LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-21-2003, 11:35 PM   #1
The Jesus
Member
 
Registered: Mar 2002
Location: Cleveland, Ohio
Distribution: Ubuntu, Gentoo, Fedora Core 5, FreeBSD
Posts: 50

Rep: Reputation: 15
Perl Sqlite DBI $sth->rows


I am trying to run a query on a sqlite database in Perl. After I am through with the query I would like to check the rows. The problem I am having is that $query_handle->rows always returns -1

my $query_handle = $dbh->prepare('SELECT name FROM patient_data WHERE name = ?')
or die "Couldn't prepare statement: " . $dbh->errstr;


if ($query_handle->rows == 0) {
#DO Something
}

What am I doing wrong??? - I am assuming that if the query does not find a name $query_handle->rows would equal 0? I get -1.

Thanks in advance.


 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Perl DBI question GoTrolling Linux - Newbie 1 03-21-2007 04:31 AM
Mysql reading via Perl DBI ivanatora Programming 2 03-21-2007 04:03 AM
Perl - DBI PG Installation Problems TheMeteorPolice Linux - Software 2 11-23-2005 10:53 AM
perl | DBI->connect | RHEL AS 3 kaN5300 Linux - Enterprise 6 09-14-2004 08:15 AM
perl DBI prepare question mrtwice Programming 1 10-30-2003 02:12 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration