ODBC Driver for Smaregi

Build 23.0.8839

StorageInfo

発注情報:発注

Select

本製品 は Smaregi API を使用して、WHERE 句条件と選択されたカラムを処理します。LIKE(date およびdateTime データ型のカラムの場合)およびIN 演算子は、クライアント側で処理されます。 =、!=、<>、>、<、>=、<=、AND、LIKE、ORDER BY 演算子は、サーバー側で処理されます。 例えば、次のクエリはサーバー側で処理されます。

SELECT * FROM StorageInfo WHERE  StorageInfoId = 8

SELECT OrderedDate FROM StorageInfo WHERE Status = 2

Insert

StorageInfo を追加するには、Status、IdentificationNo、DeliveryAggregate およびDeliveryProductAggregate フィールドを指定します。

テンポラリテーブルの使用:

INSERT INTO StorageInfoDeliveries#TEMP (StorageStoreId, storageExpectedDateTo, StorageExpectedDateFrom) VALUES (2, '2019-10-11', '2019-10-1')
INSERT INTO StorageInfoDeliveryProducts#TEMP (StoreId, ProductId, Quantity) VALUES (2, 1, 12)
INSERT INTO StorageInfo (Status, IdentificationNo, DeliveryAggregate, DeliveryProductAggregate) VALUES (2, 'test1', 'StorageInfoDeliveries#TEMP', 'StorageInfoDeliveryProducts#TEMP')

集計の使用:

INSERT INTO StorageInfo (Status, IdentificationNo, DeliveryAggregate, DeliveryProductAggregate, ProductAggregate) VALUES (2, '2111', '    {
      "table_name": "StorageInfoDelivery",
      "rows": [
        {
          "storageExpectedDateFrom": "2019-10-21",
          "storageExpectedDateTo": "2019-12-21",
          "storageStoreId": "1"
        }
      ]
    }
', '    {
      "table_name": "StorageInfoDeliveryProduct",
      "rows": [
        {
          "storeId": "1",
          "productId": "1",
          "quantity": "1"
        }
      ]
    }
', '    {
      "table_name": "StorageInfoProduct",
      "rows": [
        {
          "productId": "1",
          "cost": "324"
        }
      ]
    }
')

NOTE:レコードがすでに存在する場合、挿入は成功せず、ドライバーは影響を受けた行を0 行返します。

Upsert

アップサートは、このテーブルではサポートされていません。

Update

スマレジはRecipientOrderId、OrderedDate、Status およびIdentificationNo カラムの更新を許容します。

INSERT INTO StorageInfoDeliveries#TEMP (StorageInfoId, StorageStoreId, storageExpectedDateTo, StorageExpectedDateFrom) VALUES (22, 1, '2019-12-11', '2019-12-1')
UPDATE StorageInfo SET IdentificationNo = 'Updated', status = 2, DeliveryAggregate = 'StorageInfoDeliveries#TEMP' WHERE StorageInfoId = 22

Delete

StorageInfo は、StorageInfoId を指定することで削除できます。

DELETE FROM StorageInfo WHERE StorageInfoId = 7

Bulk Delete


INSERT INTO StorageInfo#TEMP (StorageInfoId) VALUES (9);
INSERT INTO StorageInfo#TEMP (StorageInfoId) VALUES (6);
DELETE FROM StorageInfo WHERE EXISTS SELECT StorageInfoId FROM StorageInfo#TEMP

Columns

Name Type ReadOnly References Description
StorageInfoId [KEY] Integer False

発注ID (PK) : 発注毎に付与するID。【自動更新】自動採番状態が仮発注、商品分配済のもののみ削除可。状態が商品配分済の場合、発注商品の原価のみ編集可。状態が仮発注の場合、すべての項目の編集可。上記以外の状態のものを編集、削除するとエラー。

RecipientOrderId Integer False

発注先ID : 数字10文字以内。発注先となる仕入先IDを設定。存在しない仕入先を指定するとエラー。仮発注の場合のみ、更新可。

OrderedDate Date False

発注日 : 発注日を設定。(YYYY-MM-DD形式)登録時必須。仮発注の場合のみ、更新可。

Status Integer False

状態 : 状態を設定。2:商品分配済、3:入荷検品中、4:入荷完了、5:仮発注商品分配済, 仮発注以外を設定するとエラー。商品分配済を設定すると入荷情報を作成する。仮発注の場合のみ、更新可。

Memo String False

IdentificationNo String False

識別番号 : 発注情報を管理するための任意の文字列を設定出来る項目。

Modified Datetime True

更新日時 : 発注の更新日時。 (YYYY-MM-DD HH:MM:SS形式)

Token String False

トークン : リクエストを一意に識別するためのトークン文字列を設定。重複するトークン文字列が指定された場合、スルーします。設定例:リクエスト日時(YYYYMMDDHHMMSS)+2桁の連番

DeliveryAggregate String False

A JSON aggregate of deliveries associated with the storage info.

ProductAggregate String False

A JSON aggregate of products associated with the storage info product.

DeliveryProductAggregate String False

A JSON aggregate of products associated with the storage info delivery.

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