Hello Everyone,
I am trying to connect and execute a database query using the below code. The database gets connected and the query gets executed but when i try to fetch the result i get the below error.
DBD:

DBC::st fetchrow_array failed: [Oracle][ODBC]String data, right truncated.
(SQL-01004)(DBD: st_fetch/SQLFetch (long truncated DBI attribute LongTruncOk no
t set and/or LongReadLen too small) err=-1)
I am running the below code from cmd
#! C:\PROGRA~1\INTERW~1\TeamSite/iw-perl/bin/perl
#########################################################################
# File : news_fetch.ipl
#
# Description : This file connects to database and dynamically populates
# the field in press DCT.
# Author : Shalini Jain (Infosys Tech. Ltd., Chandigarh )
# Date : 20th Oct'2007
#########################################################################
use TeamSite::Config;
my $DCTpath ;
my $Country ;
my $Locale ;
my $uidfile = "C:/Program Files/Interwoven/TeamSite/httpd/iw-bin/Philips/crsc_navigation/DomainNews.cfg";
my $debug_file = "C:/testlogs/workflow2.log";
open(OUT, ">$debug_file");
BEGIN{
$ENV{ORACLE_HOME} = 'C:\oracle\ora92';
$ENV{ORA_NLS} = 'C:\oracle\ora92\ocommon\nls\ADMIN\DATA';
$ENV{path} = 'C:\Progra~1\Interwoven\TeamSite\iw-perl\bin\iwperl.exe;C:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin';
$ENV{perl} = 'C:\Progra~1\Interwoven\TeamSite\iw-perl\bin\iwperl.exe';
$ENV{SYSTEMROOT} = 'C:\WINDOWS'
};
############################## Modules #############################
use DBI;
use strict;
##################### Call the function below ####################
&get_fieldvalues();
sub get_fieldvalues{
######################## LOCAL VARIABLES ######################
my $db; # set up for the database connection
my $query1; # DB select statement to association table
my $sth; # the statement handle
my $dsn; # the data source
my $db_user_name; # the database username
my $db_password; # the database password
my $table_name; # the table name
my $column_key; # the column key (ISBN)
my $column_value; # the column value (name)
my $column_headingtext; # the column (heading_text)
my $column_headinglink; # the column (heading_link)
my $column_summarytext; # the column (summary_text)
my $where_column1; # the column (country)
my $where_column1_val; # the column (country value)
my $where_column2; # the column (locale)
my $where_column2_val; # the column (l)
my $where_column3; # the column (product division)
my $where_column3_val; # the column (l)
my $column_summarydate;
#$dsn = "RD1P";
#$db_user_name = "gmm_dev";
#$db_password = "dev_gmm";
$dsn = "Liveserver";
$db_user_name = "gmm_prod";
$db_password = "gmmapp";
$table_name = "news_summary";
$column_summarydate = "summary_date";
$column_headingtext = "heading_text";
$column_headinglink = "heading_hyperlink";
$column_summarytext = "summary_text";
$where_column1 = "country";
$where_column1_val = $Country;
$where_column2 = "locale";
$where_column2_val = $Locale;
$where_column3 = "product_division";
$where_column3_val = "gmm";
# Connect to the database
$db = DBI->connect("dbi

DBC:$dsn", "$db_user_name", "$db_password")
or die "Unable to open database connection $!";
$query1 = "SELECT summary_date,heading_text,heading_hyperlink,summary_text FROM news_summary WHERE country = 'au' AND locale = 'en' AND product_division = 'gmm' AND display = 'Y' ORDER BY trunc(summary_date) desc";
#$query1 = "SELECT TO_CHAR(TRUNC(summary_date), 'YYYY-MM-DD'),heading_text,heading_hyperlink,summary_text FROM (SELECT summary_date,heading_text,heading_hyperlink,summary_text FROM news_summary WHERE country = 'au' AND locale = 'en' AND product_division = 'gmm' AND display = 'Y' ORDER BY trunc(summary_date) desc ) WHERE rownum <= 3";
# Prepare and execute the statement
$sth = $db->prepare("$query1") or die "Couldn't prepare statement: " . $db->errstr;
$sth->execute() or die "$!";
my
@data;
while (
@data = $sth->fetchrow_array()) {
my $firstname = $data[1];
my $id = $data[2];
print "\t$id: $firstname $id\n";
}
$db->disconnect;
#print "status $db \n";
}
close OUT;
Thanks in advance.
Manish