#!/usr/bin/perl -w use strict; use DBI; ................. ................. insert(...........); sub insert{ my ($refNo, $price, $area, $Loc, $CategoryID, $PropertyName) = @_; my $userID = 0, my $cityID = 0; my $duration = 7; my $status = 1; my $title = "NA"; my $userIP = "NA"; print $userID."\t".$title."\t".$CategoryID."\t".$PropertyName."\t".$Loc."\t".$cityID."\t".$area."\t".$area."\t".$price."\t".$duration."\t".$userIP."\t".$status."\n"; my $dbh = DBI->connect('DBI:ODBC:OptionsDB', 'sa', '') or die "Couldn't connect to database: " . DBI->errstr; my $sth = $dbh->prepare('INSERT INTO optionsDB..nCopm_Content (userID, title, categoryID, propertyName, city, cityID, perchs, totalPerchs, userTotalPrice, duration, dateCreated, userIP, status) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, getdate())') or die "Couldn't prepare statement: " . $dbh->errstr; #DBI->trace("ALL|7", 'foo.txt'); #trace on $sth->execute ($userID, $title, $CategoryID, $PropertyName, $Loc, $cityID, $area, $area, $price, $duration, $userIP, $status) or die "Couldn't execute statement: " . $sth->errstr; #Adump($sth); $sth->finish; DBI->trace(0); #trace off }