I want to use placeholder for date(3-01-2017) in below query..how to do that ?below is the query i am using in my script using DBI .
$sth = $dbh->prepare("select CODE_ID,NAME_CODE,SUM(INR_COL + OUT_COL) AS \"TOTAL SUM\"from nwsa where trunc(REPORT_DATE)=to_date('3-01-2017,'dd-mm-yyyy) AND (CODE_ID='A12A' OR CODE_ID='A12B'OR CODE_ID='A12C' OR CODE_ID='A12D' OR CODE_ID='A12E' OR CODE_ID='A12EB' OR CODE_ID='A12F' OR CODE_ID='A12G' OR CODE_ID='A12I' OR CODE_ID='A12O' OR CODE_ID='A12U' ) group by CODE_ID,NAME_CODE"); # your query here
$sth->execute( );
----this is my complete query ---
SUM(INR_COL + OUT_COL) AS "TOTAL SUM"
FROM nwsa
WHERE trunc(REPORT_DATE) = to_date('3-01-2017','dd-mm-yyyy')
AND (CODE_ID='A12A'
OR CODE_ID ='A12B'
OR CODE_ID ='A12C'
OR CODE_ID ='A12D'
OR CODE_ID ='A12E'
OR CODE_ID ='A12EB'
OR CODE_ID ='A12F'
OR CODE_ID ='A12G'
OR CODE_ID ='A12I'
OR CODE_ID ='A12O'
OR CODE_ID ='A12U')
GROUP BY CODE_ID,
NAME_CODE
;