in reply to DBI : Strange Behaviour

I don't think you should quote a variable when using placeholders. Try
$scode ="1640039";
in your placeholder section.

Using placeholders is a recommended best practice, but if you insist on not using placeholders, you should also use the quote operator, rather than quote yourself. I assume the KIHON1 column is of type VARCHAR2. You don't need to quote if it's a NUMBER column.

my $scode = q{1640039}; my $sql = q{ SELECT KIHON3 FROM CBMSCP.VIEWCTC_FORMI1 WHERE KIHON1 = } + . $db->quote($scode);
--
Andreas