To create an ODBC object in Perl, include the Win32::ODBC module, create a new Win32::ODBC object using the DSN name, check that the object is defined, run SQL queries and retrieve data, and close the connection when finished.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
8 views
Creating An ODBC Object
To create an ODBC object in Perl, include the Win32::ODBC module, create a new Win32::ODBC object using the DSN name, check that the object is defined, run SQL queries and retrieve data, and close the connection when finished.
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
Creating an ODBC Object
Your script will need to have the following line:
use Win32::ODBC; Then you will need to create a data connection to your DSN: $Data = new Win32::ODBC("MyDSN"); You shoud check to see if $Data is indeed defined otherwise there has been an error. You can now send SQL queries and retrieve info to your heart's content! See the description of functions below and also test.pl to see how it all works.
Make sure that you close your connection when you are finished: $Data->Close();