It's really difficult to tell what's going on here without a self-contained example. Without understanding what the problem is, it's difficult to propose a solution.
I'll take a shot at it, though .. your select statement
my $sth = $dbh->prepare(
"select CAST('STARTEND' AS String) as COLA, 'STARTEND' PEPSI")
or die "prepare statement failed: $dbh->errstr()";
doesn't seem right. I expect the SQL parser would complain about the second column
'STARTEND' PEPSI. It could be that's the source of the 'STA', though.
Please update your post (leaving the original the way it is, or by replying to this post) with a clearer example of what's going on.
Alex / talexb / Toronto
Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.