faqts : Computers : Programming : Languages : Perl : DBI

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

Entry

Perl: Database: DBI: View: How to view all your installed DBD modules?

Dec 27th, 2004 17:10
Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 27 December 2004 - 06:30 pm -------------------
Perl: Database: DBI: View: How to view all your installed DBD modules?
---
---
Method: Run a Perl program
Steps: Overview:
 1. -Create the following program
--- cut here: begin --------------------------------------------------
#!c:\perl\bin\perl.exe
use strict;
use DBI;
print "Here follows a list of DBI drivers:\n";
my @your_available_drivers = DBI->available_drivers( 'quiet' );
my $driver;
foreach $driver (@your_available_drivers)
{
 print "$driver\n";
}
--- cut here: end ----------------------------------------------------
 2. -Save this program
     e.g. as 'mydbi.pl'
 3. -Run this program from the MSDOS command line:
--- cut here: begin --------------------------------------------------
perl c:\temp\mydbi.pl
--- cut here: end ----------------------------------------------------
 4. -This will output similar to the following:
--- cut here: begin --------------------------------------------------
Here follows a list of DBI drivers:
ExampleP
Proxy
mysql
--- cut here: end ----------------------------------------------------
---
---
Tested successfully on Microsoft Windows XP Professional, running
ActiveState Perl v5.6.630
---
---
Internet: see also:
---
[Internet: source: http://perl.about.com/library/weekly/aa032701a.htm]
---
Perl: Database: Link: Overview: Can you give an overview of links?
http://www.faqts.com/knowledge_base/view.phtml/aid/33044/fid/654
----------------------------------------------------------------------