DBIx::Simple::Examples 1.30
Sponsored Links
DBIx::Simple::Examples 1.30 Ranking & Summary
File size:
0.015 MB
Platform:
Any Platform
License:
Public Domain
Price:
Downloads:
898
Date added:
2007-05-10
Publisher:
Juerd Waalboer
DBIx::Simple::Examples 1.30 description
[COPRIGHT=1]
EXAMPLES
General
#!/usr/bin/perl -w
use strict;
use DBIx::Simple;
# Instant database with DBD::SQLite
my $db = DBIx::Simple->connect(dbi:SQLite:dbname=file.dat)
or die DBIx::Simple->error;
# Connecting to a MySQL database
my $db = DBIx::Simple->connect(
DBI:mysql:database=test, # DBI source specification
test, test, # Username and password
{ RaiseError => 1 } # Additional options
);
# Using an existing database handle
my $db = DBIx::Simple->connect($dbh);
# Abstracted example: $db->query($query, @variables)->what_you_want;
$db->commit or die $db->error;
Simple Queries
$db->query(DELETE FROM foo WHERE id = ?, $id) or die $db->error;
for (1..100) {
$db->query(
INSERT INTO randomvalues VALUES (?, ?),
int rand(10),
int rand(10)
) or die $db->error;
}
$db->query(
INSERT INTO sometable VALUES (??),
$first, $second, $third, $fourth, $fifth, $sixth
);
# (??) is expanded to (?, ?, ?, ?, ?, ?) automatically
Single row queries
my ($two) = $db->query(SELECT 1 + 1)->list;
my ($three, $four) = $db->query(SELECT 3, 2 + 2)->list;
my ($name, $email) = $db->query(
SELECT name, email FROM people WHERE email = ? LIMIT 1,
$mail
)->list;
Or, more efficiently:
$db->query(SELECT 1 + 1)->into(my $two);
$db->query(SELECT 3, 2 + 2)->into(my ($three, $four));
$db->query(
SELECT name, email FROM people WHERE email = ? LIMIT 1,
$mail
)->into(my ($name, $email));
EXAMPLES
General
#!/usr/bin/perl -w
use strict;
use DBIx::Simple;
# Instant database with DBD::SQLite
my $db = DBIx::Simple->connect(dbi:SQLite:dbname=file.dat)
or die DBIx::Simple->error;
# Connecting to a MySQL database
my $db = DBIx::Simple->connect(
DBI:mysql:database=test, # DBI source specification
test, test, # Username and password
{ RaiseError => 1 } # Additional options
);
# Using an existing database handle
my $db = DBIx::Simple->connect($dbh);
# Abstracted example: $db->query($query, @variables)->what_you_want;
$db->commit or die $db->error;
Simple Queries
$db->query(DELETE FROM foo WHERE id = ?, $id) or die $db->error;
for (1..100) {
$db->query(
INSERT INTO randomvalues VALUES (?, ?),
int rand(10),
int rand(10)
) or die $db->error;
}
$db->query(
INSERT INTO sometable VALUES (??),
$first, $second, $third, $fourth, $fifth, $sixth
);
# (??) is expanded to (?, ?, ?, ?, ?, ?) automatically
Single row queries
my ($two) = $db->query(SELECT 1 + 1)->list;
my ($three, $four) = $db->query(SELECT 3, 2 + 2)->list;
my ($name, $email) = $db->query(
SELECT name, email FROM people WHERE email = ? LIMIT 1,
)->list;
Or, more efficiently:
$db->query(SELECT 1 + 1)->into(my $two);
$db->query(SELECT 3, 2 + 2)->into(my ($three, $four));
$db->query(
SELECT name, email FROM people WHERE email = ? LIMIT 1,
)->into(my ($name, $email));
DBIx::Simple::Examples 1.30 Screenshot
Advertisements
DBIx::Simple::Examples 1.30 Keywords
DBIx
DBI
Examples 1.30
query
1
select
email
database
1.30
DBIx::Simple::Examples
DBIxSimpleExamples
DBIx::Simple::Examples 1.30
Libraries
Programming
Bookmark DBIx::Simple::Examples 1.30
DBIx::Simple::Examples 1.30 Copyright
WareSeeker periodically updates pricing and software information of DBIx::Simple::Examples 1.30 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of DBIx::Simple::Examples 1.30 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
Related Software
WWW::Mechanize::Examples is a Perl module with sample programs that use WWW::Mechanize. Free Download
DBIx::Frame is a Perl module for creating and maintaining DBI frameworks. Free Download
DBIx::TableHash is a Perl module that can tie a hash to a mysql table + SQL utils. Free Download
DBIx::Timeout is a Perl module that provides a safe method of timing out DBI requests. Free Download
DBIx::XMLMessage is a Perl module for XML Message exchange between DBI data sources. Free Download
DBIx::HTML::ClientDB is a Perl module to convert sql into a client-side db with keyed access. Free Download
DBIx::CGITables is a Perl module for easy DB access from a CGI. Free Download
DBIx::PDlib is a Perl with DBI SQL abstraction and convenience methods. Free Download
Latest Software
Popular Software
Favourite Software