Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(SQL Server) Square API - Batch Upsert Catalog ObjectsCreates or updates up to 10,000 target objects based on the provided list of objects. The target objects are grouped into batches and each batch is inserted/updated in an all-or-nothing manner. For more information, see https://developer.squareup.com/reference/square/catalog-api/batch-upsert-catalog-objects
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls. -- CREATE PROCEDURE ChilkatSample AS BEGIN DECLARE @hr int DECLARE @iTmp0 int -- Important: Do not use nvarchar(max). See the warning about using nvarchar(max). DECLARE @sTmp0 nvarchar(4000) -- This example assumes the Chilkat API to have been previously unlocked. -- See Global Unlock Sample for sample code. DECLARE @http int -- Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT IF @hr <> 0 BEGIN PRINT 'Failed to create ActiveX component' RETURN END DECLARE @success int -- Use this online tool to generate code from sample JSON: -- Generate Code to Create JSON -- The following JSON is sent in the request body. -- { -- "idempotency_key": "789ff020-f723-43a9-b4b5-43b5dc1fa3dc", -- "batches": [ -- { -- "objects": [ -- { -- "type": "ITEM", -- "id": "#Tea", -- "present_at_all_locations": true, -- "item_data": { -- "name": "Tea", -- "description": "Hot Leaf Juice", -- "category_id": "#Beverages", -- "tax_ids": [ -- "#SalesTax" -- ], -- "variations": [ -- { -- "type": "ITEM_VARIATION", -- "id": "#Tea_Mug", -- "present_at_all_locations": true, -- "item_variation_data": { -- "item_id": "#Tea", -- "name": "Mug", -- "pricing_type": "FIXED_PRICING", -- "price_money": { -- "amount": 150, -- "currency": "USD" -- } -- } -- } -- ] -- } -- }, -- { -- "type": "ITEM", -- "id": "#Coffee", -- "present_at_all_locations": true, -- "item_data": { -- "name": "Coffee", -- "description": "Hot Bean Juice", -- "category_id": "#Beverages", -- "tax_ids": [ -- "#SalesTax" -- ], -- "variations": [ -- { -- "type": "ITEM_VARIATION", -- "id": "#Coffee_Regular", -- "present_at_all_locations": true, -- "item_variation_data": { -- "item_id": "#Coffee", -- "name": "Regular", -- "pricing_type": "FIXED_PRICING", -- "price_money": { -- "amount": 250, -- "currency": "USD" -- } -- } -- }, -- { -- "type": "ITEM_VARIATION", -- "id": "#Coffee_Large", -- "present_at_all_locations": true, -- "item_variation_data": { -- "item_id": "#Coffee", -- "name": "Large", -- "pricing_type": "FIXED_PRICING", -- "price_money": { -- "amount": 350, -- "currency": "USD" -- } -- } -- } -- ] -- } -- }, -- { -- "type": "CATEGORY", -- "id": "#Beverages", -- "present_at_all_locations": true, -- "category_data": { -- "name": "Beverages" -- } -- }, -- { -- "type": "TAX", -- "id": "#SalesTax", -- "present_at_all_locations": true, -- "tax_data": { -- "name": "Sales Tax", -- "calculation_phase": "TAX_SUBTOTAL_PHASE", -- "inclusion_type": "ADDITIVE", -- "percentage": "5.0", -- "applies_to_custom_amounts": true, -- "enabled": true -- } -- } -- ] -- } -- ] -- } DECLARE @i int DECLARE @j int DECLARE @k int DECLARE @json int -- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @json OUT EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'idempotency_key', '789ff020-f723-43a9-b4b5-43b5dc1fa3dc' SELECT @i = 0 EXEC sp_OASetProperty @json, 'I', @i SELECT @j = 0 EXEC sp_OASetProperty @json, 'J', @j EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].type', 'ITEM' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].id', '#Tea' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'batches[i].objects[j].present_at_all_locations', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.name', 'Tea' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.description', 'Hot Leaf Juice' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.category_id', '#Beverages' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.tax_ids[0]', '#SalesTax' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.variations[0].type', 'ITEM_VARIATION' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.variations[0].id', '#Tea_Mug' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'batches[i].objects[j].item_data.variations[0].present_at_all_locations', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.variations[0].item_variation_data.item_id', '#Tea' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.variations[0].item_variation_data.name', 'Mug' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.variations[0].item_variation_data.pricing_type', 'FIXED_PRICING' EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'batches[i].objects[j].item_data.variations[0].item_variation_data.price_money.amount', 150 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.variations[0].item_variation_data.price_money.currency', 'USD' SELECT @j = @j + 1 EXEC sp_OASetProperty @json, 'J', @j EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].type', 'ITEM' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].id', '#Coffee' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'batches[i].objects[j].present_at_all_locations', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.name', 'Coffee' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.description', 'Hot Bean Juice' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.category_id', '#Beverages' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.tax_ids[0]', '#SalesTax' SELECT @k = 0 EXEC sp_OASetProperty @json, 'K', @k EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.variations[k].type', 'ITEM_VARIATION' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.variations[k].id', '#Coffee_Regular' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'batches[i].objects[j].item_data.variations[k].present_at_all_locations', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.variations[k].item_variation_data.item_id', '#Coffee' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.variations[k].item_variation_data.name', 'Regular' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.variations[k].item_variation_data.pricing_type', 'FIXED_PRICING' EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'batches[i].objects[j].item_data.variations[k].item_variation_data.price_money.amount', 250 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.variations[k].item_variation_data.price_money.currency', 'USD' SELECT @k = @k + 1 EXEC sp_OASetProperty @json, 'K', @k EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.variations[k].type', 'ITEM_VARIATION' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.variations[k].id', '#Coffee_Large' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'batches[i].objects[j].item_data.variations[k].present_at_all_locations', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.variations[k].item_variation_data.item_id', '#Coffee' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.variations[k].item_variation_data.name', 'Large' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.variations[k].item_variation_data.pricing_type', 'FIXED_PRICING' EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'batches[i].objects[j].item_data.variations[k].item_variation_data.price_money.amount', 350 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].item_data.variations[k].item_variation_data.price_money.currency', 'USD' SELECT @j = @j + 1 EXEC sp_OASetProperty @json, 'J', @j EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].type', 'CATEGORY' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].id', '#Beverages' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'batches[i].objects[j].present_at_all_locations', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].category_data.name', 'Beverages' SELECT @j = @j + 1 EXEC sp_OASetProperty @json, 'J', @j EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].type', 'TAX' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].id', '#SalesTax' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'batches[i].objects[j].present_at_all_locations', 1 EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].tax_data.name', 'Sales Tax' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].tax_data.calculation_phase', 'TAX_SUBTOTAL_PHASE' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].tax_data.inclusion_type', 'ADDITIVE' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'batches[i].objects[j].tax_data.percentage', '5.0' EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'batches[i].objects[j].tax_data.applies_to_custom_amounts', 1 EXEC sp_OAMethod @json, 'UpdateBool', @success OUT, 'batches[i].objects[j].tax_data.enabled', 1 -- Adds the "Authorization: Bearer ACCESS_TOKEN" header. EXEC sp_OASetProperty @http, 'AuthToken', 'ACCESS_TOKEN' EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'Square-Version', '2020-07-22' EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'Content-Type', 'application/json' -- This example uses the sandbox: connect.squareupsandbox.com -- Production should use connect.squareup.com DECLARE @resp int EXEC sp_OAMethod @http, 'PostJson3', @resp OUT, 'https://connect.squareupsandbox.com/v2/catalog/batch-upsert', 'application/json', @json EXEC sp_OAGetProperty @http, 'LastMethodSuccess', @iTmp0 OUT IF @iTmp0 = 0 BEGIN EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT PRINT @sTmp0 EXEC @hr = sp_OADestroy @http EXEC @hr = sp_OADestroy @json RETURN END DECLARE @sbResponseBody int -- Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.StringBuilder', @sbResponseBody OUT EXEC sp_OAMethod @resp, 'GetBodySb', @success OUT, @sbResponseBody DECLARE @jResp int -- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @jResp OUT EXEC sp_OAMethod @jResp, 'LoadSb', @success OUT, @sbResponseBody EXEC sp_OASetProperty @jResp, 'EmitCompact', 0 PRINT 'Response Body:' EXEC sp_OAMethod @jResp, 'Emit', @sTmp0 OUT PRINT @sTmp0 DECLARE @respStatusCode int EXEC sp_OAGetProperty @resp, 'StatusCode', @respStatusCode OUT PRINT 'Response Status Code = ' + @respStatusCode IF @respStatusCode >= 400 BEGIN PRINT 'Response Header:' EXEC sp_OAGetProperty @resp, 'Header', @sTmp0 OUT PRINT @sTmp0 PRINT 'Failed.' EXEC @hr = sp_OADestroy @resp EXEC @hr = sp_OADestroy @http EXEC @hr = sp_OADestroy @json EXEC @hr = sp_OADestroy @sbResponseBody EXEC @hr = sp_OADestroy @jResp RETURN END EXEC @hr = sp_OADestroy @resp -- Sample JSON response: -- (Sample code for parsing the JSON response is shown below) -- { -- "objects": [ -- { -- "type": "ITEM", -- "id": "ZSDZN34NAXDLC6D5ZQMNSOUM", -- "updated_at": "2017-05-10T18:48:39.798Z", -- "version": 1494442119798, -- "is_deleted": false, -- "present_at_all_locations": true, -- "item_data": { -- "name": "Tea", -- "description": "Hot Leaf Juice", -- "category_id": "LYT72K3WGJFFCIMB63XARP3I", -- "tax_ids": [ -- "XHSHLHNWSI3HVI4BW5ZUZXI3" -- ], -- "variations": [ -- { -- "type": "ITEM_VARIATION", -- "id": "NAYHET5R52MIYCEF34ZMAHFM", -- "updated_at": "2017-05-10T18:48:39.798Z", -- "version": 1494442119798, -- "is_deleted": false, -- "present_at_all_locations": true, -- "item_variation_data": { -- "item_id": "ZSDZN34NAXDLC6D5ZQMNSOUM", -- "name": "Mug", -- "ordinal": 0, -- "pricing_type": "FIXED_PRICING", -- "price_money": { -- "amount": 150, -- "currency": "USD" -- } -- } -- } -- ] -- } -- }, -- { -- "type": "ITEM", -- "id": "PJMCEBHHUS3OKDB6PYUHLCPP", -- "updated_at": "2017-05-10T18:48:39.798Z", -- "version": 1494442119798, -- "is_deleted": false, -- "present_at_all_locations": true, -- "item_data": { -- "name": "Coffee", -- "description": "Hot Bean Juice", -- "category_id": "LYT72K3WGJFFCIMB63XARP3I", -- "tax_ids": [ -- "XHSHLHNWSI3HVI4BW5ZUZXI3" -- ], -- "variations": [ -- { -- "type": "ITEM_VARIATION", -- "id": "OTYDX45SPG7LJQUVCBZI4INH", -- "updated_at": "2017-05-10T18:48:39.798Z", -- "version": 1494442119798, -- "is_deleted": false, -- "present_at_all_locations": true, -- "item_variation_data": { -- "item_id": "PJMCEBHHUS3OKDB6PYUHLCPP", -- "name": "Regular", -- "ordinal": 0, -- "pricing_type": "FIXED_PRICING", -- "price_money": { -- "amount": 250, -- "currency": "USD" -- } -- } -- }, -- { -- "type": "ITEM_VARIATION", -- "id": "GZDA3JB37FYVOPI4AOEBOITI", -- "updated_at": "2017-05-10T18:48:39.798Z", -- "version": 1494442119798, -- "is_deleted": false, -- "present_at_all_locations": true, -- "item_variation_data": { -- "item_id": "PJMCEBHHUS3OKDB6PYUHLCPP", -- "name": "Large", -- "ordinal": 1, -- "pricing_type": "FIXED_PRICING", -- "price_money": { -- "amount": 350, -- "currency": "USD" -- } -- } -- } -- ] -- } -- }, -- { -- "type": "CATEGORY", -- "id": "LYT72K3WGJFFCIMB63XARP3I", -- "updated_at": "2017-05-10T18:48:39.798Z", -- "version": 1494442119798, -- "is_deleted": false, -- "present_at_all_locations": true, -- "category_data": { -- "name": "Beverages" -- } -- }, -- { -- "type": "TAX", -- "id": "XHSHLHNWSI3HVI4BW5ZUZXI3", -- "updated_at": "2017-05-10T18:48:39.798Z", -- "version": 1494442119798, -- "is_deleted": false, -- "present_at_all_locations": true, -- "tax_data": { -- "name": "Sales Tax", -- "calculation_phase": "TAX_SUBTOTAL_PHASE", -- "inclusion_type": "ADDITIVE", -- "percentage": "5.0", -- "applies_to_custom_amounts": true, -- "enabled": true -- } -- } -- ], -- "id_mappings": [ -- { -- "client_object_id": "#Tea", -- "object_id": "ZSDZN34NAXDLC6D5ZQMNSOUM" -- }, -- { -- "client_object_id": "#Coffee", -- "object_id": "PJMCEBHHUS3OKDB6PYUHLCPP" -- }, -- { -- "client_object_id": "#Beverages", -- "object_id": "LYT72K3WGJFFCIMB63XARP3I" -- }, -- { -- "client_object_id": "#SalesTax", -- "object_id": "XHSHLHNWSI3HVI4BW5ZUZXI3" -- }, -- { -- "client_object_id": "#Tea_Mug", -- "object_id": "NAYHET5R52MIYCEF34ZMAHFM" -- }, -- { -- "client_object_id": "#Coffee_Regular", -- "object_id": "OTYDX45SPG7LJQUVCBZI4INH" -- }, -- { -- "client_object_id": "#Coffee_Large", -- "object_id": "GZDA3JB37FYVOPI4AOEBOITI" -- } -- ] -- } -- Sample code for parsing the JSON response... -- Use the following online tool to generate parsing code from sample JSON: -- Generate Parsing Code from JSON DECLARE @v_type nvarchar(4000) DECLARE @id nvarchar(4000) DECLARE @updated_at nvarchar(4000) DECLARE @version int DECLARE @is_deleted int DECLARE @present_at_all_locations int DECLARE @item_dataName nvarchar(4000) DECLARE @item_dataDescription nvarchar(4000) DECLARE @item_dataCategory_id nvarchar(4000) DECLARE @category_dataName nvarchar(4000) DECLARE @tax_dataName nvarchar(4000) DECLARE @tax_dataCalculation_phase nvarchar(4000) DECLARE @tax_dataInclusion_type nvarchar(4000) DECLARE @tax_dataPercentage nvarchar(4000) DECLARE @tax_dataApplies_to_custom_amounts int DECLARE @tax_dataEnabled int DECLARE @count_j int DECLARE @strVal nvarchar(4000) DECLARE @item_variation_dataItem_id nvarchar(4000) DECLARE @item_variation_dataName nvarchar(4000) DECLARE @item_variation_dataOrdinal int DECLARE @item_variation_dataPricing_type nvarchar(4000) DECLARE @item_variation_dataPrice_moneyAmount int DECLARE @item_variation_dataPrice_moneyCurrency nvarchar(4000) DECLARE @client_object_id nvarchar(4000) DECLARE @object_id nvarchar(4000) SELECT @i = 0 DECLARE @count_i int EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'objects' WHILE @i < @count_i BEGIN EXEC sp_OASetProperty @jResp, 'I', @i EXEC sp_OAMethod @jResp, 'StringOf', @v_type OUT, 'objects[i].type' EXEC sp_OAMethod @jResp, 'StringOf', @id OUT, 'objects[i].id' EXEC sp_OAMethod @jResp, 'StringOf', @updated_at OUT, 'objects[i].updated_at' EXEC sp_OAMethod @jResp, 'IntOf', @version OUT, 'objects[i].version' EXEC sp_OAMethod @jResp, 'BoolOf', @is_deleted OUT, 'objects[i].is_deleted' EXEC sp_OAMethod @jResp, 'BoolOf', @present_at_all_locations OUT, 'objects[i].present_at_all_locations' EXEC sp_OAMethod @jResp, 'StringOf', @item_dataName OUT, 'objects[i].item_data.name' EXEC sp_OAMethod @jResp, 'StringOf', @item_dataDescription OUT, 'objects[i].item_data.description' EXEC sp_OAMethod @jResp, 'StringOf', @item_dataCategory_id OUT, 'objects[i].item_data.category_id' EXEC sp_OAMethod @jResp, 'StringOf', @category_dataName OUT, 'objects[i].category_data.name' EXEC sp_OAMethod @jResp, 'StringOf', @tax_dataName OUT, 'objects[i].tax_data.name' EXEC sp_OAMethod @jResp, 'StringOf', @tax_dataCalculation_phase OUT, 'objects[i].tax_data.calculation_phase' EXEC sp_OAMethod @jResp, 'StringOf', @tax_dataInclusion_type OUT, 'objects[i].tax_data.inclusion_type' EXEC sp_OAMethod @jResp, 'StringOf', @tax_dataPercentage OUT, 'objects[i].tax_data.percentage' EXEC sp_OAMethod @jResp, 'BoolOf', @tax_dataApplies_to_custom_amounts OUT, 'objects[i].tax_data.applies_to_custom_amounts' EXEC sp_OAMethod @jResp, 'BoolOf', @tax_dataEnabled OUT, 'objects[i].tax_data.enabled' SELECT @j = 0 EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'objects[i].item_data.tax_ids' WHILE @j < @count_j BEGIN EXEC sp_OASetProperty @jResp, 'J', @j EXEC sp_OAMethod @jResp, 'StringOf', @strVal OUT, 'objects[i].item_data.tax_ids[j]' SELECT @j = @j + 1 END SELECT @j = 0 EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'objects[i].item_data.variations' WHILE @j < @count_j BEGIN EXEC sp_OASetProperty @jResp, 'J', @j EXEC sp_OAMethod @jResp, 'StringOf', @v_type OUT, 'objects[i].item_data.variations[j].type' EXEC sp_OAMethod @jResp, 'StringOf', @id OUT, 'objects[i].item_data.variations[j].id' EXEC sp_OAMethod @jResp, 'StringOf', @updated_at OUT, 'objects[i].item_data.variations[j].updated_at' EXEC sp_OAMethod @jResp, 'IntOf', @version OUT, 'objects[i].item_data.variations[j].version' EXEC sp_OAMethod @jResp, 'BoolOf', @is_deleted OUT, 'objects[i].item_data.variations[j].is_deleted' EXEC sp_OAMethod @jResp, 'BoolOf', @present_at_all_locations OUT, 'objects[i].item_data.variations[j].present_at_all_locations' EXEC sp_OAMethod @jResp, 'StringOf', @item_variation_dataItem_id OUT, 'objects[i].item_data.variations[j].item_variation_data.item_id' EXEC sp_OAMethod @jResp, 'StringOf', @item_variation_dataName OUT, 'objects[i].item_data.variations[j].item_variation_data.name' EXEC sp_OAMethod @jResp, 'IntOf', @item_variation_dataOrdinal OUT, 'objects[i].item_data.variations[j].item_variation_data.ordinal' EXEC sp_OAMethod @jResp, 'StringOf', @item_variation_dataPricing_type OUT, 'objects[i].item_data.variations[j].item_variation_data.pricing_type' EXEC sp_OAMethod @jResp, 'IntOf', @item_variation_dataPrice_moneyAmount OUT, 'objects[i].item_data.variations[j].item_variation_data.price_money.amount' EXEC sp_OAMethod @jResp, 'StringOf', @item_variation_dataPrice_moneyCurrency OUT, 'objects[i].item_data.variations[j].item_variation_data.price_money.currency' SELECT @j = @j + 1 END SELECT @i = @i + 1 END SELECT @i = 0 EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'id_mappings' WHILE @i < @count_i BEGIN EXEC sp_OASetProperty @jResp, 'I', @i EXEC sp_OAMethod @jResp, 'StringOf', @client_object_id OUT, 'id_mappings[i].client_object_id' EXEC sp_OAMethod @jResp, 'StringOf', @object_id OUT, 'id_mappings[i].object_id' SELECT @i = @i + 1 END EXEC @hr = sp_OADestroy @http EXEC @hr = sp_OADestroy @json EXEC @hr = sp_OADestroy @sbResponseBody EXEC @hr = sp_OADestroy @jResp END GO |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.