我收到ORA-00917:在下面標記的行缺少逗號警告,這表明這是在我的查詢中發生的。但是,我經常查詢了很多次,似乎找不到這個「缺失的逗號」。感謝您的時間。PHP到Oracle日期警告
if(isset($_POST['submit']))
{
$db = oci_connect('user', 'password, "server/host");
$Notes = kFile($_POST["notes"]);
if(empty($_POST["composite"])){$composite = "No";}else{$composite = "Yes";}
$techName = $_POST['techName'];
$setupDate = $_POST['setupdate'];
$removalDate = $_POST['removaldate'];
$startDate = $_POST['startdate'];
$stopDate = $_POST['stopdate'];
$sampleLocation = $_POST['samplelocation'];
$serialN = $_POST['serialn'];
$filterN = $_POST['filtern'];
$initialFlow = $_POST['initialflow'];
$timerStop = $_POST['timerstop'];
$finalFlow = $_POST['finalflow'];
$timerStart = $_POST['timerstart'];
$finalWeight = $_POST['finalweight'];
$temperature = $_POST['temperature'];
$initialWeight = $_POST['initialweight'];
$atmPressure = $_POST['atmpressure'];
$filterLoad = $_POST['filterload'];
$query = "INSERT INTO DATA(
TECHNICIAN_NAME,
SAMPLE_LOCATION,
SERIAL_NUM,
FILTER_NUM,
START_DATE,
START_TIME,
STOP_DATE,
STOP_TIME,
INITIAL_FLOW,
FINAL_FLOW,
TIMER_STOP,
TIMER_START,
FINAL_WEIGHT,
INITIAL_WEIGHT,
TEMPERATURE,
ATM_PRESSURE,
COMMENTS,
NOT_IN_COMPOSITE,
FILTER_LOAD,
SET_UP_DATE,
REMOVAL_DATE)
VALUES(
:name, :sample, :serial, :filter, TO_DATE(:startDate, 'mm/dd/yyyy'), TO_DATE(:startTime, 'mm/dd/yyyy'),
TO_DATE(:stopDate, 'mm/dd/yyyy'), TO_DATE(:stopTime, 'mm/dd/yyyy'), :initialFlow, :finalFlow, :timerStop,
:timerStart, :finalWeight, :initialWeight, :temperature, :atmPressure,
:comments, :composite, :filterLoad, TO_DATE(:setup, 'mm/dd/yyyy'), TO_DATE(:removal, 'mm/dd/yyyy'))";
$compiled = oci_parse($db, $query);
oci_bind_by_name($compiled, ':name', $techName);
oci_bind_by_name($compiled, ':sample', $sampleLocation);
oci_bind_by_name($compiled, ':serial', $serialN);
oci_bind_by_name($compiled, ':filter', $filterN);
oci_bind_by_name($compiled, ':startDate', $startDate);
oci_bind_by_name($compiled, ':startTime', $startDate); //redundant check db
oci_bind_by_name($compiled, ':stopDate', $stopDate);
oci_bind_by_name($compiled, ':stopTime', $stopDate); //redundant check db
oci_bind_by_name($compiled, ':initialFlow', $initialFlow);
oci_bind_by_name($compiled, ':finalFlow', $finalFlow);
oci_bind_by_name($compiled, ':timerStop', $timerStop);
oci_bind_by_name($compiled, ':timerStart', $timerStart);
oci_bind_by_name($compiled, ':finalWeight', $finalWeight);
oci_bind_by_name($compiled, ':initialWeight', $initialWeight);
oci_bind_by_name($compiled, ':temperature', $temperature);
oci_bind_by_name($compiled, ':atmPressure', $atmPressure);
oci_bind_by_name($compiled, ':comments', $kosterNotes);
oci_bind_by_name($compiled, ':composite', $composite);
oci_bind_by_name($compiled, ':filterLoad', $filterLoad);
oci_bind_by_name($compiled, ':setup', $setupDate);
oci_bind_by_name($compiled, ':removal', $removalDate);
oci_execute($compiled); //warning occurs here
echo "Did I execute?";
}
感謝您尋找 「警告:缺少逗號 oci_execute()[function.oci-執行]:ORA-00917」。
你沒有關閉最終支架....和Oracle仍然希望你一定的值,因此告訴你*缺少逗號* – 2014-09-24 19:24:01