[英]How to obtain the auto-generated ID from an item being Insterted in a Server Scripts, Windows Azure?
我有一個表,“計划”,其中包含幾列和插入時自動生成的 ID 列。 當我在插入服務器腳本中工作時,我怎么知道 ID?。 我正在開發 windows azure 移動服務。
function insert(item, user, request) {
//I want to know the ID of the new item to be inserted.
}
id 僅在項目插入數據庫時生成,並作為新屬性添加到item
參數中。 您可以通過在插入操作中指定對腳本的回調來訪問它:
function insert(item, user, request) {
request.execute({
success: function() {
var id = item.id;
console.log("The new item's id is: ", id);
request.respond();
}
});
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.