That's sound wounderfull :=) Would it also interface with DB_files and MLDBM?
i've finally put the DBD::SQlite working.
i've created a few tables, a unique index but i got one concern
how can i limit the data to fit in a standard SQl type:like info char(32) i've run a small test and i don't get a data limit.
#!/usr/bin/perl -w
use strict;
use warnings;
use DBI;
use DBD::SQLite;
my $dbh = DBI->connect("dbi:SQLite:dbname=foo", "", "", {AutoCommit =>
+ 1, RaiseError => 1});
$dbh->do("CREATE TABLE info (f1 char(3) primary KEY, f2 char(3), f3 ch
+ar(3))");
$dbh->do('create unique index info_idx on info (f1)');
my $sth = $dbh->prepare("INSERT INTO info VALUES (?, ?, ?)");
$sth->execute("Fred", "Bloggs", "fred\@bloggs.com");
$sth = $dbh->prepare("SELECT * FROM info");
$sth->execute();
while (my @row = $sth->fetchrow_array ) {
print "@row\n";
}
$dbh->disconnect;
this get Fred", "Bloggs", "fred\@bloggs.com".
So i must assume that DBD::SQLite don't test for type size?
sure i can count the data size each time i insert them into
the database but would prefer that SQLite ensures
that i don't forget about it... Any hint if i can get a free lunch here?
Thanks for all the help here and thanks in advance for all the forthcomming one.
Filipe
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.