in reply to Why does the same SQL return different results in the DBI and in SQL*Plus?

Here's what I use for fetching single values (avoids explicit prepare, execute, bind) (update - and fetch and finish):
my $sql = qq{ SELECT server_id FROM wms_rf_server WHERE server_name = 'splwebdev.unix.us.tld.com' }; my($server_id) = $dbh->selectrow_array($sql);
The parens are not strictly necessary in this case cause we specified only one column but it's good to get into the habit because without them it's undefined which value you'll get from a multi-column query.

update 2 duh! I meant selectrow_array not fetchrow_array, thanks runrig

  • Comment on Re: Why does the same SQL return different results in the DBI and in SQL*Plus?
  • Download Code