Chilkat Examples

ChilkatHOME.NET Core C#Android™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi ActiveXDelphi DLLGoJavaLianjaMono C#Node.jsObjective-CPHP ActiveXPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

SQL Server Web API Examples

Primary Categories

ABN AMRO
AWS Secrets Manager
AWS Security Token Service
AWS Translate
Activix CRM
Adyen
Alibaba Cloud OSS
Amazon Cognito
Amazon DynamoDB
Amazon MWS
Amazon Pay
Amazon Rekognition
Amazon SP-API
Amazon Voice ID
Aruba Fatturazione
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Backblaze S3
Banco Inter
Belgian eHealth Platform
Bitfinex v2 REST
Bluzone
BrickLink
Bunny CDN
CallRail
CardConnect
Cerved
ClickBank
Clickatell
Cloudfare
Constant Contact
DocuSign
Duo Auth MFA
ETrade
Ecwid
Egypt ITIDA
Egypt eReceipt
Etsy
Facebook
Faire
Frame.io
GeoOp
GetHarvest
Global Payments
Google People
Google Search Console
Google Translate
Google Vision
Hungary NAV Invoicing
IBM Text to Speech
Ibanity
IntakeQ
JCC Cyprus
Jira
Lightspeed
MYOB
Magento
Mailgun
Malaysia MyInvois

Mastercard
MedTunnel
MercadoLibre
MessageMedia
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Microsoft Teams
Moody's
Okta OAuth/OIDC
OneLogin OIDC
OneNote
OpenAI ChatGPT
PRODA
PayPal
Paynow.pl
Peoplevox
Populi
QuickBooks
Rabobank
Refinitiv
Royal Mail OBA
SCiS Schools Catalogue
SII Chile
SMSAPI
SOAP finkok.com
Salesforce
SendGrid
Shippo
Shopify
Shopware
Shopware 6
SimpleTexting
Square
Stripe
SugarCRM
TicketBAI
TikTok Shop
Trello
Twilio
Twitter API v2
Twitter v1
UPS
UniPin
VoiceBase
Vonage
WaTrend
Walmart v3
Wasabi
WhatsApp
WiX
WooCommerce
WordPress
Xero
Yahoo Mail
Yapily
Yousign
ZATCA
Zendesk
Zoom
_Miscellaneous_
eBay
effectconnect
hacienda.go.cr

 

 

 

(SQL Server) WooCommerce Create a Product

See more WooCommerce Examples

Demonstrates how to create a new product in WooCommerce.

For more information, see https://woocommerce.github.io/woocommerce-rest-api-docs/#create-a-product

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

