AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Activeperl license type9/23/2023 ![]() ![]() ![]() Download the ActivePerl distribution from the ActiveState web site.We tested the SQL Server ODBC driver with ActivePerl 5.10 on Debian GNU/Linux. ![]() The examples in this article will also work with earlier (7.0) and later (2008, 2012, 2014, 2016, 20) versions of SQL Server. We accessed SQL Server 2000, 2005 and Express databases from ActivePerl on UNIX and Linux. Print "$sth-> # Disconnect the database from the database handle. $sth ->execute () # Print the column name. my $sth = $dbh ->prepare ( $sql ) or die "Can't prepare statement: $DBI::errstr" # Execute the statement. my $sql = "SELECT 1 AS test_col" # Prepare the statement. my $dbh = DBI ->connect ( $data_source, $user, $password ) or die "Can't connect to $data_source: $DBI::errstr" # This query generates a result set with one record in it. my $data_source = q/dbi:ODBC:datasource_name/ my $user = q/database_username/ my $password = q/database_password/ # Connect to the data source and get a handle for that connection. # Replace database_username and database_password # with the SQL Server database username and password. #!/opt/ActivePerl-5.10/bin/perl -w # Example: Connecting ActivePerl on UNIX and Linux to MSSQL # use strict use DBI # Replace datasource_name with the name of your data source. The SQL Server ODBC driver is available for 32-bit and 64-bit Linux (CentOS, Debian GNU/Linux, Fedora, Mandrake/Mandriva, OpenSUSE/SUSE, RedHat, RedHat Enterprise Linux (RHEL) and Slackware) and UNIX (AIX, HP-UX and Solaris) platforms. Use the SQL Server ODBC driver to connect ActiveState ActivePerl to Microsoft SQL Server 7.0, 2000, 2005, 2008, 2012, 2014, 2016, 2017, 2019 and Express. ![]()
0 Comments
Read More
Leave a Reply. |