Received: from mail2.rdc3.on.home.com (mail2.rdc3.on.home.com [24.2.9.41]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eAKKlRs39989 for ; Mon, 20 Nov 2000 15:47:27 -0500 (EST) (envelope-from davidcoley@home.com) Received: from cr572379a ([24.114.120.154]) by mail2.rdc3.on.home.com (InterMail vM.4.01.03.00 201-229-121) with SMTP id <20001120204525.KWGF25249.mail2.rdc3.on.home.com@cr572379a> for ; Mon, 20 Nov 2000 12:45:25 -0800 From: "David Coley" To: Subject: Create tables using Perl DBI Date: Mon, 20 Nov 2000 15:50:43 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Importance: Normal X-Archive-Number: 200011/217 X-Sequence-Number: 253 I've been trying to learn how to use PostgreSQL and Perl together on a test machine at work. My problem is that I can not seem to get it working. The documentation on the subject don't seem to be that in-depth and tutorials seem lacking :) Below is my third or forth try at getting my database to connect and create a table. I've included the error code for the code snippet. Any help would be GREATLY appreciated. === Begin Code === #!/usr/bin/perl # Use the Database Binding Interface use DBI; # We want to use the database which is kwsclient $dbh = DBI->connect("dbi:Pg:dbname=kwsclient","db","PASSWORD") or die "Connecting: $DBI::errstr"; #abcdefghijklmnopqrstuvwxyz $sth = $dbh->prepare("create table customer (ID serial PRIMARY KEY, name text NOT NULL, email text NOT NULL, phone text NOT NULL, fax text DEFAULT, address text NOT NULL, address2 text DEFAULT, zip text NOT NULL, city text NOT NULL, state text NOT NULL, country text NOT NULL") or die "Could not Create Table: $DBI::errstr"; $sth->execute; #disconnect from the database. $dbh->disconnect(); # END === End Code === === Error Message === DBD::Pg::st execute failed: ERROR: parser: parse error at or near "," Thanks for the help. David Coley davidcoley@home.com http://www.davidcoley.com