[英]Two queries in one statement
我正在使用php,並想在一個針對oracle的語句中運行兩個更新查詢。
$x = strtolower($x);
$ore = getOreType($x); //returns ore type as string
$newTotal = getMined($ore)-($x_value*$weight); //adds existing ore quantity to additional quantity
$newTotalComp = $x_value + getComponentQuantity($x); //adds existing component quantity to additional quantity
$query = "UPDATE Material SET quantity=$newTotal WHERE name='$ore'; UPDATE Component SET quantity=$newTotalComp WHERE name='$x'";
$statement = ociparse($conn, $query);
oci_execute($statement);
oci_free_statement($statement);
我在oci_execute上收到以下錯誤...。
oci_execute(): ORA-00911: invalid character
是否可以在同一條語句中運行兩個更新? 它可以在Oracle SQL Developer中使用。
鉭
嘗試像
$query = "UPDATE Material,Component
SET Material.quantity=$newTotal , Component.quantity=$newTotalComp
WHERE Material.name='$ore' AND Component.name='$x'";
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.