ODBC Driver for ServiceNow

Build 23.0.8839

データの変更

次のコード例は、データ変更ステートメントの使い方を示します。

更新手順

odbc_exec を使用して、データ変更ステートメントを実行できます。これは影響を受けた行数を含むリソースを返します。

INSERT

更新を挿入するには:

$result = odbc_exec($cnx, "INSERT INTO incident (priority) VALUES ('4')");
$affected = odbc_num_rows($result);

UPDATE

更新を取得するには:

$result = odbc_exec($cnx, "UPDATE incident SET priority = '4' WHERE category = 'request'");
$affected = odbc_num_rows($result);

DELETE

更新を削除するには:

$result = odbc_exec($cnx, "DELETE FROM incident WHERE sys_id = 'S'");
$affected = odbc_num_rows($result);

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 23.0.8839