Re: Perl Not returning SQL query resultby Marshall (Canon)
|on May 12, 2021 at 19:06 UTC||Need Help??|
I most often use SQLite.
I use $dbh (data base handle) instead of $conn.
First of all, you have to connect to the Database using the DBI module.
If $dbh is
If the connection works, then I've given some guidance about how to handle future errors.
Your connect syntax will be different for the Oracle database.
Next step is to prepare your SQL statement:
I use all CAPS for SQL keywords, but that is just my preference - doesn't matter.
Now you have to execute the prepared SQL statement:
Now you have to retrieve the data from that executed statement.
The easiest in this case, would be to ask for a reference to all of the rows.
Now print the data from this 2-D array:
There is more, a lot more to this than the basics I showed above.
I may have made a mistake which the other Monks will quickly point out.
I don't have your DB, but this is, I think a general "roadmap" to get a first result.