
- #Rose db text field of 0 returns undef drivers#
- #Rose db text field of 0 returns undef driver#
- #Rose db text field of 0 returns undef upgrade#
- #Rose db text field of 0 returns undef series#
Select * from table where column = 'can't' my $name = "can't" my $sql = qq/select * from table where column = '$name'/ Your SQL select statement is passed to the DBI prepare method which in ODBC terms ends up in a call to the SQLPrepare or SQLExecDirect ODBC APIs.īe careful when creating SQL from Perl variables as you can include characters which invalidate the SQL. You can qualify the rows you want back by adding a where clause like: In fact it can be many more things consult a SQL reference manual.
#Rose db text field of 0 returns undef drivers#
DBI and ODBC drivers DBI, DBD::ODBC Architectureĭownload ODBC Drivers for Oracle®, SQL Server, Salesforce, MongoDB, Access, Derby, InterBase, MySQL & DB2. All discussion in this document relating to the location and definition of ODBC data sources is for unixODBC.
#Rose db text field of 0 returns undef driver#
We have assumed you are using the unixODBC driver manager. However, all the Perl examples should work equally well on Windows so long as minor alterations for the command line are made. This tutorial was designed on UNIX and we have assumed you are using UNIX too. This tutorial assumes you have read or understand all the concepts in the previous tutorial DBD::ODBC Tutorial Part 1 - Drivers, Data Sources and Connection. We also used the Easysoft ODBC-ODBC Bridge as the ODBC driver to access a remote MS SQL Server database from UNIX. You can find out the unixODBC version you are using with: You probably have the unixODBC driver manager installed if you have the odbcinst command (for ODBC drivers from Easysoft, the unixODBC driver manager is located in /usr/local/easysoft/unixODBC and the odbcinst command in the bin sub directory of that path. Easysoft can supply ODBC drivers for many databases and operating systems and all ODBC drivers come with the unixODBC driver manager. Unsurprisingly you will need an ODBC driver for most of this tutorial and we recommend you use an ODBC driver manager under DBD::ODBC (see Enabling ODBC support in Perl with Perl DBI and DBD::ODBC. Go to CPAN to get an up to date version of the DBD::ODBC module. To show all drivers DBI knows about and their versions: Perl -MDBD::ODBC -e 'print $DBD::ODBC::VERSION ' If you have not got DBD::ODBC installed you should see Enabling ODBC support in Perl with Perl DBI and DBD::ODBC for instructions. To check you have the DBD::ODBC module installed: You can use similar methods as above to determine if DBD::ODBC is installed and to see what version you have: Go to CPAN to get an up to date version of the DBI module.

If you get an error saying DBI cannot be found in you've probably not got DBI installed.
#Rose db text field of 0 returns undef upgrade#
If you get an error like "DBI version 1.40 required-this is only version 1.30 at -e line 1." you need to upgrade DBI. To see if you have a recent enough version of DBI installed run:

We used DBI 1.45 but this tutorial should work with anything after 1.40. Use perl -version to see what version of Perl you have installed. We used Perl 5.8 but you only need the minimum required by the DBI and DBD::ODBC modules which is currently 5.6. Pre-requisitesīefore you start part 2 of this tutorial you need to ensure you have satisfy all the pre-requisites:
#Rose db text field of 0 returns undef series#
This is part 2 of a series of Easysoft tutorials on using Perl DBI with DBD::ODBC. Hash and Reference methods of retrieving data.Introduction to retrieving data from your database - Perl DBI/DBD::ODBC Tutorial Part 2 Contents
