DBI w/ DBD:ODBC vs DBI w/ DBD:mysql

------=_NextPart_000_002D_01C1D002.8689BBD0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I am new to Perl DBI programming But it is fairly simple..
I am using both Mysql 3.23.44nt and 3.23.43 Linux..as well as PostgreSQL
7.1 Linux and on WinXP on Cygwin.

Perl on Linux was straight forward but the Perl on WIn is a bit =
Different.
I ran a simple script to insert records in a table as test and it worked =
but I am
unsure that the WinXP install of Perl and DBI is correct that is do I =
have the=20
correct modules in place. Should I be running the date through a =
DBD:ODBC or a DBD:mysql.=20

Below is my PPM query to my Perl Package Manager:
Settings\bobby\Application Data\ActiveState\ActiveState.lic' is present.
ppm> query DBI
Querying target 1 (ActivePerl 630)
    1. DBI         [1.14] Database independent interface for Perl
    2. DBIx-AnyDBD [1.98] DBD independant class
    3. DBIx-Easy   [0.10] Easy to Use DBI interface
ppm> query DBD
Querying target 1 (ActivePerl 630)
    1. DBD-ODBC    [0.28] ODBC driver for the DBI module.
    2. DBIx-AnyDBD [1.98] DBD independant class
ppm>

My test Perl Script...
#!/perl/bin/perl -w

use DBI;

my $dbh =3D DBI-> connect( "DBI:mysql:Meet_A_Geek", "bobby", "bobby") or =
die "Can't connect";

# Insert the values
$dbh->do("INSERT INTO customers (First_Name, Last_Name) VALUES ('Renee', =
'Robertson')");
$dbh->do("INSERT INTO customers (First_Name, Last_Name) VALUES ('Larry', =
'Isacson')");
$dbh->do("INSERT INTO customers (First_Name, Last_Name) VALUES ('Mark', =
'Harrison')");

# Disconnect from the database
$dbh->disconnect;

exit;

AND Lastly... When I replace the first 7 lines like so... I get a =
failure
#!/perl/bin/perl -w

use DBI;

$database =3D "Meet_A_Geek";
$driver =3D "DBI:mysql";
my $dbh =3D DBI-> connect( "$driver:$database", "bobby", "bobby") or die =
"Can't connect";

The error referred to database not being quoted but then after I used =
the first script to establish a connection the second script worked???

Sorry for the multiple questions ..Can anyone Help..

Bob T.

------=_NextPart_000_002D_01C1D002.8689BBD0--

0
rjtalbo
3/20/2002 4:29:40 PM
perl.beginners.cgi 3838 articles. 0 followers. Follow

0 Replies
573 Views

Similar Articles

[PageSpeed] 16

Reply:

Similar Artilces:

DBI w/ DBD:ODBC or DBI w/ DBD:mysql Which?
------=_NextPart_000_0009_01C1D022.ADFABA00 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I am new to Perl DBI programming But it is fairly simple.. I am using both Mysql 3.23.44nt and 3.23.43 Linux..as well as PostgreSQL 7.1 Linux and on WinXP on Cygwin. Perl on Linux was straight forward but the Perl on WIn is a bit = Different. I ran a simple script to insert records in a table as test and it worked = but I am unsure that the WinXP install of Perl and DBI is correct that is do I = have the=20 correct modules in place. ...

Fw: DBI w/ DBD:ODBC or DBD:mysql or DBIx-AnyDBD
------=_NextPart_000_0034_01C1D12E.53400590 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable ----- Original Message -----=20 From: Bob T=20 To: dbi-users@perl.org=20 Sent: Thursday, March 21, 2002 11:10 PM Subject: Fw: DBI w/ DBD:ODBC or DBD:mysql or DBIx-AnyDBD ----- Original Message -----=20 From: Bob T=20 To: perl-win32-database@NO-SPAM.listserv.ActiveState.com=20 Sent: Thursday, March 21, 2002 11:08 PM Subject: DBI w/ DBD:ODBC or DBD:mysql or DBIx-AnyDBD I am new to Perl DBI programming it is fairly simple..E...

