Client Interfaces Guide > Connecting to TDV Server through ODBC > Examples Using ODBC to Connect to TDV Server > PERL Code Sample for Connecting to TDV Server
 
PERL Code Sample for Connecting to TDV Server
The following is a sample PERL script for connecting a PERL client to the TDV Server. The DSN must be configured on each client using the driverConfig utility to set the values in the odbc.ini.
#!/usr/bin/perl
 
use DBI;
use DBD::ODBC;
 
my $dsn="dbi:ODBC:DSN=test;";
my $dbc=DBI->connect($dsn,'admin','admin');
 
my $query = "select * from all_domains";
my $query_handle = $dbc->prepare($query);
 
$query_handle->execute();
 
$query_handle->bind_columns(undef, \$domain_id, \$domain_type_name, \$domain_name, \$domain_desc);
 
while ($query_handle->fetch()) {
print "$domain_id, $domain_type_name, $domain_name, $domain_desc\n";