If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Perl and the DBI > When do we receive 0E0

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-23-10, 03:17
bchanan bchanan is offline
Registered User
 
Join Date: Dec 2009
Posts: 27
When do we receive 0E0

Hello All,

I am trying to figure out, the value received when doing: do / selectall_hashref, selectall_arrayref...

N - number of effected rows
0 - no record was effected
undef - ?
0E0 - ?

thanks
Chanan
Reply With Quote
  #2 (permalink)  
Old 11-23-10, 18:23
spacebar spacebar is offline
Registered User
 
Join Date: Feb 2006
Posts: 73
You can just loop through the results, printing and/or counting them.

This is an example using
'selectall_hashref':
Code:
$sth = $dbh->prepare('SELECT * FROM exmpl_tbl');
$results = $dbh->selectall_hashref('SELECT * FROM exmpl_tbl', 'id');
foreach my $id (keys %$results) {
  print "Value of ID $id is $results->{$id}->{val}\n";
}

This is different example using 'selectall_arrayref':
Code:
my $sql_stmnt = "SELECT * FROM emp WHERE emp_id = ?";
my $emps = $dbh->selectall_arrayref($sql_stmnt, undef, '1234');

foreach my $emp (@$emps) {
   my ($emp_id, $emp_name) = @$emps;
   print "$emp_id - $emp_name \n";
}


hth
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On