Fw: DBI w/ DBD:ODBC or DBD:mysql or DBIx-AnyDBD
------=_NextPart_000_0029_01C1D12D.87DFD010 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable ----- Original Message -----=20 From: Bob T=20 To: perl-win32-database@NO-SPAM.listserv.ActiveState.com=20 Sent: Thursday, March 21, 2002 11:08 PM Subject: DBI w/ DBD:ODBC or DBD:mysql or DBIx-AnyDBD I am new to Perl DBI programming it is fairly simple..Except I am not sure I am set up correctly or am using the correct module = combinations... I am using both Mysql 3.23.44nt and 3.23.43 Linux..as well as PostgreSQL 7.1 Linux a...

BLOBs w/ DBI DBD::ODBC
Below, is a message that Michael Brown posted back in January, which I found in the archives, but I saw no response from the list. I have tried to contact him directly, but he had a no-spam reply addy. I would be interested in hearing whether anyone can offer a solution at this time. Earlier this week, I had posted a similar request to the Win32 Perl list, but I received no response. I am trying to create a web interface, where I want to embed pdf BLOBs in an Access DB. I have combed my O'Reilly Perl DBI book and the archives, but his query is the closest to a solution ...

Problem w/ $dbh->column_info() using current DBI & DBD::mysql
--------------060303000607000209070207 Content-Type: multipart/alternative; boundary="------------080805070003000005080308" --------------080805070003000005080308 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit I've been using an alpha version of column_info that Tim Bunce sent the Class::DBI list ages ago in connection with some code to extend Class::DBI. AFAICS, it's precisely what's in the latest version of DBD::mysql. I got it to work without any finding bugs except it couldn't handle tablenames that inc...

Binary version of DBI, DBD-ODBC, DBD-Oracle, DBD-DB2 available (back up with new versions)
ftp.esoftmatic.com should be back up now... I had a UPS die badly and = since died, the original server stopped working. Please let me know on the dbi-users mailing list if you have issues. Also, since the original announcement, I have upgraded to DBI version = 1.40, DBD-Oracle 1.15 and added DBD-DB2. Also note that if you get DBD-xxx from my site, I strongly recommend you = get DBI from my site too. At the very least, make sure you are running the = same DBI that I'm running. I've restructured a bit and am basing the directory structure upon the=20 perl version,...

Re: DBD::oracle DBD::ODBC DBI
d2hlcmUgY2FuIEkgZ2V0IGluc3RhbmNlIGNsaWVudCBsaWIgZnJvbQ0KDQpXaGF0IGl0IGRvZXMg bm90IHdvcmsgaXMgdGhlIGRiZDo6b3JhY2xlIGluIHRoZSBwZXJsIHByb2dyYW0gY29tcGxhaW50 IGFib3V0IGNhbiBub3QgZmluZC4gT3JhY2xlIGxpYg0KSSB3aWxsIGNoZWNrIGl0IGFuZCBzZW5k IHlvdSB0aGUgaW5mbyB3aGVuIEkgZ2V0IHRvIHRoZSBvZmZpY2UNClRoYW5rcw0KSQ0KDQpfX19f X19fX19fX19fX19fX19fX18NCk1pa2UgVG9maWdoIA0KRGlnaWNvbiBDb250cmFjdG9yDQozMDEt MjEzLTY2NDANClNlbnQgZnJvbSBteSBCbGFja0JlcnJ5IFdpcmVsZXNzIEhhbmRoZWxkDQoNCg0K LS0tLS0gT3JpZ2luYWwgTWVzc2FnZSAtLS0tLQ0KRnJvbTogTWFydGluIEV2YW5zIDxtYXJ0aW4u ZXZhbnNAZWFzeXNvZnQuY29tPg0KVG86IFRvZmlnaCwgTWlrZSAoTk...

MySQL vs. DBI/DBD
I'm using MySQL v4.1.10.a on Windows XP Activestate Perl v5.8.6.811 DBI v1.47 This is my script: ---------------------------------------- #!/usr/bin/perl -w use strict; use DBI; my $database =3D "bg_test"; my $hostname =3D "localhost"; my $port =3D 3306; my $user =3D "root"; my $password =3D "msqlborkur"; my $dsn =3D "DBI:mysql:database=3D$database;host=3D$hostname;port=3D$port";= my $dbh =3D DBI->connect($dsn, $user, $password); ---------------------------------------- When I run the script I get this ...

