in reply to PostgreSQL UPDATE
########################################## ## Create a connection to the database. ## ########################################## sub Create_DB_Connection{ use DBI; use DBD::Pg; $DSN = "DBI:Pg:dbname=blah"; $user = "blah"; $pw = "blah"; $dbh = DBI->connect($DSN,$user,$pw) || die "Cannot connect: $DBI::errstr\n" unless $dbh; return; } # End of Create_DB_Connection subroutine. ########################################## ########################################## ## Executes the SQL command and then ## ## returns to the calling area of the ## ## program. ## ########################################## sub Do_SQL{ eval{ $sth = $dbh->prepare($SQL); }; # End of eval # Check for errors. if($@){ $dbh->disconnect; print "Content-type: text/html\n\n"; print "An ERROR occurred! $@\n<P>"; exit; } else { $sth->execute; } # End of if..else return ($sth); } # End of Do_SQL subroutine #################################################################
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: PostgreSQL UPDATE
by chromatic (Archbishop) on Jul 18, 2001 at 23:20 UTC | |
by adamsj (Hermit) on Jul 18, 2001 at 23:38 UTC | |
|
Re: Re: PostgreSQL UPDATE
by nlafferty (Scribe) on Jul 18, 2001 at 22:55 UTC |