Hi,
I have a written a perl script to insert some values into ms sql database tables.
I am able to insert values in the table if use hard coded values but it is failing if I read a dcr and insert the values using perl variables.
ERROR: DBD::JDBC::db prepare failed: java.lang.OutOfMemoryError: Java heap space at deploydb_pilot.ipl line 130.
environment: TeamSite 6.7.2 and MS SQL 2005
Code:
[html]
use TeamSite::Config;
use TeamSite:

CRnode;
use TeamSite::XMLnode;
use strict;
use DBI;
use DBD::JDBC;
my $host = TeamSite::Config::hostname();
print "hostname: $host\n";
my $dbh = DBI->connect( "dbi:JDBC:hostname=$host;port=$port;url=$url",$user,$password ) or die print $DBI::errstr;
my $data;
my $dcrlocation=$ARGV[0];
if (open(DCR, "< $dcrlocation"))
{
while () { $data .= $_; }
close(DCR);
}
else
{
print "could not open $dcrlocation";
}
my $rootnode = TeamSite::XMLnode->new($data);
print "rootnode: $rootnode\n";
my $root_val = $rootnode->value();
print "root_val: $root_val \n";
my $pvid = $rootnode->value('pvid');
print "pvid: $pvid \n";
my $lang = $rootnode->value('metadata.language');
print "lang: ##$lang##\n";
my $country = $rootnode->value('metadata.country');
print "country: $country \n";
my $sql = "insert into productdetail values ('us', $lang, '01_7', 'prod_descr', 'prod_short_descr', 'tag_line', 'features','benifits','sys_req')";
print "$sql\n";
my $sth=$dbh->prepare($sql);
$sth->execute();
if( ($dbh->errstr eq "") || ($sth->errstr() eq "") ){
print "inserted row successfully \n";
$sth->finish();
#$dbh->disconnect;
}
else {
print "Error inserting \n";
print "Error inserting to database: Error $DBI::err - $DBI::errstr\n";
$sth->finish();
$dbh->disconnect;
}
[/html]
Please let me know if anybody have any idea?