binaries of DBI, DBD::mysql, CGI
Hello list, maybe this is a bit off-topic, sorry! I would like to create something like a "database-driven-website" based on MySQL, Apache and.... Well I did something based on PHP as link between HTML and the Database. Now I want to use Perl as language that does the cgi-stuff. I know, I ought to use the modules DBI, DBD::mysql and CGI, but my test-server runs on my desktop-pc with windows on it. As the modules come as sourcecode, i would have to compile them to use them. My questions are: Is there anybody who has already tried this? (is it worth trying?) Is there may...

Bringing old DBI DBD-CSV DBD-ODBC program up-to-date
------_=_NextPart_001_01C32EAE.F03552EE Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, =20 While breaking in a new desktop computer, I installed new versions of the DBI, DBD-ODBC, and DBD-CSV. I have found the program below (which takes records out of an Access DB with DBD-ODBC and puts them into a ..csv file with DBD-CSV) to start off slow (50 records/sec) and then bogs down and runs slower and slower (2 records/sec at ~4500 records in) with the new installs of the DBI and DBDs. However, on the old machine (with an ol...

DBI V 1.39, DBD::mysql V 2.9002, and DBI->data_sources()
Hi Folks 1) Under 'synopsis', it says: @data_sources =3D DBI->data_sources($driver_name, \%attr, $dbh); however that combination of options is not listed under the discussion of= data_sources(). Anyway, I tried DBI -> data_sources('mysql') and got an empty list. Sigh. I tried DBI -> data_sources('mysql', {}, $dbh) and got: Undefined subroutine &DBD::mysql::db::SQL_VARCHAR called at= C:/Perl/site/lib//DBD/mysql.pm line 337. 2) Under 'data_sources', it says: A $dbh can also be used as the $driver argument. I tried DBI -> data_sou...

RE: Binary build(s) of DBI, DBD::ODBC and DBD::Oracle available for ActivePerl 807
>Jeff Urlwin wrote: >Sent: Tuesday, December 30, 2003 5:04 PM >I've restructured a bit and am basing the directory structure upon the perl >version, not the AS build number. 807 reports as 5.8.2, so >ftp://ftp.esoftmatic.com/outgoing/DBI/5.8.2 >Contains all the 5.8.2 specific versions. >So the following command lines work: > >Ppm install ftp::ftp.esoftmatic.com/outgoing/DBI/5.8.2/DBI.ppd >Ppm install ftp::ftp.esoftmatic.com/outgoing/DBI/5.8.2/DBD-Oracle.ppd >Ppm install ftp::ftp.esoftmatic.com/outgoing/DBI/5.8.2/DBD-ODBC.ppd They work GREAT!!...

DBD/DBI for MySQL
Has anyone got DBD/DBI working for mysql on OSX? -- Robert Whittle Automatic Netware robert@softguides.com www.automatic.ie on 3/31/01 7:46 AM, Robert Whittle at robert@softguides.com wrote: > Has anyone got DBD/DBI working for mysql on OSX? > Yes. Look at http://duke.usask.ca/~dalglb/macosx/ for a write-up of what I needed to do to get it going. The version of mysql I am using is the one mentioned, namely 3.23.28, while the latest version is 3.23.36. ...

DBI DBD-ODBC
--=_alternative 005A160985257337_= Content-Type: text/plain; charset="US-ASCII" I created an MSACCESS Database on my Windows XP O/S, set up the System Name in the DATA SOURCES panel associating the "Microsoft Access Driver(*.mdb) with my database name (db1). I installed the DBI Module and DBD-ODBC and I still get the following error when I run my PERL script.. Could not make a connection to the database: [Microsoft][ODBC Microsoft Access D river]General error Not enough information to connect to this DSN with SQLConnec t. Use SQLDriverConnect. (SQL-H...

Web resources about - DBI w/ DBD:ODBC vs DBI w/ DBD:mysql - perl.beginners.cgi

Resources last updated: 12/15/2015 8:22:02 AM