Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Simple Query to Oracle db
On 10 Aug 2000, at 17:55, Eric Miles wrote:
> I'm trying to execute the following SQL statement:
>
> select count(*) from table where field = ?
>
> within a perl script using DBI and DBD::Oracle.
>
> How can I get the result into a variable? I know this sounds
> absurdly simple,
>
> but for the life of me, I can't get it working.
>
> I've tried bind_param_inout, the 'do' statement. All with errors
> or wrong values
>
> such as '0E0'.
As someone said, the docs are good, there are examples in the DBD::Oracle distribution ... but you also may want to run the same query in sqlplus to be sure there is data to return. I usually print out my sql statements when developing just for this reason ... and when I don't get what I expect I run it in the rdbms client. Try that. then show the code you are using that doesn't work if you get the desired result in the client.
Peter