#!/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 "Cou +ldn't connect to database: " . DBI->errstr; my $sth = $dbh->prepare('INSERT INTO optionsDB..nCopm_Content (use +rID, title, categoryID, propertyName, city, cityID, perchs, totalPerc +hs, userTotalPrice, duration, dateCreated, userIP, status) values (?, + ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, getdate())') or die "Couldn't prepa +re 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 "C +ouldn't execute statement: " . $sth->errstr; #Adump($sth); $sth->finish; DBI->trace(0); #trace off }
In reply to How to view SQL statements by Kanishka
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |