I am under the impression that if a field is not AUTO_INCREMENT then it expects you to fill its value or it will take its default value if any.
Well... Not exactly...consider this code..
#!/usr/bin/perl use strict; use warnings; use DBI; my $dbfile = "whatever.sqlite"; my $dbh = DBI->connect("dbi:SQLite:dbname=$dbfile","","",{RaiseError = +> 1}) or die "Couldn't connect to database: " . DBI->errstr; $dbh->do ("CREATE TABLE ScoreCard ( Url varchar(80) DEFAULT '', DateTime varchar(20) DEFAULT '1995-12-30 00:00:01', Desc varchar(100) DEFAULT '' ); "); $dbh->do ("CREATE TABLE Participants ( id integer PRIMARY KEY AUTOINCREMENT, Url varchar(80) , Name varchar(10) DEFAULT '' ); ");
You will see that the ScoreCard table winds up containing an extra field, "rowid" that I didn't specify in CREATE TABLE ScoreCard. Note: You need a program to show the actual created DB fields. That is a unique id that SQL will assign on it own. In the Participants TABLE, that field doesn't exist because I called it "id" and gave some rules for this PRIMARY KEY.

I did take a look at your article and am still thinking about it. I did have to burst out laughing at this part:
"We don’t want our complexity to grow linearly as we add more functionality into the system, which would drastically slow us down as we grow in the eyes of both business and value confidence." My gosh we only wish that complexity grew linearly with functionality. Complexity appears to grow exponentially with functionality. What does "growing in the eyes of value confidence" mean? What!?


In reply to Re^4: Perl DBI and Foreign Keys by Marshall
in thread Perl DBI and Foreign Keys by Marshall

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.