I've been spending my coding time in the offhours working on Perl instead of Ruby. My coding time in general has been very limited, which is part of the reason for the length of time between updates. :)
My latest project is to pull data out of a Microsoft SQL Server database for analysis. I'm using perl for various reasons: I need a crossplatform environment, and I need certain libraries that only work on perl. Some of the target users for my code run on Windows.
I know that Ruby runs on Windows but it's not the platform of choice for Ruby developers. The vast majority seem to develop either on OS X or Linux. So Ruby on Windows isn't at the maturity that ActiveState perl is on Windows.
In fact, I don't even run native perl anymore on my MacBook Pro. I've switched over to ActiveState perl because I don't need to compile anything every time I want to install new CPAN libraries. And because it's ActiveState, I'm that much more confident it will work on other platforms.
The bottom line is that perl makes the most sense for what I'm trying to do. I vastly prefer ruby to perl but I don't mind working in perl when I have to.
So how to connect to SQL Server from perl? My first thought was that I could use ODBC. My research quickly took me to DBD::ODBC in CPAN. After spending some time Googling for other examples and trying to get it working, I wasn't getting anywhere.
It took me some more research until I realized that DBD::ODBC is only one piece of the whole picture. I also need an ODBC driver manager and an ODBC driver.
The two main ODBC driver managers for Unix/Linux are unixODBC and iODBC. Fortunately, iODBC is already included in OS X.
For the ODBC driver itself, I wound up using FreeTDS. Because FreeTDS is only available as source code, I had to use MacPorts to download and compile the code. MacPorts installs everything in /opt/local by default.
So here was the process:
1. Install FreeTDS. If you are using ActiveState perl as I am, you must force MacPorts to build FreeTDS as 32-bit because ActiveState is 32-bit only. If you go with the default of compiling FreeTDS as 64-bit (or x86_64) then you will get this error when you call the FreeTDS library code from ActiveState perl:
So to fix this error, edit the MacPorts configuration file:
Uncomment this line:
Once you build and install FreeTDS, ensure that you can use it to talk with the database. I used tsql:
2. After you do this, test your ODBC driver manager and driver. I used iODBC because it comes with OS X. It comes with a utility called iodbctest. I used similar parameters to tsql when testing:
Note a few things:
My latest project is to pull data out of a Microsoft SQL Server database for analysis. I'm using perl for various reasons: I need a crossplatform environment, and I need certain libraries that only work on perl. Some of the target users for my code run on Windows.
I know that Ruby runs on Windows but it's not the platform of choice for Ruby developers. The vast majority seem to develop either on OS X or Linux. So Ruby on Windows isn't at the maturity that ActiveState perl is on Windows.
In fact, I don't even run native perl anymore on my MacBook Pro. I've switched over to ActiveState perl because I don't need to compile anything every time I want to install new CPAN libraries. And because it's ActiveState, I'm that much more confident it will work on other platforms.
The bottom line is that perl makes the most sense for what I'm trying to do. I vastly prefer ruby to perl but I don't mind working in perl when I have to.
So how to connect to SQL Server from perl? My first thought was that I could use ODBC. My research quickly took me to DBD::ODBC in CPAN. After spending some time Googling for other examples and trying to get it working, I wasn't getting anywhere.
It took me some more research until I realized that DBD::ODBC is only one piece of the whole picture. I also need an ODBC driver manager and an ODBC driver.
The two main ODBC driver managers for Unix/Linux are unixODBC and iODBC. Fortunately, iODBC is already included in OS X.
For the ODBC driver itself, I wound up using FreeTDS. Because FreeTDS is only available as source code, I had to use MacPorts to download and compile the code. MacPorts installs everything in /opt/local by default.
So here was the process:
1. Install FreeTDS. If you are using ActiveState perl as I am, you must force MacPorts to build FreeTDS as 32-bit because ActiveState is 32-bit only. If you go with the default of compiling FreeTDS as 64-bit (or x86_64) then you will get this error when you call the FreeTDS library code from ActiveState perl:
[iODBC][Driver Manager]dlopen(/opt/local/lib/libtdsodbc.so, 6): no suitable image found. Did find:
/opt/local/lib/libtdsodbc.so: mach-o, but wrong architecture (SQL-00000) at test.pl line 26
/opt/local/lib/libtdsodbc.so: mach-o, but wrong architecture (SQL-00000) at test.pl line 26
So to fix this error, edit the MacPorts configuration file:
sudo vi /opt/local/etc/macports/macports.conf
Uncomment this line:
set build_arch i386
Once you build and install FreeTDS, ensure that you can use it to talk with the database. I used tsql:
TDSVER=8.0 tsql -H 10.10.10.1 -p 1433 -U 'DOMAIN\user' -P 'password'
2. After you do this, test your ODBC driver manager and driver. I used iODBC because it comes with OS X. It comes with a utility called iodbctest. I used similar parameters to tsql when testing:
iodbctest "Driver=/opt/local/lib/libtdsodbc.so;Server=10.10.10.1;Port=1433;TDS_Version=8.0;uid=DOMAIN\user;pwd=password;Database=Database"
Note a few things:
- Other sites tell you to make entries in odbc.ini, odbcinst.ini, or freetds.conf. If you set all parameters on the command line then you don't need to tweak these other config files.
- The Driver parameter is set to the full path for libtdsodbc.so. This is the actual ODBC driver. The name or path may differ, depending on your OS and ODBC driver software.
- I haven't created an ODBC data source on my Windows SQL Server host so far. Some sites say you need to do this but I found it worked without this.
#!/usr/bin/perl
use strict;
use DBI;
my $user = 'user';
my $pass = 'password';
my $driver = "/opt/local/lib/libtdsodbc.so";
my $db_server = "10.10.10.1";
my $db_name = 'Database';
my $port = 1433;
my $tds_version = "8.0";
my $dsn = join "", ("dbi:ODBC:",
"Driver=$driver;",
"Server=$db_server;",
"Port=$port;",
"UID=$user;",
"PWD=$pass;",
"TDS_Version=$tds_version;",
"Database=$db_name",
);
my $db_options = {PrintError => 1, RaiseError => 1, AutoCommit => 0, };
my $dbh = DBI->connect($dsn, $db_options);
$dbh->{LongReadLen} = 32768;
my $sql = qq/select * from table/;
my $sth = $dbh->prepare($sql);
$sth->execute();
my @row;
while (@row = $sth->fetchrow_array) {
print join(", ", @row), "\n";
}
Note on 12/29/10: I added this after the DBI->connect:
$dbh->{LongReadLen} = 32768;
I was getting "Data truncated" errors when accessing ntext fields. This link was a real help and helped me solve the problem.
카지노사이트 온라인카지노 순위 slots stream. Huge win
ReplyDelete파워볼전용사이트 eos 파워볼 5분...Craps and Roulette Money Management...Exact Guidelines
ReplyDeleteI DID THREE $10,000 먹튀검증사이트 먹튀검증업체순위 HANDS!
ReplyDeleteThings about 토토사이트 추천 - Wizard of Odds
ReplyDeleteIm Immo Cashflow Booster erfahren Sie, wie Sie durch smarte Immobilienanlagestrategien passiven Cashflow generieren. Sie müssen keine Bankgeschäfte tätigen, Geld leihen oder etwas kaufen.
ReplyDeleteEric erklärte 6 verschiedene Strategien, die verwendet werden können, um durch Leasing und Leasing einen Cashflow zu generieren. Diese Methode ist völlig neu und eigentlich eine interne Strategie.
Anfangs war ich dieser Strategie etwas skeptisch gegenüber, denn wenn man die vermietete Wohnung wieder untervermieten möchte, wie überzeugt man dann den Vermieter.
Aber ich habe eine bessere Ausbildung und Eric hat klare Anweisungen, wie man den Vermieter leicht überreden kann. Der Immo Cashflow Booster bietet dir Top aktuelle Strategien, welche auch jahrelang funktionieren. Und in diesem Erfahrungsbericht, werde ich dir meine persönlichen Immo Cashflow Booster Erfahrungen mitteilen.
Just 99 Web Design offers affordable web design packages for every business, from basic one-page websites to full eCommerce website design services. affordable ecommerce website design
ReplyDeleteGreat! Kindly check out the courses we provide.
ReplyDeletePhython course in Coimbatore
Digital Marketing Course in Coimbatore
Generative AI Course in Coimbatore
Data Science Course in Coimbatore
Data Analytics Course in Coimbatore
Artificial Intelligence with Python Course in Coimbatore
KIKOTOTO bersama SportGG hadir sebagai situs judi bola terpercaya di tahun 2026 yang menawarkan pengalaman taruhan modern, lengkap, dan stabil bagi para pecinta sepak bola. Dengan dukungan pasaran Asia dan Eropa yang sangat beragam, pengguna dapat dengan leluasa memilih berbagai jenis taruhan sesuai strategi dan preferensi masing-masing. Mulai dari taruhan handicap, over/under, hingga berbagai opsi lain yang dirancang untuk memberikan fleksibilitas maksimal.
ReplyDeleteSalah satu keunggulan utama KIKOTOTO adalah penyediaan odds yang kompetitif dan selalu diperbarui secara berkala. Hal ini memungkinkan pemain untuk mendapatkan peluang keuntungan yang lebih optimal dibandingkan platform lainnya. Selain itu, sistem live score real-time yang akurat membantu pengguna memantau jalannya pertandingan secara langsung tanpa harus berpindah ke situs lain, sehingga keputusan taruhan bisa diambil dengan lebih cepat dan tepat.
KIKOTOTO juga mengedepankan kestabilan sistem dengan teknologi terbaru yang memastikan akses tetap lancar tanpa gangguan, bahkan saat trafik tinggi. Keamanan data dan transaksi menjadi prioritas utama, sehingga pemain dapat bertaruh dengan rasa aman dan nyaman. Tampilan antarmuka yang user-friendly membuat situs ini mudah digunakan, baik oleh pemula maupun pemain berpengalaman.
Dengan kombinasi fitur lengkap, performa handal, dan pelayanan profesional, KIKOTOTO bersama SportGG menjadi pilihan tepat bagi siapa saja yang ingin menikmati pengalaman judi bola terbaik di tahun 2026. situs bola
KEYTOTO merupakan platform togel online 4D resmi tahun 2026 yang dirancang untuk memberikan pengalaman bermain yang lengkap, aman, dan terpercaya bagi para penggunanya. Situs ini menghadirkan berbagai pilihan pasaran togel terlengkap dari berbagai negara, sehingga pemain memiliki banyak opsi untuk memasang angka sesuai dengan preferensi mereka. Dengan sistem yang modern dan terus diperbarui, KEYTOTO memastikan setiap proses taruhan berjalan secara cepat, akurat, dan transparan.
ReplyDeleteSelain menawarkan variasi pasaran yang luas, KEYTOTO juga dikenal dengan link akses yang stabil dan terpercaya, memudahkan pengguna untuk login kapan saja tanpa hambatan. Hal ini sangat penting untuk menjaga kenyamanan pemain, terutama saat mengakses situs di waktu-waktu sibuk. Tampilan platform yang sederhana dan ramah pengguna memungkinkan baik pemula maupun pemain berpengalaman untuk menavigasi fitur dengan mudah tanpa kebingungan.
Dari sisi keamanan, KEYTOTO mengutamakan perlindungan data pribadi dan transaksi finansial dengan sistem enkripsi yang canggih, sehingga setiap aktivitas pengguna tetap terjaga kerahasiaannya. Proses pendaftaran juga dibuat cepat dan praktis, memungkinkan siapa saja untuk segera bergabung dan mulai bermain dalam hitungan menit. Selain itu, layanan dukungan pelanggan tersedia untuk membantu menjawab pertanyaan atau menyelesaikan kendala yang mungkin dihadapi pengguna.
Dengan kombinasi fitur lengkap, akses mudah, serta komitmen terhadap keamanan dan kenyamanan, KEYTOTO menjadi pilihan ideal bagi para pecinta togel online yang mencari platform terpercaya untuk bermain. toto online
KEYTOTO kini hadir sebagai platform yang membawa konsep modern dalam dunia hiburan digital, dengan menawarkan beragam pilihan permainan slot online yang dapat diakses dengan mudah dalam satu situs terpadu. Platform ini dirancang untuk memenuhi kebutuhan para pengguna yang menginginkan pengalaman bermain yang praktis, cepat, dan menyenangkan tanpa harus berpindah-pindah layanan. Dengan tampilan antarmuka yang ramah pengguna, KEYTOTO memastikan bahwa baik pemain pemula maupun yang sudah berpengalaman dapat menjelajahi berbagai fitur yang tersedia tanpa kesulitan.
ReplyDeleteSelain kemudahan akses, KEYTOTO juga menonjolkan variasi permainan yang lengkap, mulai dari slot klasik hingga slot dengan tema dan fitur modern yang menarik. Setiap permainan dirancang dengan kualitas grafis yang baik serta sistem yang responsif, sehingga memberikan pengalaman bermain yang lebih imersif. Platform ini juga terus melakukan pembaruan untuk menghadirkan permainan terbaru agar pengguna tidak merasa bosan.
Keamanan dan kenyamanan pengguna menjadi prioritas utama, dengan sistem yang dirancang untuk menjaga data dan aktivitas tetap terlindungi. Proses pendaftaran hingga penggunaan layanan dibuat sederhana agar siapa saja dapat langsung menikmati hiburan yang ditawarkan. Dengan kombinasi antara teknologi modern, variasi permainan, dan kemudahan penggunaan, KEYTOTO berupaya menjadi pilihan utama bagi para pencari hiburan digital yang praktis dan berkualitas dalam satu tempat.
KIKOTOTO merupakan salah satu link situs slot gacor hari ini yang banyak dicari oleh para pecinta permainan slot online karena menawarkan pengalaman bermain yang seru, aman, dan berpeluang besar mendapatkan kemenangan maksimal atau maxwin. Sebagai platform yang dikenal luas di kalangan pemain slot online, KIKOTOTO hadir dengan berbagai pilihan permainan terbaik dari provider ternama yang sudah terbukti populer dan terpercaya. Tidak hanya menyediakan game dengan tampilan menarik dan fitur lengkap, situs ini juga menawarkan tingkat kemenangan tinggi yang membuat para pemain semakin percaya untuk bermain setiap hari.
ReplyDeleteSelain dikenal sebagai situs slot gacor, KIKOTOTO juga menjadi pilihan utama bagi pemain yang mencari agen Slot88 resmi terpercaya dengan pelayanan profesional dan sistem keamanan terbaik. Semua transaksi deposit maupun withdraw diproses dengan cepat sehingga pemain dapat menikmati permainan tanpa hambatan. Dukungan layanan pelanggan yang aktif selama 24 jam juga menjadi salah satu keunggulan yang membuat para member merasa nyaman dan aman saat bermain.
KIKOTOTO menyediakan berbagai bonus menarik, mulai dari bonus member baru, cashback harian, hingga promo spesial yang dapat meningkatkan peluang kemenangan pemain. Dengan akses yang mudah melalui berbagai perangkat, baik desktop maupun smartphone, pemain dapat menikmati permainan kapan saja dan di mana saja. Karena itulah, KIKOTOTO terus menjadi rekomendasi utama bagi para pencinta slot online yang ingin mencari situs slot gacor terpercaya dengan peluang maxwin terbesar setiap harinya.