I know this is basic a stupid, am sorry.
I am retrieving a value from a table and I need to divide it by another value that I have retrieved.
The current code does not work.
I am trying to define $rev[0] and $vConv to both be of a length of 10 and a decimal precission of 4. With that result going into $field[23]. Do I need to define each separately then do the math?
I am retrieving a value from a table and I need to divide it by another value that I have retrieved.
The current code does not work.
Code:
# read POVAGRMTLN table
my $stmt = "SELECT POVAGRMTLN.BASE_COST
FROM LAWSON.POVAGRMTLN
WHERE POVAGRMTLN.PROCURE_GROUP = '" . $vVendGr . "' AND
POVAGRMTLN.ITEM = '" . $vItem . "' AND
POVAGRMTLN.HOLD_FLAG = '" . $vFlag . "'";
my @rev = $dbh->selectrow_array($stmt);
$field[23] = printf "%10.4f"($rev[0] / $vConv);
print OU2 join('|', $vItem, $vConv, $field[23], "\n");
I am trying to define $rev[0] and $vConv to both be of a length of 10 and a decimal precission of 4. With that result going into $field[23]. Do I need to define each separately then do the math?