-- 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

    -- Implements the following CURL command:

    -- curl -X POST https://example.com/wp-json/wc/v3/products \
    --     -u consumer_key:consumer_secret \
    --     -H "Content-Type: application/json" \
    --     -d '{
    --   "name": "Premium Quality",
    --   "type": "simple",
    --   "regular_price": "21.99",
    --   "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
    --   "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
    --   "categories": [
    --     {
    --       "id": 9
    --     },
    --     {
    --       "id": 14
    --     }
    --   ],
    --   "images": [
    --     {
    --       "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
    --     },
    --     {
    --       "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg"
    --     }
    --   ]
    -- }'

    -- Use the following online tool to generate HTTP code from a CURL command
    -- Convert a cURL Command to HTTP Source Code

    EXEC sp_OASetProperty @http, 'BasicAuth', 1
    EXEC sp_OASetProperty @http, 'Login', 'consumer_key'
    EXEC sp_OASetProperty @http, 'Password', 'consumer_secret'

    -- Use this online tool to generate code from sample JSON:
    -- Generate Code to Create JSON

    -- The following JSON is sent in the request body.

    -- {
    --   "name": "Premium Quality",
    --   "type": "simple",
    --   "regular_price": "21.99",
    --   "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
    --   "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
    --   "categories": [
    --     {
    --       "id": 9
    --     },
    --     {
    --       "id": 14
    --     }
    --   ],
    --   "images": [
    --     {
    --       "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
    --     },
    --     {
    --       "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg"
    --     }
    --   ]
    -- }

    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, 'name', 'Premium Quality'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'type', 'simple'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'regular_price', '21.99'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'description', 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'short_description', 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.'
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'categories[0].id', 9
    EXEC sp_OAMethod @json, 'UpdateInt', @success OUT, 'categories[1].id', 14
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'images[0].src', 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'images[1].src', 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg'

    EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'Content-Type', 'application/json'

    DECLARE @resp int
    EXEC sp_OAMethod @http, 'PostJson3', @resp OUT, 'https://example.com/wp-json/wc/v3/products', '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)

    -- {
    --   "id": 794,
    --   "name": "Premium Quality",
    --   "slug": "premium-quality-19",
    --   "permalink": "https://example.com/product/premium-quality-19/",
    --   "date_created": "2017-03-23T17:01:14",
    --   "date_created_gmt": "2017-03-23T20:01:14",
    --   "date_modified": "2017-03-23T17:01:14",
    --   "date_modified_gmt": "2017-03-23T20:01:14",
    --   "type": "simple",
    --   "status": "publish",
    --   "featured": false,
    --   "catalog_visibility": "visible",
    --   "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
    --   "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
    --   "sku": "",
    --   "price": "21.99",
    --   "regular_price": "21.99",
    --   "sale_price": "",
    --   "date_on_sale_from": null,
    --   "date_on_sale_from_gmt": null,
    --   "date_on_sale_to": null,
    --   "date_on_sale_to_gmt": null,
    --   "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>21.99</span>",
    --   "on_sale": false,
    --   "purchasable": true,
    --   "total_sales": 0,
    --   "virtual": false,
    --   "downloadable": false,
    --   "downloads": [
    --   ],
    --   "download_limit": -1,
    --   "download_expiry": -1,
    --   "external_url": "",
    --   "button_text": "",
    --   "tax_status": "taxable",
    --   "tax_class": "",
    --   "manage_stock": false,
    --   "stock_quantity": null,
    --   "stock_status": "instock",
    --   "backorders": "no",
    --   "backorders_allowed": false,
    --   "backordered": false,
    --   "sold_individually": false,
    --   "weight": "",
    --   "dimensions": {
    --     "length": "",
    --     "width": "",
    --     "height": ""
    --   },
    --   "shipping_required": true,
    --   "shipping_taxable": true,
    --   "shipping_class": "",
    --   "shipping_class_id": 0,
    --   "reviews_allowed": true,
    --   "average_rating": "0.00",
    --   "rating_count": 0,
    --   "related_ids": [
    --     53,
    --     40,
    --     56,
    --     479,
    --     99
    --   ],
    --   "upsell_ids": [
    --   ],
    --   "cross_sell_ids": [
    --   ],
    --   "parent_id": 0,
    --   "purchase_note": "",
    --   "categories": [
    --     {
    --       "id": 9,
    --       "name": "Clothing",
    --       "slug": "clothing"
    --     },
    --     {
    --       "id": 14,
    --       "name": "T-shirts",
    --       "slug": "t-shirts"
    --     }
    --   ],
    --   "tags": [
    --   ],
    --   "images": [
    --     {
    --       "id": 792,
    --       "date_created": "2017-03-23T14:01:13",
    --       "date_created_gmt": "2017-03-23T20:01:13",
    --       "date_modified": "2017-03-23T14:01:13",
    --       "date_modified_gmt": "2017-03-23T20:01:13",
    --       "src": "https://example.com/wp-content/uploads/2017/03/T_2_front-4.jpg",
    --       "name": "",
    --       "alt": ""
    --     },
    --     {
    --       "id": 793,
    --       "date_created": "2017-03-23T14:01:14",
    --       "date_created_gmt": "2017-03-23T20:01:14",
    --       "date_modified": "2017-03-23T14:01:14",
    --       "date_modified_gmt": "2017-03-23T20:01:14",
    --       "src": "https://example.com/wp-content/uploads/2017/03/T_2_back-2.jpg",
    --       "name": "",
    --       "alt": ""
    --     }
    --   ],
    --   "attributes": [
    --   ],
    --   "default_attributes": [
    --   ],
    --   "variations": [
    --   ],
    --   "grouped_products": [
    --   ],
    --   "menu_order": 0,
    --   "meta_data": [
    --   ],
    --   "_links": {
    --     "self": [
    --       {
    --         "href": "https://example.com/wp-json/wc/v3/products/794"
    --       }
    --     ],
    --     "collection": [
    --       {
    --         "href": "https://example.com/wp-json/wc/v3/products"
    --       }
    --     ]
    --   }
    -- }

    -- 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 @date_created int
    -- Use "Chilkat_9_5_0.DtObj" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.DtObj', @date_created OUT

    DECLARE @date_created_gmt int
    -- Use "Chilkat_9_5_0.DtObj" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.DtObj', @date_created_gmt OUT

    DECLARE @date_modified int
    -- Use "Chilkat_9_5_0.DtObj" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.DtObj', @date_modified OUT

    DECLARE @date_modified_gmt int
    -- Use "Chilkat_9_5_0.DtObj" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.DtObj', @date_modified_gmt OUT

    DECLARE @date_on_sale_from int
    -- Use "Chilkat_9_5_0.DtObj" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.DtObj', @date_on_sale_from OUT

    DECLARE @date_on_sale_from_gmt int
    -- Use "Chilkat_9_5_0.DtObj" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.DtObj', @date_on_sale_from_gmt OUT

    DECLARE @date_on_sale_to int
    -- Use "Chilkat_9_5_0.DtObj" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.DtObj', @date_on_sale_to OUT

    DECLARE @date_on_sale_to_gmt int
    -- Use "Chilkat_9_5_0.DtObj" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.DtObj', @date_on_sale_to_gmt OUT

    DECLARE @intVal int

    DECLARE @src nvarchar(4000)

    DECLARE @alt nvarchar(4000)

    DECLARE @href nvarchar(4000)

    DECLARE @id int
    EXEC sp_OAMethod @jResp, 'IntOf', @id OUT, 'id'
    DECLARE @name nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @name OUT, 'name'
    DECLARE @slug nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @slug OUT, 'slug'
    DECLARE @permalink nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @permalink OUT, 'permalink'
    EXEC sp_OAMethod @jResp, 'DtOf', @success OUT, 'date_created', 0, @date_created
    EXEC sp_OAMethod @jResp, 'DtOf', @success OUT, 'date_created_gmt', 0, @date_created_gmt
    EXEC sp_OAMethod @jResp, 'DtOf', @success OUT, 'date_modified', 0, @date_modified
    EXEC sp_OAMethod @jResp, 'DtOf', @success OUT, 'date_modified_gmt', 0, @date_modified_gmt
    DECLARE @v_type nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @v_type OUT, 'type'
    DECLARE @status nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @status OUT, 'status'
    DECLARE @featured int
    EXEC sp_OAMethod @jResp, 'BoolOf', @featured OUT, 'featured'
    DECLARE @catalog_visibility nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @catalog_visibility OUT, 'catalog_visibility'
    DECLARE @description nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @description OUT, 'description'
    DECLARE @short_description nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @short_description OUT, 'short_description'
    DECLARE @sku nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @sku OUT, 'sku'
    DECLARE @price nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @price OUT, 'price'
    DECLARE @regular_price nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @regular_price OUT, 'regular_price'
    DECLARE @sale_price nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @sale_price OUT, 'sale_price'
    EXEC sp_OAMethod @jResp, 'DtOf', @success OUT, 'date_on_sale_from', 0, @date_on_sale_from
    EXEC sp_OAMethod @jResp, 'DtOf', @success OUT, 'date_on_sale_from_gmt', 0, @date_on_sale_from_gmt
    EXEC sp_OAMethod @jResp, 'DtOf', @success OUT, 'date_on_sale_to', 0, @date_on_sale_to
    EXEC sp_OAMethod @jResp, 'DtOf', @success OUT, 'date_on_sale_to_gmt', 0, @date_on_sale_to_gmt
    DECLARE @price_html nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @price_html OUT, 'price_html'
    DECLARE @on_sale int
    EXEC sp_OAMethod @jResp, 'BoolOf', @on_sale OUT, 'on_sale'
    DECLARE @purchasable int
    EXEC sp_OAMethod @jResp, 'BoolOf', @purchasable OUT, 'purchasable'
    DECLARE @total_sales int
    EXEC sp_OAMethod @jResp, 'IntOf', @total_sales OUT, 'total_sales'
    DECLARE @virtual int
    EXEC sp_OAMethod @jResp, 'BoolOf', @virtual OUT, 'virtual'
    DECLARE @downloadable int
    EXEC sp_OAMethod @jResp, 'BoolOf', @downloadable OUT, 'downloadable'
    DECLARE @download_limit int
    EXEC sp_OAMethod @jResp, 'IntOf', @download_limit OUT, 'download_limit'
    DECLARE @download_expiry int
    EXEC sp_OAMethod @jResp, 'IntOf', @download_expiry OUT, 'download_expiry'
    DECLARE @external_url nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @external_url OUT, 'external_url'
    DECLARE @button_text nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @button_text OUT, 'button_text'
    DECLARE @tax_status nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @tax_status OUT, 'tax_status'
    DECLARE @tax_class nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @tax_class OUT, 'tax_class'
    DECLARE @manage_stock int
    EXEC sp_OAMethod @jResp, 'BoolOf', @manage_stock OUT, 'manage_stock'
    DECLARE @stock_quantity nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @stock_quantity OUT, 'stock_quantity'
    DECLARE @stock_status nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @stock_status OUT, 'stock_status'
    DECLARE @backorders nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @backorders OUT, 'backorders'
    DECLARE @backorders_allowed int
    EXEC sp_OAMethod @jResp, 'BoolOf', @backorders_allowed OUT, 'backorders_allowed'
    DECLARE @backordered int
    EXEC sp_OAMethod @jResp, 'BoolOf', @backordered OUT, 'backordered'
    DECLARE @sold_individually int
    EXEC sp_OAMethod @jResp, 'BoolOf', @sold_individually OUT, 'sold_individually'
    DECLARE @weight nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @weight OUT, 'weight'
    DECLARE @dimensionsLength nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @dimensionsLength OUT, 'dimensions.length'
    DECLARE @dimensionsWidth nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @dimensionsWidth OUT, 'dimensions.width'
    DECLARE @dimensionsHeight nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @dimensionsHeight OUT, 'dimensions.height'
    DECLARE @shipping_required int
    EXEC sp_OAMethod @jResp, 'BoolOf', @shipping_required OUT, 'shipping_required'
    DECLARE @shipping_taxable int
    EXEC sp_OAMethod @jResp, 'BoolOf', @shipping_taxable OUT, 'shipping_taxable'
    DECLARE @shipping_class nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @shipping_class OUT, 'shipping_class'
    DECLARE @shipping_class_id int
    EXEC sp_OAMethod @jResp, 'IntOf', @shipping_class_id OUT, 'shipping_class_id'
    DECLARE @reviews_allowed int
    EXEC sp_OAMethod @jResp, 'BoolOf', @reviews_allowed OUT, 'reviews_allowed'
    DECLARE @average_rating nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @average_rating OUT, 'average_rating'
    DECLARE @rating_count int
    EXEC sp_OAMethod @jResp, 'IntOf', @rating_count OUT, 'rating_count'
    DECLARE @parent_id int
    EXEC sp_OAMethod @jResp, 'IntOf', @parent_id OUT, 'parent_id'
    DECLARE @purchase_note nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @purchase_note OUT, 'purchase_note'
    DECLARE @menu_order int
    EXEC sp_OAMethod @jResp, 'IntOf', @menu_order OUT, 'menu_order'
    DECLARE @i int
    SELECT @i = 0
    DECLARE @count_i int
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'downloads'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'related_ids'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'IntOf', @intVal OUT, 'related_ids[i]'
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'upsell_ids'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'cross_sell_ids'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'categories'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'IntOf', @id OUT, 'categories[i].id'
        EXEC sp_OAMethod @jResp, 'StringOf', @name OUT, 'categories[i].name'
        EXEC sp_OAMethod @jResp, 'StringOf', @slug OUT, 'categories[i].slug'
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'tags'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'images'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'IntOf', @id OUT, 'images[i].id'
        EXEC sp_OAMethod @jResp, 'DtOf', @success OUT, 'images[i].date_created', 0, @date_created
        EXEC sp_OAMethod @jResp, 'DtOf', @success OUT, 'images[i].date_created_gmt', 0, @date_created_gmt
        EXEC sp_OAMethod @jResp, 'DtOf', @success OUT, 'images[i].date_modified', 0, @date_modified
        EXEC sp_OAMethod @jResp, 'DtOf', @success OUT, 'images[i].date_modified_gmt', 0, @date_modified_gmt
        EXEC sp_OAMethod @jResp, 'StringOf', @src OUT, 'images[i].src'
        EXEC sp_OAMethod @jResp, 'StringOf', @name OUT, 'images[i].name'
        EXEC sp_OAMethod @jResp, 'StringOf', @alt OUT, 'images[i].alt'
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'attributes'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'default_attributes'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'variations'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'grouped_products'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'meta_data'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, '_links.self'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'StringOf', @href OUT, '_links.self[i].href'
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, '_links.collection'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'StringOf', @href OUT, '_links.collection[i].href'
        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
    EXEC @hr = sp_OADestroy @date_created
    EXEC @hr = sp_OADestroy @date_created_gmt
    EXEC @hr = sp_OADestroy @date_modified
    EXEC @hr = sp_OADestroy @date_modified_gmt
    EXEC @hr = sp_OADestroy @date_on_sale_from
    EXEC @hr = sp_OADestroy @date_on_sale_from_gmt
    EXEC @hr = sp_OADestroy @date_on_sale_to
    EXEC @hr = sp_OADestroy @date_on_sale_to_gmt


END
GO

 

© 2000-2024 Chilkat Software, Inc. All Rights Reserved.