Cloud

Build 24.0.9175
  • Smaregi
    • Getting Started
      • Establishing a Connection
      • SSL Configuration
      • Firewall and Proxy
    • Data Model
      • Tables
        • BargainProducts
        • Bargains
        • BargainStores
        • Categories
        • Customers
        • Losses
        • ProductInventoryReservations
        • ProductPrices
        • ProductReserveItemLabels
        • ProductReserveItems
        • Products
        • ProductStores
        • Receivings
        • Shipments
        • Shippings
        • Staff
        • Stocks
        • StorageInfo
        • Storages
        • Stores
        • TransactionHeads
      • Views
        • DailySums
        • DailySumsSalesList
        • LossDetails
        • ReceivingDetails
        • ShipmentDetails
        • ShippingDetails
        • StaffStores
        • StockHistories
        • StocktakingDetails
        • StocktakingHeads
        • StocktakingInfo
        • StocktakingStockDetails
        • StorageDetails
        • StorageInfoDeliveries
        • StorageInfoDeliveryProducts
        • StorageInfoProducts
        • TransactionCoupons
        • TransactionDepositOthers
        • TransactionDetails
      • Stored Procedures
      • System Tables
        • sys_catalogs
        • sys_schemas
        • sys_tables
        • sys_tablecolumns
        • sys_procedures
        • sys_procedureparameters
        • sys_keycolumns
        • sys_foreignkeys
        • sys_primarykeys
        • sys_indexes
        • sys_connection_props
        • sys_sqlinfo
        • sys_identity
        • sys_information
    • Connection String Options
      • Authentication
        • AccessToken
        • ContractId
      • SSL
        • SSLServerCert
      • Logging
        • Verbosity
      • Schema
        • BrowsableSchemas
      • Miscellaneous
        • MaxRows
        • MaxThreads
        • Pagesize
        • PseudoColumns
        • Timeout

Smaregi - CData Cloud

Overview

CData Cloud offers access to Smaregi across several standard services and protocols, in a cloud-hosted solution. Any application that can connect to a MySQL or SQL Server database can connect to Smaregi through CData Cloud.

CData Cloud allows you to standardize and configure connections to Smaregi as though it were any other OData endpoint, or standard SQL Server/MySQL database.

Key Features

  • Full SQL Support: Smaregi appears as standard relational databases, allowing you to perform operations - Filter, Group, Join, etc. - using standard SQL, regardless of whether these operations are supported by the underlying API.
  • CRUD Support: Both read and write operations are supported, restricted only by security settings that you can configure in Cloud or downstream in the source itself.
  • Secure Access: The administrator can create users and define their access to specific databases and read-only operations or grant full read & write privileges.
  • Comprehensive Data Model & Dynamic Discovery: CData Cloud provides comprehensive access to all of the data exposed in the underlying data source, including full access to dynamic data and easily searchable metadata.

CData Cloud

Getting Started

This page provides a guide to Establishing a Connection to Smaregi in CData Cloud, as well as information on the available resources, and a reference to the available connection properties.

Connecting to Smaregi

Establishing a Connection shows how to authenticate to Smaregi and configure any necessary connection properties to create a database in CData Cloud

Accessing Data from CData Cloud Services

Accessing data from Smaregi through the available standard services and CData Cloud administration is documented in further details in the CData Cloud Documentation.

CData Cloud

Establishing a Connection

Connect to Smaregi by selecting the corresponding icon in the Database tab. Required properties are listed under Settings. The Advanced tab lists connection properties that are not typically required.

Connecting to Smaregi

ContractId and AccessToken parameters are required for Smaregi driver. After login, go to Configurations -> System linkage -> Smart API setting
ContractId : Contract ID of your account. You can also find it in the Reception setting section.
AccessToken : access token in the Reception setting section.

CData Cloud

SSL Configuration

Customizing the SSL Configuration

By default, the Cloud attempts to negotiate TLS with the server. The server certificate is validated against the default system trusted certificate store. You can override how the certificate gets validated using the SSLServerCert connection property.

To specify another certificate, see the SSLServerCert connection property.

CData Cloud

Firewall and Proxy

Connecting Through a Firewall or Proxy

HTTP Proxies

To authenticate to an HTTP proxy, set the following:

  • ProxyServer: the hostname or IP address of the proxy server that you want to route HTTP traffic through.
  • ProxyPort: the TCP port that the proxy server is running on.
  • ProxyAuthScheme: the authentication method the Cloud uses when authenticating to the proxy server.
  • ProxyUser: the username of a user account registered with the proxy server.
  • ProxyPassword: the password associated with the ProxyUser.

Other Proxies

Set the following properties:

  • To use a proxy-based firewall, set FirewallType, FirewallServer, and FirewallPort.
  • To tunnel the connection, set FirewallType to TUNNEL.
  • To authenticate, specify FirewallUser and FirewallPassword.
  • To authenticate to a SOCKS proxy, additionally set FirewallType to SOCKS5.

CData Cloud

Data Model

Overview

This section shows the available API objects and provides more information on executing SQL to Smaregi APIs.

Key Features

  • The Cloud models Smaregi entities like products, customers, and shippings as relational tables, allowing you to write SQL to query and modify Smaregi data.
  • Live connectivity to these objects means any changes to your Smaregi account are immediately reflected when using the Cloud.

Tables

Tables describes the available tables. Table are statically defined to model Products, Customers, Shippings, and more.

Views

Views describes the available views. Views are statically defined to model Stores, ShippingDetails and more. Views may not be modified, but can be used to supplement queries to the tables.

CData Cloud

Tables

The Cloud models the data in Smaregi as a list of tables in a relational database that can be queried using standard SQL statements.

CData Cloud - Smaregi Tables

Name Description
BargainProducts Usage information for the operation BargainProducts.rsd.
Bargains Usage information for the operation Bargains.rsd.
BargainStores Usage information for the operation BargainStores.rsd.
Categories Usage information for the operation Categories.rsd.
Customers Usage information for the operation Customers.rsd.
Losses Usage information for the operation Losses.rsd.
ProductInventoryReservations Usage information for the operation ProductInventoryReservations.rsd.
ProductPrices Usage information for the operation ProductPrices.rsd.
ProductReserveItemLabels Usage information for the operation ProductReserveItemLabels.rsd.
ProductReserveItems Usage information for the operation ProductReserveItems.rsd.
Products Usage information for the operation Products.rsd.
ProductStores Usage information for the operation ProductStores.rsd.
Receivings Usage information for the operation Receivings.rsd.
Shipments Usage information for the operation Shipments.rsd.
Shippings Usage information for the operation Shippings.rsd.
Staff Usage information for the operation Staff.rsd.
Stocks Usage information for the operation Stocks.rsd.
StorageInfo Usage information for the operation StorageInfo.rsd.
Storages Usage information for the operation Storages.rsd.
Stores Usage information for the operation Stores.rsd.
TransactionHeads Usage information for the operation TransactionHeads.rsd.

CData Cloud

BargainProducts

Usage information for the operation BargainProducts.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT BargainId, TargetId FROM BargainProducts

SELECT * FROM BargainProducts WHERE BargainId > 3 AND TargetId >= 1004 

SELECT * FROM BargainProducts WHERE BargainId > 3 AND TargetId >= 1004 ORDER BY BargainProductId DESC

SELECT * FROM BargainProducts WHERE TargetId LIKE '10%' ORDER BY BargainProductId ASC

Insert

To add a BargainProduct, specify the BargainId, TargetDivision, TargetId, Division and Value fields.

INSERT INTO BargainProducts (bargainId, targetDivision, targetId, division, value) VALUES (6, 2, 8, 1, 44)
INSERT INTO BargainProducts (BargainProductId, bargainId, targetDivision, targetId, division, value) VALUES (7, 6, 2, 6, 1, 43)

NOTE: If records already exist, insert will not be successful and driver will return 0 affected rows.

Upsert

To add/update a BargainProduct, specify the BargainId, TargetDivision, TargetId, Division and Value fields.

UPSERT INTO BargainProducts (BargainId, TargetDivision, TargetId, Division, Value) VALUES (6, 2, 1007, 1, 44)
UPSERT INTO BargainProducts (BargainProductId, bargainId, targetDivision, targetId, division, value) VALUES (7, 6, 2, 6, 1, 43)

Bulk Upsert

To add/update multiple BargainProducts, specify the BargainId, TargetDivision, TargetId, Division and Value fields.

INSERT INTO BargainProducts#TEMP (bargainId, targetDivision, targetId, division, value) VALUES (6, 2, 2, 1, 44)
INSERT INTO BargainProducts#TEMP (bargainId, targetDivision, targetId, division, value) VALUES (7, 2, 2, 1, 44)
UPSERT INTO BargainProducts (bargainId, targetDivision, targetId, division, value) SELECT bargainId, targetDivision, targetId, division, value FROM BargainProducts#TEMP

Update

Smaregi allows UPDATEs for the BargainId, TargetDivision, TargetId, Division and Value columns.

UPDATE BargainProducts SET BargainId = 3, TargetDivision = 3, TargetId = 1008, Value = 400, Division = 3 WHERE BargainProductId = 48

Delete

BargainProducts can be deleted by providing the BargainProductId.

DELETE FROM BargainProducts WHERE BargainProductId = 2

Bulk Delete


INSERT INTO BargainProducts#TEMP (BargainProductId) VALUES (3)
INSERT INTO BargainProducts#TEMP (BargainProductId) VALUES (4)
DELETE FROM BargainProducts WHERE EXISTS SELECT BargainProductId FROM BargainProducts#TEMP

Columns

Name Type ReadOnly References Description
BargainProductId [KEY] Long False

BargainId Integer False

Bargains.BargainId

TargetDivision Integer False

TargetId String False

Division Integer False

Value Decimal False

CData Cloud

Bargains

Usage information for the operation Bargains.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime data type columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT BargainName, TermStart FROM Bargains

SELECT BargainName, TermStart FROM Bargains WHERE BargainName LIKE 'TestBargain%' ORDER BY TermStart

Insert

To add a Bargain, specify all fields.

INSERT INTO Bargains (BargainId, BargainName, TermStart, TermEnd) VALUES (91, 'TestBargain91', '2019-06-28', '2019-09-28')

NOTE: If records already exist, insert will not be successful and driver will return 0 affected rows.

Upsert

To add/update a Bargain, specify all fields.

UPSERT INTO Bargains (BargainId, BargainName, TermStart, TermEnd) VALUES (8, 'TestBargain9', '2019-06-28', '2019-09-28')

Bulk Upsert

To add/update multiple Bargains, specify all fields.

INSERT INTO Bargains#TEMP (bargainId, BargainName, TermStart, TermEnd) VALUES (1, 'TestBargain1', '2019-06-28', '2019-09-28')
INSERT INTO Bargains#TEMP (bargainId, BargainName, TermStart, TermEnd) VALUES (3, 'TestBargain3', '2019-02-28', '2019-03-28')
UPSERT INTO Bargains (bargainId, BargainName, TermStart, TermEnd) SELECT bargainId, BargainName, TermStart, TermEnd FROM Bargains#TEMP

Update

Smaregi allows updates for the BargainName, TermStart and TermEnd columns.

UPDATE Bargains SET BargainName = 'Sample', TermStart = '2019-06-25', TermEnd = '2019-11-25' WHERE BargainId = 8

Delete

Bargains can be deleted by providing the BargainId.

DELETE FROM Bargains WHERE BargainId = 1

Bulk Delete


INSERT INTO Bargains#TEMP (BargainId) VALUES (90)
INSERT INTO Bargains#TEMP (BargainId) VALUES (91)
DELETE FROM Bargains WHERE EXISTS SELECT BargainId FROM Bargains#TEMP

Columns

Name Type ReadOnly References Description
BargainId [KEY] Integer False

BargainName String False

TermStart Date False

TermEnd Date False

CData Cloud

BargainStores

Usage information for the operation BargainStores.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime data type columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT StoreId FROM BargainStores WHERE BargainStoreId != 22 AND BargainId >= 23

Insert

To add a BargainStore, specify the BargainId and StoreId fields.

INSERT INTO BargainStores (BargainId, StoreId) VALUES (1, 1)
INSERT INTO BargainStores (BargainStoreId, BargainId, StoreId) VALUES (5, 1, 1)

NOTE: If records already exist, insert will not be successful and driver will return 0 affected rows.

Upsert

To add/update a BargainStore, specify the BargainId and StoreId fields.

UPSERT INTO BargainStores (BargainStoreId, BargainId, StoreId) VALUES (4, 2, 1)

Bulk Upsert

To add/update BargainStores, specify the BargainId and StoreId fields.

INSERT INTO BargainStores#TEMP (BargainId, StoreId) VALUES (4, 1)
INSERT INTO BargainStores#TEMP (BargainId, StoreId) VALUES (5, 1)
UPSERT INTO BargainStores (BargainId, StoreId) SELECT BargainId, StoreId FROM BargainStores#TEMP

Update

Smaregi allows updates for the BargainId and StoreId columns.

UPDATE BargainStores SET BargainId = 3, StoreId = 3 WHERE BargainStoreId = 4

Delete

BargainStores can be deleted by providing the BargainProductId.

DELETE FROM BargainStores WHERE BargainStoreId = 4

Bulk Delete


INSERT INTO BargainStores#TEMP (BargainStoreId) VALUES (5)
INSERT INTO BargainStores#TEMP (BargainStoreId) VALUES (6)
DELETE FROM BargainStores WHERE EXISTS SELECT BargainStoreId FROM BargainStores#TEMP

Columns

Name Type ReadOnly References Description
BargainStoreId [KEY] Long False

BargainId Integer False

Bargains.BargainId

StoreId Integer False

CData Cloud

Categories

Usage information for the operation Categories.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime data type columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following query is processed server side:

SELECT CategoryName, CategoryCode FROM Categories ORDER BY CategoryCode

Insert

To add a Category, specify the CategoryId, CategoryCode and CategoryName fields.

INSERT INTO Categories (CategoryId, CategoryCode, CategoryName) VALUES (10, 'CategoryCode10', 'CategoryName10')

NOTE: If records already exist, insert will not be successful and driver will return 0 affected rows.

Upsert

To add/update a Category, specify the CategoryId, CategoryCode and CategoryName fields.

UPSERT INTO Categories (CategoryId, CategoryCode, CategoryName) VALUES (6, 'CategoryCode', 'CategoryName')

Bulk Upsert

To add/update Categories, specify the CategoryId, CategoryCode and CategoryName fields.

INSERT INTO Categories#TEMP (CategoryId, CategoryCode, CategoryName) VALUES (11, 'CategoryCode11', 'CategoryName11')
INSERT INTO Categories#TEMP (CategoryId, CategoryCode, CategoryName) VALUES (12, 'CategoryCode12', 'CategoryName12')
UPSERT INTO Categories (CategoryId, CategoryCode, CategoryName) SELECT CategoryId, CategoryCode, CategoryName FROM Categories#TEMP

Update

Smaregi allows UPDATEs for the CategoryCode, CategoryName, CategoryAbbr, CategoryGroupId, ParentCategoryId, DisplaySequence, DisplayFlag, PointNotApplicable, TaxFreeDivision, Color and Tag columns.

UPDATE Categories SET CategoryCode = 'CatCode', CategoryName = 'Updated', CategoryAbbr = 'CatAbbr', CategoryGroupId = 2, ParentCategoryId = 1, DisplaySequence = 1, DisplayFlag = 0, PointNotApplicable = 1, TaxFreeDivision = 1, Tag = 'test' WHERE CategoryId = 13

Delete

Categories can be deleted by providing the CategoryId.

DELETE FROM Categories WHERE CategoryId = 2

Bulk Delete


INSERT INTO Categories#TEMP (CategoryId) VALUES (11)
INSERT INTO Categories#TEMP (CategoryId) VALUES (12)
DELETE FROM Categories WHERE EXISTS SELECT CategoryId FROM Categories#TEMP

Columns

Name Type ReadOnly References Description
CategoryId [KEY] Integer False

CategoryCode String False

CategoryName String False

CategoryAbbr String False

CategoryGroupId Integer False

ParentCategoryId Integer False

Level Integer True

DisplaySequence Integer False

DisplayFlag Integer False

PointNotApplicable Integer False

TaxFreeDivision Integer False

Color String False

Tag String False

InsDateTime Datetime True

UpdDateTime Datetime True

CData Cloud

Customers

Usage information for the operation Customers.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime data type columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT CustomerCode, CustomerNo FROM Customers WHERE FirstName LIKE 'Na%'

Insert

To add a Customer, specify the CustomerId, CustomerCode, FirstName, LastName, FirstKana, LastKana and Sex fields.

INSERT INTO Customers (CustomerId, CustomerCode, FirstName, LastName, FirstKana, LastKana, Sex) VALUES (123, 'CustomerCode123', 'Name123', 'Surname123', 'KanaName123', 'KanaSurname123', '2')

NOTE: If records already exist, insert will not be successful and driver will return 0 affected rows.

Upsert

To add/update a Customer, specify the CustomerId, CustomerCode, FirstName, LastName, FirstKana, LastKana and Sex fields.

UPSERT INTO Customers (CustomerId, CustomerCode, FirstName, LastName, FirstKana, LastKana, Sex) VALUES (216, 'CustomerCode', 'Name', 'Surname', 'KanaName', 'KanaSurname', '2')

Bulk Upsert

To add/update Customers, specify the CustomerId, CustomerCode, FirstName, LastName, FirstKana, LastKana and Sex fields.

INSERT INTO Customers#TEMP (CustomerId, CustomerCode, FirstName, LastName, FirstKana, LastKana, Sex) VALUES (123, 'CustomerCode123', 'Name123', 'Surname123', 'KanaName123', 'KanaSurname123', '2')
INSERT INTO Customers#TEMP (CustomerId, CustomerCode, FirstName, LastName, FirstKana, LastKana, Sex) VALUES (124, 'CustomerCode124', 'Name124', 'Surname124', 'KanaName124', 'KanaSurname124', '2')
UPSERT INTO Customers (CustomerId, CustomerCode, FirstName, LastName, FirstKana, LastKana, Sex) SELECT CustomerId, CustomerCode, FirstName, LastName, FirstKana, LastKana, Sex FROM Customers#TEMP

Update

Smaregi allows updates for all non key columns.

UPDATE Customers SET CustomerCode = 'CustomerCode2', CustomerNo = 3 WHERE CustomerId = 216

Delete

Customers can be deleted by providing the CustomerId.

DELETE FROM Customers WHERE CustomerId = 2

Bulk Delete


INSERT INTO Customers#TEMP (CustomerId) VALUES (123)
INSERT INTO Customers#TEMP (CustomerId) VALUES (124)
DELETE FROM Customers WHERE EXISTS SELECT CategoryId FROM Customers#TEMP

Columns

Name Type ReadOnly References Description
CustomerId [KEY] Long False

CustomerCode String False

CustomerNo String False

Rank String False

StaffRank String False

LastName String False

FirstName String False

LastKana String False

FirstKana String False

PostCode String False

Address String False

PhoneNumber String False

FaxNumber String False

MobileNumber String False

MailAddress String False

MailAddress2 String False

MailAddress3 String False

CompanyName String False

DepartmentName String False

ManagerialPosition String False

Sex Integer False

BirthDate Date False

Mile Integer False

Point Integer False

PointExpireDate Date False

LastComeDateTime Datetime False

EntryDate Date False

LeaveDate Date False

PointGivingUnitPrice Integer False

PointGivingUnit Decimal False

PinCode String False

PassportNo String False

Nationality String False

AlphabetName String False

MailReceiveFlag Integer False

Note String False

Note2 String False

FavoriteList String False

BrowsingList String False

Status Integer False

StoreId Integer False

InsDateTime Datetime False

UpdDateTime Datetime False

CData Cloud

Losses

Usage information for the operation Losses.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT Division FROM Losses ORDER BY LossId DESC

SELECT * FROM Losses WHERE LossId != 5

Insert

To add a Loss, specify the StoreId, Division, Memo, IdentificationNo, Token, LossDatetime and DetailAggregate fields.

Using temporary tables:

INSERT INTO LossDetails#TEMP (productCode, color, productId, size, quantity) VALUES (4, 'White', 6, 'S', 2)
INSERT INTO Losses (StoreId, Division, Memo, IdentificationNo, Token, LossDatetime, DetailAggregate) VALUES (1, '01', 'Memo', 'loss32', '764956r6f694344r3r332465', '2020-01-17 02:05:45', 'LossDetails#TEMP')

Using aggregates:

INSERT INTO Losses (StoreId, Division, Memo, IdentificationNo, LossDatetime, DetailAggregate) VALUES (1, '02', 'Memo', 'loss32', '2020-01-17 02:05:45', '    {
      "table_name": "LossDetail",
      "rows": [
        {
          "productCode": "2000001000045",
          "color": "White",
          "productId": "4",
          "size": "S",
          "quantity": "2",
        }
      ]
    }
')

Upsert

Upsert is not supported for this table.

Update

Smaregi allows UPDATEs for the Division, Memo, LossDatetime, IdentificationNo, Token and DetailAggregate columns.

UPDATE Losses SET Memo = 'UpdatedMemo5', Division = '02' WHERE LossId = 1
Changes of an UPDATE query for DetailAggregate column, will be reflected in LossDetails view.

Using temp table.

INSERT INTO LossDetails#TEMP (LossId, productCode, color, productId, size, quantity) VALUES (21, 6, 'White', 5, 'S', 2)
INSERT INTO LossDetails#TEMP (LossId, productCode, color, productId, size, quantity) VALUES (21, 5, 'White', 7, 'S', 2)
UPDATE Losses SET DetailAggregate = 'LossDetails#TEMP' WHERE LossId = 21

Using aggregates

UPDATE Losses set DetailAggregate = '    {
      "table_name": "LossDetail",
      "rows": [
        {
          "lossId": "21",
          "productCode": "2000001000045",
          "color": "White",
          "productId": "9",
          "size": "S",
          "quantity": "2",
        }
      ]
    }
'  WHERE LossId = 21

Delete

Losses can be deleted by providing the ProductId.

DELETE FROM Losses WHERE LossId = 12

Bulk Delete


INSERT INTO Losses#TEMP (LossId) VALUES (11)
INSERT INTO Losses#TEMP (LossId) VALUES (12)
INSERT INTO Losses#TEMP (LossId) VALUES (13)
INSERT INTO Losses#TEMP (LossId) VALUES (22)
DELETE FROM Losses WHERE EXISTS SELECT LossId FROM Losses#TEMP

Columns

Name Type ReadOnly References Description
LossId [KEY] Integer False

StoreId Integer True

Stores.StoreId

Division String False

Memo String False

LossDatetime Datetime False

IdentificationNo String False

Modified Datetime True

Token String False

Identifier.

DetailAggregate String False

A JSON aggregate of details associated with the loss.

CData Cloud

ProductInventoryReservations

Usage information for the operation ProductInventoryReservations.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT ReservationAmount FROM ProductInventoryReservations

SELECT * FROM ProductInventoryReservations WHERE ReservationProductId <= 1005;

Insert

To add a ProductInventoryReservation, specify all fields.

INSERT INTO ProductInventoryReservations (ProductId, ReservationProductId, ReservationAmount) VALUES (1005, 4, 5)

NOTE: If records already exist, insert will not be successful and driver will return 0 affected rows.

Upsert

To add/update a ProductInventoryReservation, specify all fields.

UPSERT INTO ProductInventoryReservations (ProductId, ReservationProductId, ReservationAmount) VALUES (1005, 4, 5)

Bulk Upsert

To add/update ProductInventoryReservations, specify all fields.

INSERT INTO ProductInventoryReservations#TEMP (ProductId, ReservationProductId, ReservationAmount) VALUES (7, 4, 5)
INSERT INTO ProductInventoryReservations#TEMP (ProductId, ReservationProductId, ReservationAmount) VALUES (9, 4, 5)
UPSERT INTO ProductInventoryReservations (ProductId, ReservationProductId, ReservationAmount) SELECT ProductId, ReservationProductId, ReservationAmount FROM ProductInventoryReservations#TEMP

Update

Smaregi allows updates for the ReservationAmount column.

UPDATE ProductInventoryReservations SET ReservationAmount = 2 WHERE ProductId = 1005 AND ReservationProductId = 15

Delete

ProductInventoryReservations can be deleted by providing the ProductId and ReservationProductId.

DELETE FROM ProductInventoryReservations WHERE ProductId = 1005 AND ReservationProductId = 15

Bulk Delete


INSERT INTO ProductInventoryReservations#TEMP (ProductId, ReservationProductId) VALUES (9, 4)
INSERT INTO ProductInventoryReservations#TEMP (ProductId, ReservationProductId) VALUES (4, 4)
DELETE FROM ProductInventoryReservations WHERE EXISTS SELECT ProductId, ReservationProductId FROM ProductInventoryReservations#TEMP

Columns

Name Type ReadOnly References Description
ProductId [KEY] Long False

Products.ProductId

ReservationProductId [KEY] Long False

ReservationAmount Integer False

CData Cloud

ProductPrices

Usage information for the operation ProductPrices.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT * FROM ProductPrices WHERE ProductId = 45345

SELECT ProductId, StoreId, Price  FROM ProductPrices

Insert

To add a ProductPrice, specify the ProductId, StoreId , PriceDivision, Price and StartDate fields.

INSERT INTO ProductPrices (productId, storeId, priceDivision, price, StartDate) VALUES (864684, '1', 1, 100, '2019-09-30')

NOTE: If records already exist, insert will not be successful and driver will return 0 affected rows.

Upsert

To add/update a ProductPrice, specify the ProductId, StoreId, PriceDivision, Price and StartDate fields.

UPSERT INTO ProductPrices (ProductId, StoreId, PriceDivision, Price, StartDate) VALUES (45345, 1, 2, 550, '2019/02/02')

Bulk Upsert

To add/update ProductPrices, specify the ProductId, StoreId, PriceDivision, Price and StartDate fields.

INSERT INTO ProductPrices#TEMP (productId, storeId, priceDivision, price, StartDate) VALUES (45, 1, 2, 550, '2019/02/02')
INSERT INTO ProductPrices#TEMP (productId, storeId, priceDivision, price, StartDate) VALUES (56, 1, 2, 350, '2019/02/06')
UPSERT INTO ProductPrices (productId, storeId, priceDivision, price, StartDate) SELECT productId, storeId, priceDivision, price, StartDate FROM ProductPrices#TEMP

Update

Smaregi allows updates for the PriceDivision, StartDate, EndDate and Price columns.

UPDATE ProductPrices SET PriceDivision = 1, EndDate = '2019-12-02', StartDate = '2019/12/02' WHERE ProductId = 45345

Delete

ProductPrices can be deleted by providing ProductId and StoreId.

DELETE FROM ProductPrices WHERE ProductId = 18 AND StoreId = 1 

Bulk Delete


INSERT INTO ProductPrices#TEMP (productId) VALUES (45)
INSERT INTO ProductPrices#TEMP (productId) VALUES (56)
DELETE FROM ProductPrices WHERE EXISTS SELECT ProductId FROM ProductPrices#TEMP

Columns

Name Type ReadOnly References Description
ProductId [KEY] Long False

Products.ProductId

StoreId [KEY] String False

Stores.StoreId

PriceDivision [KEY] Integer False

StartDate [KEY] Date False

EndDate Date False

Price Decimal False

InsDateTime Datetime True

UpdDateTime Datetime True

CData Cloud

ProductReserveItemLabels

Usage information for the operation ProductReserveItemLabels.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT Label FROM ProductReserveItemLabels

SELECT * FROM ProductReserveItemLabels WHERE No != 2

Insert

To add a ProductReserveItemLabel, specify all fields.

INSERT INTO ProductReserveItemLabels (No, Label) VALUES (84, 1)

NOTE: If records already exist, insert will not be successful and driver will return 0 affected rows.

Upsert

To add/update a ProductReserveItemLabel, specify both fields.

UPSERT INTO ProductReserveItemLabels (No, Label) VALUES (84, 1)

Bulk Upsert

To add/update ProductReserveItemLabels, specify all fields.

INSERT INTO ProductReserveItemLabels#TEMP (No, Label) VALUES (84, 1)
INSERT INTO ProductReserveItemLabels#TEMP (No, Label) VALUES (83, 1)
UPSERT INTO ProductReserveItemLabels (No, Label) SELECT No, Label FROM ProductReserveItemLabels#TEMP

Update

Smaregi allows updates for the No, Label column.

UPDATE ProductReserveItemLabels SET Label = 2 WHERE No = 84

Delete

ProductReserveItemLabels can be deleted by providing the No.

DELETE FROM ProductReserveItemLabels WHERE No = 4

Bulk Delete


INSERT INTO ProductReserveItemLabels#TEMP (No) VALUES (83)
INSERT INTO ProductReserveItemLabels#TEMP (No) VALUES (84)
DELETE FROM ProductReserveItemLabels WHERE EXISTS SELECT No FROM ProductReserveItemLabels#TEMP

Columns

Name Type ReadOnly References Description
No [KEY] Integer False

Label String False

CData Cloud

ProductReserveItems

Usage information for the operation ProductReserveItems.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT Value FROM ProductReserveItems

SELECT * FROM ProductReserveItems WHERE No > 5

Insert

To add a ProductReserveItem, specify all fields.

INSERT INTO ProductReserveItems (ProductId, No, Value) VALUES (45345, 2, 1)

NOTE: If records already exist, insert will not be successful and driver will return 0 affected rows.

Upsert

To add/update a ProductReserveItem, specify all fields.

UPSERT INTO ProductReserveItems (ProductId, No, Value) VALUES (45345, 2, 1)

Bulk Upsert

To add/update ProductReserveItems, specify all fields.

INSERT INTO ProductReserveItems#TEMP (ProductId, No, Value) VALUES (45345, 2, 1)
INSERT INTO ProductReserveItems#TEMP (ProductId, No, Value) VALUES (45347, 2, 1)
UPSERT INTO ProductReserveItems (ProductId, No, Value) SELECT ProductId, No, Value FROM ProductReserveItems#TEMP

Update

Smaregi allows updates for the Value column.

UPDATE ProductReserveItems SET Value = 0 WHERE ProductId = 7 AND No = 2

Delete

ProductReserveItems can be deleted by providing the ProductId and No.

DELETE FROM ProductReserveItems WHERE ProductId = 7 AND No = 4

Bulk Delete


INSERT INTO ProductReserveItems#TEMP (ProductId, No) VALUES (45345, 2)
INSERT INTO ProductReserveItems#TEMP (ProductId, No) VALUES (45346, 2)
DELETE FROM ProductReserveItems WHERE EXISTS SELECT ProductId, NO FROM ProductReserveItems#TEMP

Columns

Name Type ReadOnly References Description
ProductId [KEY] Long False

Products.ProductId

No [KEY] Integer False

Value String False

CData Cloud

Products

Usage information for the operation Products.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT * FROM Products WHERE updDateTime = '2019-08-29 17:30:51.0'

SELECT * FROM Products WHERE ProductId = 2

SELECT * FROM Products WHERE ProductName LIKE '%S%' AND CategoryId > 3 ORDER BY ProductId DESC

Insert

To add a Product, specify the ProductId, categoryId, productCode, ProductName, taxDivision, price, cost and taxFreeDivision fields.

INSERT INTO Products (ProductId, categoryId, productCode, ProductName, taxDivision, price, cost, taxFreeDivision) VALUES (68899, 3, 4453452, '58432InsertedProduct', 0, 500, 450, 0)

NOTE: If records already exist, insert will not be successful and driver will return 0 affected rows.

Upsert

To add/update a Product, specify the ProductId, categoryId, productCode, ProductName, taxDivision, price, cost and taxFreeDivision fields.

UPSERT INTO Products (ProductId, categoryId, productCode, ProductName, price) VALUES (45346, 3, 44534520, '58432InsertedProduct', 500)

Bulk Upsert

To add/update Products, specify the ProductId, categoryId, productCode, ProductName, taxDivision, price, cost and taxFreeDivision fields.

INSERT INTO Products#TEMP (ProductId, categoryId, productCode, ProductName, taxDivision, price, cost, taxFreeDivision) VALUES (78899, 3, 4453456, '58434InsertedProduct', 0, 500, 450, 0)
INSERT INTO Products#TEMP (ProductId, categoryId, productCode, ProductName, taxDivision, price, cost, taxFreeDivision) VALUES (77899, 3, 4453455, '58433InsertedProduct', 0, 500, 450, 0)
UPSERT INTO Products (ProductId, categoryId, productCode, ProductName, taxDivision, price, cost, taxFreeDivision) SELECT ProductId, categoryId, productCode, ProductName, taxDivision, price, cost, taxFreeDivision FROM Products#TEMP

Update

Smaregi allows updates for the COL1 and COL2 columns.

UPDATE Products SET CategoryId = '2', ProductCode = '2343', ProductKana = 'Kana', TaxDivision = '2', ProductPriceDivision = '2', Price = 455, CustomerPrice = 505, Cost = 444, Attribute = 'Attr', Description = 'Desc', CatchCopy = 'Copy', Size = 'XL', Color = 'Grey', Tag = 'tag', GroupCode = '43' WHERE ProductId = '45345'

Delete

Products can be deleted by providing the ProductId.

DELETE FROM Products WHERE ProductId = 5843055

Bulk Delete


INSERT INTO Products#TEMP (ProductId) VALUES (68899)
INSERT INTO Products#TEMP (ProductId) VALUES (77899)
INSERT INTO Products#TEMP (ProductId) VALUES (78899)
DELETE FROM Products WHERE EXISTS SELECT ProductId FROM Products#TEMP

Columns

Name Type ReadOnly References Description
ProductId [KEY] Long False

CategoryId Integer False

Categories.CategoryId

ProductCode String False

ProductName String False

ProductKana String False

TaxDivision String False

ProductPriceDivision String False

Price Decimal False

CustomerPrice Decimal False

Cost Decimal False

Attribute String False

Description String False

CatchCopy String False

Size String False

Color String False

Tag String False

GroupCode String False

Url String False

PrintReceiptProductName String False

DisplaySequence Integer False

SalesDivision String False

StockControlDivision String False

DisplayFlag String False

Division String False

ProductOptionGroupId Integer False

PointNotApplicable String False

TaxFreeDivision String False

CalcDiscount String False

SupplierProductNo String False

StaffDiscountRate Integer False

UseCategoryReduceTax Integer False

ReduceTaxId Integer False

ReduceTaxPrice Decimal False

ReduceTaxCustomerPrice Decimal False

AppStartDateTime Datetime False

InsDateTime Datetime False

UpdDateTime Datetime False

CData Cloud

ProductStores

Usage information for the operation ProductStores.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT * FROM ProductStores  WHERE AssignDivision > 0

Insert

To add a ProductStore, specify all fields.

INSERT INTO ProductStores (ProductId, StoreId, AssignDivision) VALUES (45345, 1, 1)

NOTE: If records already exist, insert will not be successful and driver will return 0 affected rows.

Upsert

To add/update a ProductStore, specify all fields.

UPSERT INTO ProductStores (ProductId, StoreId, AssignDivision) VALUES (45345, 1, 1)

Bulk Upsert

To add/update ProductStores, specify all fields.

INSERT INTO ProductStores#TEMP (ProductId, StoreId, AssignDivision) VALUES (47, 1, 1)
INSERT INTO ProductStores#TEMP (ProductId, StoreId, AssignDivision) VALUES (48, 1, 1)
UPSERT INTO ProductStores (ProductId, StoreId, AssignDivision) SELECT ProductId, StoreId, AssignDivision FROM ProductStores#TEMP

Update

Smaregi allows UPDATEs for the AssignDivision column.

UPDATE ProductStores SET AssignDivision = 0 WHERE ProductId = 84 AND StoreId = 2

Delete

Delete is not supported for this table.

Columns

Name Type ReadOnly References Description
ProductId [KEY] Long False

Products.ProductId

StoreId [KEY] Integer False

Stores.StoreId

AssignDivision Integer False

CData Cloud

Receivings

Usage information for the operation Receivings.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT * FROM Receivings WHERE ReceivingId = 3

SELECT ReceivingId, ShippingStoreId, Memo FROM Receivings ORDER BY ReceivingId

Insert

Insert is not supported for this table.

Upsert

Upsert is not supported for this table.

Update

Smaregi allows updates for the ShippingId, ShippingStoreId, ReceivingStoreId, ReceivingDate, Memo, Status, IdentificationNo, Token and DetailAggregate columns.

UPDATE Receivings SET Memo = 'ChangedMemo' WHERE ReceivingId = 1
Changes of an update query for DetailAggregate column, will be reflected in ReceivingDetails view.

Using temp table.

INSERT INTO ReceivingDetails#TEMP (ReceivingId, ProductId, InspectionQuantity, StockoutQuantity, StockoutReason, InspectionDate) VALUES (14, 8, 3, 1, 'Memo', '2019-09-28')
INSERT INTO ReceivingDetails#TEMP (ReceivingId, ProductId, InspectionQuantity, StockoutQuantity, StockoutReason, InspectionDate) VALUES (14, 9, 43, 2, 'Memo', '2019-09-28')
UPDATE Receivings SET ReceivingDate = '2019-09-28', Memo = 'ChangedMemo', DetailAggregate = 'ReceivingDetails#TEMP' WHERE ReceivingId = 14

Using aggregates

UPDATE Receivings SET DetailAggregate = '{
      "table_name": "ReceivingDetail",
      "rows": [
        {
          "receivingId": "14",
          "productId": "17",
          "inspectionQuantity": "33",
        }
      ]
    }
' WHERE ReceivingId = 14

Delete

Delete is not supported for this table.

Columns

Name Type ReadOnly References Description
ReceivingId [KEY] Integer False

ShippingId Integer False

Shippings.ShippingId

ShippingStoreId Integer False

ReceivingStoreId Integer False

ReceivingDate Date False

Memo String False

Status Integer False

IdentificationNo String False

Modified Datetime True

Token String False

DetailAggregate String False

A JSON aggregate of details associated with the receiving.

CData Cloud

Shipments

Usage information for the operation Shipments.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT * FROM Shipments WHERE ShipmentId = 5

SELECT RecipientId, RecipientName FROM Shipments

Insert

To add a Shipment, specify the ShipmentStoreId, RecipientType, RecipientName, ShipmentDivision, ShipmentDate, Status AND DetailAggregate fields.

Using temporary tables:

INSERT INTO ShipmentDetails#TEMP (productId, quantity) VALUES (84, 1)
INSERT INTO ShipmentDetails#TEMP (productId, quantity) VALUES (83, 1)
INSERT INTO Shipments (ShipmentStoreId, RecipientType, RecipientName, ShipmentDivision, ShipmentDate, Status, DetailAggregate) VALUES (1, 3, 'TestName3113', 2, '2057-07-20', 0, 'ShipmentDetails#TEMP')

Using aggregates:

INSERT INTO Shipments (ShipmentStoreId, RecipientType, RecipientName, ShipmentDivision, ShipmentDate, Status, DetailAggregate) VALUES (1, 3, 'TestName3113', 2, '2057-07-20', 0, '    {
      "table_name": "ShipmentDetail",
      "rows": [
        {
          "productId": "65",
          "quantity": "3"
        }
      ]
    }
')

Upsert

Upsert is not supported for this table.

Update

Smaregi allows updates for the RecipientType RecipientId RecipientName ShipmentDivision ShipmentDate Status IdentificationNo Token and DetailAggregate columns.

UPDATE Shipments SET IdentificationNo = '333543' WHERE ShipmentId = 5
Changes of an update query for DetailAggregate column, will be reflected in ShipmentDetails view.

Using temp table.

INSERT INTO ShipmentDetails#TEMP (ShipmentId, productId, quantity) VALUES (9, 7, 1)
INSERT INTO ShipmentDetails#TEMP (ShipmentId, productId, quantity) VALUES (9, 8, 1)
UPDATE Shipments SET DetailAggregate = 'ShipmentDetails#TEMP' WHERE ShipmentId = 9

Using aggregates

UPDATE Shipments SET DetailAggregate = '    {
      "table_name": "ShipmentDetail",
      "rows": [
        {
          "shipmentId": "9",
          "productId": "7",
          "quantity": "1"
        }
      ]
    }
'  WHERE ShipmentId = 21

Delete

Shipments can be deleted by providing the ShipmentId.

DELETE FROM Shipments WHERE ShipmentId = 4

Bulk Delete


INSERT INTO Shipments#TEMP (ShipmentId) VALUES (2)
INSERT INTO Shipments#TEMP (ShipmentId) VALUES (3)
DELETE FROM Shipments WHERE EXISTS SELECT ShipmentId FROM Shipments#TEMP

Columns

Name Type ReadOnly References Description
ShipmentId [KEY] Integer False

ShipmentStoreId Integer False

RecipientType Integer False

RecipientId Integer False

RecipientName String False

ShipmentDivision String False

ShipmentDate Date False

Memo String False

Status Integer False

ApprovalStatus Integer False

ApprovalDateTime Datetime True

IdentificationNo String False

Modified Datetime True

Token String False

DetailAggregate String False

A JSON aggregate of details associated with the shipment.

CData Cloud

Shippings

Usage information for the operation Shippings.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT * FROM Shippings WHERE Status != 0

SELECT ShippingId, ShippingStoreId, StorageStoreId FROM Shippings WHERE ShippingId <= 4

Insert

To add a Shipping, specify the StorageStoreId, ShippingStoreId, Status, ShippingDate, StorageDesiredDate and DetailAggregate fields.

Using temporary tables:

INSERT INTO ShippingDetails#TEMP (productId, requestQuantity) VALUES (8, 3)
INSERT INTO Shippings (StorageStoreId, ShippingStoreId, Status, ShippingDate, StorageDesiredDate, DetailAggregate) VALUES (1, 2, 0, '2019/10/10', '2019/10/10', 'ShippingDetails#TEMP')

Using aggregates:

INSERT INTO Shippings (StorageStoreId, ShippingStoreId, Status, Memo, ShippingDate, StorageExpectedDateFrom, StorageDesiredDate, DetailAggregate) VALUES (1, 2, 0, 'Changed', '2019/10/10', '2019/10/10', '2019/10/10', '    {
      "table_name": "ShippingDetail",
      "rows": [
        {
          "productId": "8",
          "productName": "ProdName",
          "quantity": "3",
          "requestQuantity": "1"
        }
      ]
    }')

Upsert

Upsert is not supported for this table.

Update

Smaregi allows updates for the ShippingStoreId StorageStoreId StorageExpectedDateFrom StorageExpectedDateTo ShippingDate StorageDesiredDate Memo Status ModificationRequestStatus ModificationRequestDateTime ModificationRequestCheckedDateTime IdentificationNo Token and DetailAggregate columns.

UPDATE Shippings SET Memo = 'UpdatedMemo', status = 1, storageExpectedDateFrom = '2019/02/02', modificationRequestStatus = 1, storageExpectedDateTo = '2019/02/02' WHERE ShippingId = 9

Delete

Shippings can be deleted by providing the ShippingId.

DELETE FROM Shippings WHERE ShippingId = 6

Bulk Delete


INSERT INTO Shippings#TEMP (ShippingId) VALUES (3)
INSERT INTO Shippings#TEMP (ShippingId) VALUES (4)
INSERT INTO Shippings#TEMP (ShippingId) VALUES (5)
DELETE FROM Shippings WHERE EXISTS SELECT ShippingId FROM Shippings#TEMP

Columns

Name Type ReadOnly References Description
ShippingId [KEY] Integer False

ShippingStoreId Integer False

ReceivingStoreId Integer False

ReceivingExpectedDateFrom Date False

ReceivingExpectedDateTo Date False

ShippingDate Date False

ReceivingDesiredDate Date False

Memo String False

Status Integer False

ApprovalStatus Integer False

ApprovalDateTime Datetime True

ModificationRequestStatus Integer False

ModificationRequestDateTime Datetime False

ModificationRequestCheckedDateTime Datetime False

IdentificationNo String False

Modified Datetime True

Token String False

DetailAggregate String False

A JSON aggregate of details associated with the shipping.

CData Cloud

Staff

Usage information for the operation Staff.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT * FROM Staff WHERE StaffId = 2

SELECT * FROM Staff WHERE StaffName LIKE '%S%' AND StaffId > 3 ORDER BY StaffId DESC

Insert

To add a Staff, specify the StaffId, StaffCode, StaffName, StaffKana, Rank, Pincode, DisplayFlag, DisplaySequence, MailAddress, LoginIpAddress, RoleId and StoresAggregate fields.

Using temporary tables:

INSERT INTO StaffStores#TEMP (StaffId, StoreId, ControlDivision) VALUES (9, 1, 1)
INSERT INTO StaffStores#TEMP (StaffId, StoreId, ControlDivision) VALUES (9, 2, 1)
INSERT INTO Staff (StaffId, StaffCode, StaffName, StaffKana, Rank, StoresAggregate) VALUES (9, '09', 'StaffNameSample', 'StaffNameKanaSample', 'B', 'StaffStores$TEMP')

Using aggregates:

INSERT INTO Staff (StaffId, StaffCode, StaffName, StaffKana, Rank, StoresAggregate) VALUES (9, '09', 'StaffNameSample', 'StaffNameKanaSample', 'B', '{
    "table_name": "StaffStore",
    "rows": [
        {
            "staffId": "9",
            "storeId": "1",
            "controlDivision": "1"
        },
        {
            "staffId": "9",
            "storeId": "2",
            "controlDivision": "0"
        }
    ]
}')

NOTE: If records already exist, insert will not be successful and driver will return 0 affected rows.

Upsert

To add/update a Staff, specify the StaffId, StaffCode, StaffName, StaffKana, Rank, Pincode, DisplayFlag, DisplaySequence, MailAddress, LoginIpAddress. RoleId and StoresAggregate fields.

INSERT INTO StaffStores#TEMP (StaffId, StoreId, ControlDivision) VALUES (9, 1, 1)
INSERT INTO StaffStores#TEMP (StaffId, StoreId, ControlDivision) VALUES (9, 2, 1)
UPSERT INTO Staff(StaffId, StaffCode, StaffName, StaffKana, Rank, StoresAggregate) VALUES (9, '09', 'StaffNameSample', 'StaffNameKanaSample', 'B', 'StaffStores$TEMP')

Update

Smaregi allows updates for the StaffCode, StaffName, StaffKana, Rank, Pincode, DisplayFlag, DisplaySequence, MailAddress, LoginIpAddress, RoleId and StoresAggregate fields.

UPDATE Staff SET StaffCode = '2', StaffName = '2343', StaffKana = 'Kana' WHERE StaffId = '1'

Delete

Staff can be deleted by providing the StaffId.

DELETE FROM Staff WHERE StaffId = 1

Columns

Name Type ReadOnly References Description
StaffId [KEY] Integer False

StaffCode String False

StaffName String False

StaffKana String False

Rank String False

Pincode String False

DisplayFlag Integer False

DisplaySequence Integer False

MailAddress String False

LoginIpAddress String False

RoleId Integer False

StoresAggregate String False

A JSON aggregate of details associated with the staff.

CData Cloud

Stocks

Usage information for the operation Stocks.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT ProductId, StoreId, StockAmount, StockDivision FROM Stocks ORDER BY  StockDivision
SELECT ProductId, StoreId, StockAmount, StockDivision FROM Stocks WHERE StockDivision = 5
SELECT * FROM Stocks WHERE StockAmount < -1

Insert

To add a Stock, specify the ProductId, StoreId, StockDivision and StockAmount fields.

INSERT INTO Stocks (ProductId, StoreId, StockDivision, StockAmount) VALUES (45, 1, 05, 1)

Upsert

To add/update a Stock, specify the ProductId, StoreId, StockDivision and StockAmount fields.

UPSERT INTO Stocks (ProductId, StoreId, StockDivision, StockAmount) VALUES (45, 1, 05, 1)

Bulk Upsert

Using temporary tables:

INSERT INTO Stocks#TEMP (ProductId, StoreId, StockDivision, StockAmount) VALUES (46, 2, 02, 1)
INSERT INTO Stocks#TEMP (ProductId, StoreId, StockDivision, StockAmount) VALUES (47, 2, 02, 1)
INSERT INTO Stocks#TEMP (ProductId, StoreId, StockDivision, StockAmount) VALUES (48, 2, 02, 1)
INSERT INTO Stocks#TEMP (ProductId, StoreId, StockDivision, StockAmount) VALUES (49, 2, 02, 1)
UPSERT INTO Stocks (ProductId, StoreId, StockDivision, StockAmount) SELECT ProductId, StoreId, StockDivision, StockAmount FROM Stocks#TEMP

Update

Smaregi allows updates for the StockAmount and StockDivision columns.

UPDATE Stocks SET StockAmount = 5, StockDivision = '02' WHERE ProductId = 1
UPDATE Stocks SET StockAmount = 110, StockDivision = 10, AmountType = 'Absolute' WHERE ProductId = 13 AND StoreId = 4

Delete

Delete is not supported for this table.

Columns

Name Type ReadOnly References Description
ProductId [KEY] Long False

Products.ProductId

StoreId [KEY] Integer False

Stores.StoreId

StockAmount Integer False

UpdDatetime Datetime True

StockDivision String False

Memo String False

Pseudo-Columns

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.

Name Type Description
AmountType String

If you want to update the stockAmount with an absolute value use 'Absolute' and if you want to add or subtract some value from stockAmount use 'Relative'

The allowed values are Absolute, Relative.

The default value is Absolute.

CData Cloud

StorageInfo

Usage information for the operation StorageInfo.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT * FROM StorageInfo WHERE  StorageInfoId = 8

SELECT OrderedDate FROM StorageInfo WHERE Status = 2

Insert

To add a StorageInfo, specify the Status, IdentificationNo, DeliveryAggregate and DeliveryProductAggregate fields.

Using temporary tables:

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

Using aggregates:

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: If records already exist, insert will not be successful and driver will return 0 affected rows.

Upsert

Upsert is not supported for this table.

Update

Smaregi allows updates for the RecipientOrderId, OrderedDate, Status and IdentificationNo columns.

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 can be deleted by providing the 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

RecipientOrderId Integer False

OrderedDate Date False

Status Integer False

Memo String False

IdentificationNo String False

Modified Datetime True

Token String False

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.

CData Cloud

Storages

Usage information for the operation Storages.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT * FROM Storages WHERE StorageId = 3

SELECT StorageInfoId, SupplierId, StorageStoreId, StorageExpectedDateFrom FROM Storages WHERE StorageId = 3

Insert

To add a Storage, specify the SupplierId, StorageStoreId and DetailAggregate fields.

Using temporary tables:

INSERT INTO StorageDetails#TEMP (productId, inspectionQuantity) VALUES (1, 4)
INSERT INTO Storages (SupplierId, StorageStoreId, DetailAggregate) VALUES (1, 1, 'StorageDetails#TEMP')

Using aggregates:

INSERT INTO Storages (StorageId, StorageInfoId, SupplierId, StorageStoreId, Memo, DetailAggregate) VALUES (21, 2, 1, 1, 'chand2233445', '    {
      "table_name": "StorageDetail",
      "rows": [
        {
          "productId": "5",
          "inspectionQuantity": "3"
        }
      ]
    }
')

NOTE: If records already exist, insert will not be successful and driver will return 0 affected rows.

Upsert

Upsert is not supported for this table.

Update

Smaregi allows updates for the StorageInfoId, SupplierId, StorageStoreId, StorageExpectedDateFrom, StorageExpectedDateTo, StorageDate, Memo, Status, IdentificationNo, Token and DetailAggregate columns.

UPDATE Storages SET Memo = 'updated2' WHERE StorageId = 18

Delete

Delete is not supported for this table.

Columns

Name Type ReadOnly References Description
StorageId [KEY] Integer False

StorageInfoId Integer False

StorageInfo.StorageInfoId

SupplierId Integer False

StorageStoreId Integer False

StorageExpectedDateFrom Date False

StorageExpectedDateTo Date False

StorageDate Date False

Memo String False

Status Integer False

IdentificationNo String False

Modified Datetime True

Token String False

DetailAggregate String False

A JSON aggregate of details associated with the storage.

CData Cloud

Stores

Usage information for the operation Stores.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT * FROM Stores WHERE StoreId = 2 

SELECT StoreName, StoreCode, PostCode FROM Stores ORDER BY StoreId

Insert

To add a Store, specify the StoreId, StoreCode and StoreName.

INSERT INTO Stores (StoreId, StoreCode, StoreName) VALUES (35, 'YSM', 'TATA')

Update

Smaregi allows updates for the StoreCode, StoreName, StoreAbbr, PostCode, Address, PhoneNumber, FaxNumber, MailAddress, Homepage, TempTranMailAddress, PriceChangeFlag, SellDivision, SumProcDivision, SumDateChangeTime, SumRefColumn, PointNotApplicable, TaxFreeDivision, MaxBundleProductCount, RoundingDivision and DiscountRoundingDivision.

UPDATE Stores SET StoreCode = 'YM', StoreName = 'TATASONS' WHERE StoreId = 35

Columns

Name Type ReadOnly References Description
StoreId [KEY] Integer True

Store Id.

StoreCode String False

Store Code.

StoreName String False

Store Name.

StoreAbbr String False

Store name abbreviation.

Division Integer False

Store classification, 1=Normal Store, 2=Warehouse. Its default value is 1. It cannot be changed after registeration.

PostCode String False

Store zip code with hyphen.

Address String False

Store address.

PhoneNumber String False

Store phone number with hyphen.

FaxNumber String False

Store fax number.

MailAddress String False

Store email address.

Homepage String False

Store homepage.

TempTranMailAddress String False

Email address to be sent when registering a temporary transaction. Multiple specifications can be specified separated by commas.

PriceChangeFlag Integer False

To prevent the selling price from being changed on the iPod or iPad, set 0:Cannot be changed, set 1: can be changed. Its default value is 1.

SellDivision Integer False

Sales category, 0:Tax-included sales, 1:Tax-excluded sales. Its default value is 1.

SumProcDivision Integer False

Distinguishable by means of association, 0:Manual tightening process, 1:Automatic tightening process. Its default value is 0.

SumDateChangeTime String False

Date change time. Used during tightening[HHMM]. Tightening method classification is 1: Required for automatic tightening.

SumRefColumn String False

The time to refer to when performing the tightening process. Used during closing process(0:terminal time, 1:server time). Tightening method classification is 1: Required for automatic closing process. Its default value is 0.

PointNotApplicable Integer False

Point target classification. 0 means Add points and 1 means Do not add points. Its default value is 0.

TaxFreeDivision Integer False

Tax free distinction. 0 means not applicable, 1 means General products and 2 means Consumables. Its default value is 0.

MaxBundleProductCount Integer False

Maximum number of simple bundle product registrations. Set the maximum number of registered products on the simple bundle sales screen. Its Default value is from 9 upto 999. Its default value is 9.

RoundingDivision String False

Fractional value subtraction classification. Set whether to round the total amount at the time of sale. 00:None, 11: Round off the ones place, 12: Round off the ones place, 13: Round up the ones place, 21: Round off the tens place , 22: Round the tens place, 23: Round the tens place, 31: Round the hundreds place, 32: Round the hundreds place, 33: Round the hundreds place, 41: Round the thousands place , 42: Round off the thousand's place, 43: Round up the thousand's place, 99: Manually entered. Its default value is 00.

DiscountRoundingDivision String False

Discount Rounding Category. 0 means rounding, 1 means rounding down, 2 means rounding up and 3 means bank rounding. Its default value is 0.

PauseFlag Boolean True

Pause flag (0:normal, 1:pause).

PointUseDivision Integer True

Point usage classification. Determine whether to use the point function(0:not used and 1: used). Its default value is 1.

InsDateTime Datetime True

Creation date and time: Date and time at the time of registration. [YYYY-MM-DDThh: mm: ssTZD].

UpdDateTime Datetime True

Update date and time: Date and time of registration / update. [YYYY-MM-DDThh: mm: ssTZD].

CData Cloud

TransactionHeads

Usage information for the operation TransactionHeads.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

NOTE: One or more of the following filtering conditions are required in the request. The default filtering condition is set to UpdDateTime for the last 30 days.

  • Transaction ID [TransactionHeadId] ID specification, From-To (From-To can be specified within 100, 000).
  • Transaction Date Time [TransactionDateTime] From-To (Period is 31 days (not 1 month)).
  • Terminal transaction date and time [TerminalTranDateTime] From-To (Period is 31 days (not 1 month)).
  • Adjustment date and time [AdjustmentDateTime] From-To (Period is 31 days (not 1 month)).
  • Sum date and time [SumDateTime] From-To (Period is 31 days (not 1 month)).
  • Cancel date and time [CancelDateTime] From-To (Period is 31 days (not 1 month)).
  • Updated date and time [UpdDateTime] From-To (Period is 31 days (not 1 month)).

SELECT * FROM TransactionHeads WHERE TransactionHeadId >= 1 AND TransactionHeadId <= 100000

SELECT * FROM TransactionHeads WHERE TransactionDateTime >= '2021/03/01 00:00:00' AND TransactionDateTime <= '2021/03/31 00:00:00'

SELECT * FROM TransactionHeads WHERE TerminalTranDateTime >= '2021/03/01 00:00:00' AND TerminalTranDateTime <= '2021/03/31 00:00:00'

SELECT * FROM TransactionHeads WHERE SumDateTime >= '2021/03/01 00:00:00' AND SumDateTime <= '2021/03/31 00:00:00'

SELECT * FROM TransactionHeads WHERE UpdDateTime >= '2021/03/01 00:00:00' AND UpdDateTime <= '2021/03/31 00:00:00'

Insert

To add a Storage, specify the SupplierId, StorageStoreId and DetailAggregate fields.

Using temporary tables:

INSERT INTO TransactionDetails#TEMP (TransactionDetailId, ParentTransactionDetailId, TransactionDetailDivision, SalesPrice, Quantity) VALUES (1, 1, 2, 400, 4)
INSERT INTO TransactionHeads (SumDivision, SumDateTime, StoreId, TerminalId, TerminalTranId, CancelDivision, TransactionDateTime, TerminalTranDateTime, TransactionHeadDivision, Subtotal, Total, DetailAggregate) VALUES (2, '2019/08/06 00:00:00', 1, 23, 6, 0, '2019/08/21', '2019-08-11', '1',-1600,-1600, 'TransactionDetails#TEMP')

Using aggregates:

INSERT INTO TransactionHeads (SumDivision, SumDateTime, StoreId, TerminalId, TerminalTranId, CancelDivision, TransactionDateTime, TerminalTranDateTime, TransactionHeadDivision, Subtotal, Total, DetailAggregate) VALUES (2, '2019/08/06 00:00:00', 1, 23, 6, 0, '2019/08/21', '2019-08-14', '1', 159, 159, '    {
      "table_name": "TransactionDetail",
      "rows": [
        {
          "parentTransactionDetailId": "1",
          "transactionDetailDivision": "1",
          "salesPrice": "159",
          "quantity": "1"
        }
      ]
    }
')

NOTE: If records already exist, insert will not be successful and driver will return 0 affected rows.

Upsert

Upsert is not supported for this table.

Update

UPDATE is not supported for this table.

Delete

Delete is not supported for this table.

Columns

Name Type ReadOnly References Description
TransactionHeadId Long True

TransactionDateTime Datetime True

TransactionHeadDivision String False

CancelDivision Integer False

UnitNonDiscountsubtotal Decimal True

UnitDiscountsubtotal Decimal True

Subtotal Decimal False

SubtotalDiscountPrice Decimal False

SubtotalDiscountRate Decimal False

SubtotalDiscountDivision Integer True

PointDiscount Decimal False

Total Decimal False

TaxExclude Decimal False

TaxInclude Decimal False

RoundingDivision String True

RoundingPrice Decimal True

CashTotal Decimal True

CreditTotal Decimal True

Deposit Decimal False

DepositCash Decimal False

DepositCredit Decimal False

Charge Decimal False

ChangeDifference Decimal True

Amount Integer True

ReturnAmount Integer True

CostTotal Decimal True

SalesHeadDivision Integer True

InTaxSalesTotal Decimal True

OutTaxSalesTotal Decimal True

NonTaxSalesTotal Decimal True

NonSalesTargetTotal Decimal True

NonSalesTargetOutTaxTotal Decimal True

NonSalesTargetInTaxTotal Decimal True

NonSalesTargetTaxFreeTotal Decimal True

NonSalesTargetCostTotal Decimal True

NonSalesTargetAmount Integer True

NonSalesTargetReturnAmount Integer True

NewPoint Decimal False

SpendPoint Decimal False

Point Decimal False

TotalPoint Decimal False

CurrentMile Decimal False

EarnMile Decimal False

TotalMile Decimal False

AdjustmentMile Decimal False

AdjustmentMileDivision Integer False

AdjustmentMileValue Integer False

StoreId [KEY] Integer False

StoreCode String True

TerminalId [KEY] Integer False

CustomerId Long False

CustomerCode String True

TerminalTranId [KEY] String False

TerminalTranDateTime [KEY] Datetime False

SumDivision Integer False

AdjustmentDateTime Datetime True

SumDateTime Datetime False

CustomerRank String False

CustomerGroupId Integer False

CustomerGroupId2 Integer False

CustomerGroupId3 Integer False

CustomerGroupId4 Integer False

CustomerGroupId5 Integer False

StaffId Integer False

StaffName String True

StaffCode String True

PaymentCount String True

SlipNumber String True

CancelSlipNumber String True

AuthNumber String True

AuthDate String True

CardCompany String True

Memo String False

ReceiptMemo String False

PaymentMethodId1 Integer False

PaymentMethodName1 String True

DepositOthers1 Decimal False

PaymentMethodId2 Integer False

PaymentMethodName2 String True

DepositOthers2 Decimal False

PaymentMethodId3 Integer False

PaymentMethodName3 String True

DepositOthers3 Decimal False

Carriage Decimal False

Commission Decimal False

GuestNumbers Integer False

TaxFreeSalesDivision Integer False

NetTaxFreeGeneralTaxInclude Decimal False

NetTaxFreeGeneralTaxExclude Decimal False

NetTaxFreeConsumableTaxInclude Decimal False

NetTaxFreeConsumableTaxExclude Decimal False

Tags String False

PointGivingDivision Integer False

PointGivingUnitPrice Integer False

PointGivingUnit Decimal False

PointSpendDivision Integer False

MileageDivision Integer False

MileageLabel String False

CustomerPinCode String False

DisposeDivision Integer False

DisposeServerTransactionHeadId Long False

CancelDateTime Datetime True

SellDivision Integer False

TaxRate Decimal False

TaxRounding Integer False

DiscountRoundingDivision Integer True

TransactionUuid String False

GiftReceiptValidDays Integer False

ReceiptIssueNumberOfTimes Integer True

PickUpDate Date False

PartPayment Decimal False

PartPaymentClass Integer True

LayawayServerTransactionHeadId Long False

DisabledEdit Integer False

UpdDateTime Datetime True

PickupTransactionHeadId Long True

DetailAggregate String False

A JSON aggregate of details associated with the transaction head.

CouponDiscount Decimal False

The total discount amount of each coupon used in the transaction

CData Cloud

Views

Views are similar to tables in the way that data is represented; however, views are read-only.

Queries can be executed against a view as if it were a normal table.

CData Cloud - Smaregi Views

Name Description
DailySums Usage information for the operation DailySums.rsd.
DailySumsSalesList Usage information for the operation DailySumsSalesList.rsd.
LossDetails Usage information for the operation LossDetails.rsd.
ReceivingDetails Usage information for the operation ReceivingDetails.rsd.
ShipmentDetails Usage information for the operation ShipmentDetails.rsd.
ShippingDetails Usage information for the operation ShippingDetails.rsd.
StaffStores Usage information for the operation StaffStores.rsd.
StockHistories Usage information for the operation StockHistories.rsd.
StocktakingDetails Usage information for the operation StocktakingDetails.rsd.
StocktakingHeads Usage information for the operation StocktakingHeads.rsd.
StocktakingInfo Usage information for the operation StocktakingInfo.rsd.
StocktakingStockDetails Usage information for the operation StocktakingStockDetails.rsd.
StorageDetails Usage information for the operation StorageDetails.rsd.
StorageInfoDeliveries Usage information for the operation StorageInfoDeliveries.rsd.
StorageInfoDeliveryProducts Usage information for the operation StorageInfoDeliveryProducts.rsd.
StorageInfoProducts Usage information for the operation StorageInfoProducts.rsd.
TransactionCoupons Usage information for the operation TransactionCoupons.rsd.
TransactionDepositOthers Usage information for the operation TransactionDepositOthers.rsd.
TransactionDetails Usage information for the operation TransactionDetails.rsd.

CData Cloud

DailySums

Usage information for the operation DailySums.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime data type columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT * FROM [DailySums] WHERE SumDate = '2019-08-02'

SELECT * FROM [DailySums] WHERE TenThousandYen >= 0

Columns

Name Type References Description
SumDate [KEY] Date
StoreId [KEY] Integer

Stores.StoreId

CashDrawerId [KEY] Integer
Status Integer
SalesTotal Decimal
Discount Decimal
PointDiscount Decimal
TaxExcludeReceive Decimal
NonSalesTargetTotal Decimal
Total Decimal
TotalExcludTax Decimal
InTaxSalesTotal Decimal
TaxInclude Decimal
OutTaxSalesTotal Decimal
TaxExclude Decimal
TaxTotal Decimal
TaxDetailList String
NonTaxSalesTotal Decimal
TaxFreeTotal Decimal
NonSalesTargetTaxFreeTotal Decimal
CostTotal Decimal
GrossMargin Decimal
Amount Integer
TransactionCount Integer
ReturnAmount Integer
Carriage Decimal
Commission Decimal
PreparationCash Decimal
CashSales Decimal
CreditSales Decimal
OtherSalseList String
PartPayment Decimal
PartPaymentCash Decimal
PartPaymentCredit Decimal
ReceivedDepositCash Decimal
ReceivedDepositCashTotal Decimal
ReceivedDepositCreditTotal Decimal
PartPaymentCancel Decimal
PartPaymentCashCancel Decimal
PartPaymentCreditCancel Decimal
Deposit Decimal
ReturnDeposit Decimal
Receipt Decimal
Payment Decimal
NonSalesCashTotal Decimal
NonSalesCreditTotal Decimal
NonSalesOtherTotal Decimal
NonSalesTaxFreeTotal Decimal
ChangeDifference Decimal
CalculateBalance Decimal
RealBalance Decimal
Difference Decimal
Saving Decimal
CarryOver Decimal
TenThousandYen Integer
FiveThousandYen Integer
TwoThousandYen Integer
OneThousandYen Integer
FiveHundredYen Integer
OneHundredYen Integer
FiftyYen Integer
TenYen Integer
FiveYen Integer
OneYen Integer
Comment String
InsDateTime Datetime
UpdDateTime Datetime
SalesTotalNonSalesTargetDivision String
TotalTaxFreeDivision String

CData Cloud

DailySumsSalesList

Usage information for the operation DailySumsSalesList.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions built with the following column and operator.

  • Id supports the '=,!=,>,<,>=,<=,LIKE' comparison.

SELECT * FROM [DailySumsSalesList] WHERE StoreId = '1234'

Columns

Name Type References Description
SumDate [KEY] Date
StoreId [KEY] Integer

Stores.StoreId

CashDrawerId [KEY] Integer
Id [KEY] Integer
Name String
PaymentMethodDivision String
PaymentMethodDivisionName String
Sales Decimal
InsDateTime Datetime
UpdDateTime Datetime

CData Cloud

LossDetails

Usage information for the operation LossDetails.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT LossId, ProductCode FROM LossDetails WHERE LossId >= 5

SELECT * FROM LossDetails WHERE LossId <= 5

Columns

Name Type References Description
LossId [KEY] Integer

Losses.LossId

ProductId [KEY] Long

Products.ProductId

ProductCode String
ProductName String
Size String
Color String
GroupCode String
SupplierProductNo String
Quantity Integer
Modified Datetime

CData Cloud

ReceivingDetails

Usage information for the operation ReceivingDetails.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT * FROM ReceivingDetails WHERE ReceivingId = 9

SELECT ProductId, ProductCode FROM ReceivingDetails WHERE ReceivingId != 5

Columns

Name Type References Description
ReceivingId [KEY] Integer

Receivings.ReceivingId

ProductId [KEY] Long

Products.ProductId

ProductCode String
ProductName String
Size String
Color String
GroupCode String
SupplierProductNo String
ScheduledQuantity Integer
InspectionQuantity Integer
StockoutQuantity Integer
StockoutReason String
InspectionDate Date
Status Integer
Modified Datetime

CData Cloud

ShipmentDetails

Usage information for the operation ShipmentDetails.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT * FROM ShipmentDetails WHERE ShipmentId = 5

SELECT ProductId, ProductCode FROM ShipmentDetails WHERE ShipmentId = 5

Columns

Name Type References Description
ShipmentId [KEY] Integer

Shipments.ShipmentId

ProductId [KEY] Long

Products.ProductId

ProductCode String
ProductName String
Size String
Color String
GroupCode String
SupplierProductNo String
Cost Decimal
Quantity Integer
Memo String
Modified Datetime
TaxRate Decimal

CData Cloud

ShippingDetails

Usage information for the operation ShippingDetails.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT * FROM ShippingDetails WHERE Quantity > 2

SELECT ShippingId, ProductId, ProductCode FROM ShippingDetails 

Columns

Name Type References Description
ShippingId [KEY] Integer

Shippings.ShippingId

ProductId [KEY] Long

Products.ProductId

ProductCode String
ProductName String
Size String
Color String
GroupCode String
SupplierProductNo String
RequestQuantity Integer
Quantity Integer
Modified Datetime

CData Cloud

StaffStores

Usage information for the operation StaffStores.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT * FROM StaffStores WHERE StaffId = 2

SELECT * FROM StaffStores WHERE StaffId = 1 AND StoreId > 3 ORDER BY StaffId DESC

Columns

Name Type References Description
StaffId [KEY] Integer
StoreId [KEY] Integer
ControlDivision Integer

CData Cloud

StockHistories

Usage information for the operation StockHistories.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

NOTE: One or more of the following filtering conditions are required in the request. The default filtering condition is set to UpdDateTime for the last 30 days.

  • ID [id] ID specified, From-To (From-To can be specified within 100,000).
  • Product ID [productId] ID Direct specification only.
  • Updated date and time [UpdDateTime] From-To (Period is 31 days (not 1 month)).
  • Target date and time [TargetDateTime] From-To (Period is 31 days (not 1 month)).

SELECT * FROM StockHistories WHERE Id >= 1 AND Id <= 100000

SELECT * FROM StockHistories WHERE ProductId = 1

SELECT * FROM StockHistories WHERE UpdDateTime >= '2021/03/01 00:00:00' AND UpdDateTime <= '2021/03/31 00:00:00'

SELECT * FROM StockHistories WHERE TargetDateTime >= '2021/03/01 00:00:00' AND TargetDateTime <= '2021/03/31 00:00:00'

Columns

Name Type References Description
Id [KEY] Long
UpdDateTime Datetime
TargetDateTime Datetime
ProductId Long
StoreId Integer
Amount Integer
StockAmount Integer
StockDivision String
FromStoreId Integer
ToStoreId Integer

CData Cloud

StocktakingDetails

Usage information for the operation StocktakingDetails.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

NOTE: One or more of the following filtering conditions are required in the request. The default filtering condition is set to Modified for the last 30 days.

  • StocktakingInfo ID [StocktakingInfoId] specification, From-To (From-To can be specified within 100,000).
  • Modified date and time [Modified] From-To (Period is 31 days (not 1 month)).

SELECT * FROM StocktakingDetails WHERE StocktakingInfoId >= 1 AND StocktakingInfoId <= 100000

SELECT * FROM StocktakingDetails WHERE Modified >= '2021/03/01 00:00:00' AND Modified <= '2021/03/31 00:00:00'

Columns

Name Type References Description
StocktakingInfoId [KEY] Integer

StocktakingInfo.StocktakingInfoId

StocktakingHeadId [KEY] Integer

StocktakingHeads.StocktakingHeadId

ProductId [KEY] Long

Products.ProductId

ProductCode String
ProductName String
Size String
Color String
GroupCode String
SupplierProductNo String
StocktakingQuantity Integer
TransportationStockQuantity Integer
LayawayStockQuantity Integer
StockQuantityBeforeAdjustment Integer
Cost Decimal
Memo String
Modified Datetime
InputStocktakingQuantity Integer
QuantityModifiedDatetime Datetime

CData Cloud

StocktakingHeads

Usage information for the operation StocktakingHeads.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT * FROM StocktakingHeads WHERE DivisionCode != '373838333'

Columns

Name Type References Description
StocktakingInfoId [KEY] Integer

StocktakingInfo.StocktakingInfoId

StocktakingHeadId [KEY] Integer
DivisionCode String
Modified Datetime

CData Cloud

StocktakingInfo

Usage information for the operation StocktakingInfo.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT * FROM StocktakingInfo WHERE StocktakingInfoId != '344'

Columns

Name Type References Description
StocktakingInfoId [KEY] Integer
StoreId Integer
DivisionUnit Boolean
TargetDate Date
AdjustmentDate Datetime
StocktakingCompleteDate Datetime
Status Integer
Created Datetime
Modified Datetime
StockCountDivision String
StocktakingInputCompleteDate Datetime
AutoFollowingFlag Integer
LayawayStockIncludeFlag Integer

CData Cloud

StocktakingStockDetails

Usage information for the operation StocktakingStockDetails.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT * FROM StocktakingStockDetails WHERE stocktakingInfoId = 2 AND baseDate = '2019-08-07'

SELECT * FROM StocktakingStockDetails WHERE stocktakingInfoId = 1 AND baseDate = '1/1/2019' ORDER BY stocktakingInfoId

Columns

Name Type References Description
StocktakingInfoId [KEY] Integer

StocktakingInfo.StocktakingInfoId

StocktakingHeadId [KEY] Integer

StocktakingHeads.StocktakingHeadId

ProductId [KEY] Long

Products.ProductId

ProductCode String
ProductName String
Size String
Color String
GroupCode String
SupplierProductNo String
StockQuantity Integer
StockMoney Decimal
TransportationQuantity Integer
TransportationMoney Decimal
LayawayQuantity Integer
LayawayMoney Decimal
StoreId Integer
BaseDate Date

CData Cloud

StorageDetails

Usage information for the operation StorageDetails.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT * FROM StorageDetails WHERE StorageId = 2 

SELECT ProductCode, ProductName, GroupCode FROM StorageDetails ORDER BY Size

Columns

Name Type References Description
StorageId [KEY] Integer

Storages.StorageId

ProductId [KEY] Long

Products.ProductId

ProductCode String
ProductName String
Size String
Color String
GroupCode String
SupplierProductNo String
Cost Decimal
ScheduledQuantity Integer
InspectionQuantity Integer
StockoutQuantity Integer
StockoutReason String
InspectionDate Date
CompulsoryCompleteFlag String
Status Integer
Modified Datetime

CData Cloud

StorageInfoDeliveries

Usage information for the operation StorageInfoDeliveries.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

NOTE: One or more of the following filtering conditions are required in the request. The default filtering condition is set to Modified for the last 30 days.

  • StorageInfo ID [StorageInfoId] ID specification, From-To (From-To can be specified within 100,000).
  • Modified date and time [Modified] From-To (Period is 31 days (not 1 month)).

SELECT * FROM StorageInfoDeliveries WHERE StorageInfoId >= 1 AND StorageInfoId <= 100000

SELECT * FROM StorageInfoDeliveries WHERE Modified >= '2021/03/01 00:00:00' AND Modified <= '2021/03/31 00:00:00'

Columns

Name Type References Description
StorageInfoId [KEY] Integer

StorageInfo.StorageInfoId

StorageStoreId [KEY] Integer
StorageExpectedDateFrom Date
StorageExpectedDateTo Date
Modified Datetime
StorageId Integer

CData Cloud

StorageInfoDeliveryProducts

Usage information for the operation StorageInfoDeliveryProducts.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

NOTE: One or more of the following filtering conditions are required in the request. The default filtering condition is set to Modified for the last 30 days.

  • StorageInfo ID [StorageInfoId] ID specification, From-To (From-To can be specified within 100,000).
  • Modified date and time [Modified] From-To (Period is 31 days (not 1 month)).

SELECT * FROM StorageInfoDeliveryProducts WHERE StorageInfoId >= 1 AND StorageInfoId <= 100000

SELECT * FROM StorageInfoDeliveryProducts WHERE Modified >= '2021/03/01 00:00:00' AND Modified <= '2021/03/31 00:00:00'

Columns

Name Type References Description
StorageInfoId [KEY] Integer

StorageInfo.StorageInfoId

StoreId [KEY] Integer

Stores.StoreId

ProductId [KEY] Long

Products.ProductId

ProductCode String
ProductName String
Size String
Color String
GroupCode String
SupplierProductNo String
Quantity Integer
Modified Datetime

CData Cloud

StorageInfoProducts

Usage information for the operation StorageInfoProducts.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

NOTE: One or more of the following filtering conditions are required in the request. The default filtering condition is set to Modified for the last 30 days.

  • StorageInfo ID [StorageInfoId] ID specification, From-To (From-To can be specified within 100,000).
  • Modified date and time [Modified] From-To (Period is 31 days (not 1 month)).

SELECT * FROM StorageInfoProducts WHERE StorageInfoId >= 1 AND StorageInfoId <= 100000
SELECT * FROM StorageInfoProducts WHERE Modified >= '2021/03/01 00:00:00' AND Modified <= '2021/03/31 00:00:00'

Columns

Name Type References Description
StorageInfoId [KEY] Integer

StorageInfo.StorageInfoId

ProductId [KEY] Long

Products.ProductId

ProductCode String
ProductName String
Size String
Color String
GroupCode String
SupplierProductNo String
Cost Decimal
Quantity Integer
Modified Datetime

CData Cloud

TransactionCoupons

Usage information for the operation TransactionCoupons.rsd.

Columns

Name Type References Description
TransactionCouponId [KEY] Long ID assigned to each transaction coupon
TerminalTranCouponId [KEY] Long Terminal transaction coupon ID
TransactionHeadId [KEY] Long

TransactionHeads.TransactionHeadId

ID given to each transaction
TerminalTranId [KEY] Long Terminal transaction ID
CouponId [KEY] Long Coupon ID. Coupon ID managed by smartphone register
CouponName String Name of the Coupon
SerialNumber String The coupon serial number.
AwardType String The type of Coupon
AwardValue Decimal Discount amount, discount rate, etc. What the value represents depends on the privilege type
DiscountPrice Decimal The discount price.
AdjustmentValue Decimal The Adjustment points/mile.
CouponOfflineDivision String The Coupon Offline Classification.
CombineDivision String The Combination Classification.

CData Cloud

TransactionDepositOthers

Usage information for the operation TransactionDepositOthers.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

SELECT * FROM TransactionDepositOthers WHERE TransactionHeadId = 61855 

SELECT PaymentMethodId, PaymentMethodName, DepositOthers, Denomination FROM TransactionDepositOthers ORDER BY TransactionHeadId

Columns

Name Type References Description
TransactionHeadId [KEY] Long

TransactionHeads.TransactionHeadId

The ID assigned to each transaction
PaymentMethodNumber [KEY] Integer The Sequential number for each payment method in the transaction
PaymentMethodId Integer The ID of the payment method
PaymentMethodName String The name of the payment method
DepositOthers Decimal The amount deposited at the time of accounting.
Denomination String The denomination of the payment method.

CData Cloud

TransactionDetails

Usage information for the operation TransactionDetails.rsd.

Select

The Cloud will use the Smaregi API to process WHERE clause conditions and selected columns. LIKE (for date and dateTime datatype columns) and IN operator are processed client-side. Operators: =, !=, <>, >, <, >=, <=, AND, LIKE, ORDER BY are processed server-side. For example, the following queries are processed server side:

NOTE: One or more of the following filtering conditions are required in the request. The default filtering condition is set to UpdDateTime for the last 30 days.

  • Transaction ID [TransactionHeadId] ID specification, From-To (From-To can be specified within 100,000).
  • TransactionDate Time [TransactionDateTime] From-To (Period is 31 days (not 1 month)).
  • Updated date and time [UpdDateTime] From-To (Period is 31 days (not 1 month)).

SELECT * FROM TransactionDetails WHERE TransactionDateTime >= '2021/03/01 00:00:00' AND TransactionDateTime <= '2021/03/31 00:00:00'

SELECT * FROM TransactionDetails WHERE TransactionHeadId >= 1 AND TransactionHeadId <= 100000

SELECT * FROM TransactionDetails WHERE UpdDateTime >= '2021/03/01 00:00:00' AND UpdDateTime <= '2021/03/31 00:00:00'

Columns

Name Type References Description
TransactionHeadId [KEY] Long

TransactionHeads.TransactionHeadId

TransactionDateTime Datetime
TransactionDetailId [KEY] Integer
ParentTransactionDetailId Integer
TransactionDetailDivision Integer
ProductId Long
ProductCode String
ProductName String
TaxDivision Integer
Price Decimal
SalesPrice Decimal
UnitDiscountPrice Decimal
UnitDiscountRate Decimal
UnitDiscountDivision Integer
Cost Decimal
Quantity Integer
UnitNonDiscountSum Decimal
UnitDiscountSum Decimal
UnitDiscountedSum Decimal
CostSum Decimal
CategoryId Integer
CategoryName String
DiscriminationNo String
SalesDivision Integer
ProductDivision Integer
PointNotApplicable Integer
TaxFreeDivision Integer
TaxFreeCommodityPrice Decimal
TaxFree Decimal
ProductBundleGroupId Integer
DiscountPriceProportional Decimal
DiscountPointProportional Decimal
DiscountCouponProportional Decimal Set coupon discount.
TaxIncludeProportional Decimal
TaxExcludeProportional Decimal
ProductBundleProportional Decimal
StaffDiscountProportional Decimal
BargainDiscountProportional Decimal
RoundingPriceProportional Decimal
InventoryReservationDivision Integer
GroupCode String
UpdDateTime Datetime
ProductStaffDiscountRate Integer
StaffRank String
StaffRankName String
StaffDiscountRate Decimal
StaffDiscountDivision Integer
ApplyStaffDiscountRate Decimal
ApplyStaffDiscountPrice Decimal
BargainId Integer
BargainName String
BargainDivision Integer
BargainValue Decimal
ApplyBargainValue Decimal
ApplyBargainDiscountPrice Decimal
TaxRate Decimal
StandardTaxRate Decimal
ModifiedTaxRate Decimal
ReduceTaxId Integer
ReduceTaxName String
ReduceTaxRate String
Color String
Size String

CData Cloud

Stored Procedures

Stored procedures are function-like interfaces that extend the functionality of the Cloud beyond simple SELECT/INSERT/UPDATE/DELETE operations with Smaregi.

Stored procedures accept a list of parameters, perform their intended function, and then return any relevant response data from Smaregi, along with an indication of whether the procedure succeeded or failed.

CData Cloud - Smaregi Stored Procedures

Name Description

CData Cloud

System Tables

You can query the system tables described in this section to access schema information, information on data source functionality, and batch operation statistics.

Schema Tables

The following tables return database metadata for Smaregi:

  • sys_catalogs: Lists the available databases.
  • sys_schemas: Lists the available schemas.
  • sys_tables: Lists the available tables and views.
  • sys_tablecolumns: Describes the columns of the available tables and views.
  • sys_procedures: Describes the available stored procedures.
  • sys_procedureparameters: Describes stored procedure parameters.
  • sys_keycolumns: Describes the primary and foreign keys.
  • sys_indexes: Describes the available indexes.

Data Source Tables

The following tables return information about how to connect to and query the data source:

  • sys_connection_props: Returns information on the available connection properties.
  • sys_sqlinfo: Describes the SELECT queries that the Cloud can offload to the data source.

Query Information Tables

The following table returns query statistics for data modification queries:

  • sys_identity: Returns information about batch operations or single updates.

CData Cloud

sys_catalogs

Lists the available databases.

The following query retrieves all databases determined by the connection string:

SELECT * FROM sys_catalogs

Columns

Name Type Description
CatalogName String The database name.

CData Cloud

sys_schemas

Lists the available schemas.

The following query retrieves all available schemas:

          SELECT * FROM sys_schemas
          

Columns

Name Type Description
CatalogName String The database name.
SchemaName String The schema name.

CData Cloud

sys_tables

Lists the available tables.

The following query retrieves the available tables and views:

          SELECT * FROM sys_tables
          

Columns

Name Type Description
CatalogName String The database containing the table or view.
SchemaName String The schema containing the table or view.
TableName String The name of the table or view.
TableType String The table type (table or view).
Description String A description of the table or view.
IsUpdateable Boolean Whether the table can be updated.

CData Cloud

sys_tablecolumns

Describes the columns of the available tables and views.

The following query returns the columns and data types for the Products table:

SELECT ColumnName, DataTypeName FROM sys_tablecolumns WHERE TableName='Products' 

Columns

Name Type Description
CatalogName String The name of the database containing the table or view.
SchemaName String The schema containing the table or view.
TableName String The name of the table or view containing the column.
ColumnName String The column name.
DataTypeName String The data type name.
DataType Int32 An integer indicating the data type. This value is determined at run time based on the environment.
Length Int32 The storage size of the column.
DisplaySize Int32 The designated column's normal maximum width in characters.
NumericPrecision Int32 The maximum number of digits in numeric data. The column length in characters for character and date-time data.
NumericScale Int32 The column scale or number of digits to the right of the decimal point.
IsNullable Boolean Whether the column can contain null.
Description String A brief description of the column.
Ordinal Int32 The sequence number of the column.
IsAutoIncrement String Whether the column value is assigned in fixed increments.
IsGeneratedColumn String Whether the column is generated.
IsHidden Boolean Whether the column is hidden.
IsArray Boolean Whether the column is an array.
IsReadOnly Boolean Whether the column is read-only.
IsKey Boolean Indicates whether a field returned from sys_tablecolumns is the primary key of the table.

CData Cloud

sys_procedures

Lists the available stored procedures.

The following query retrieves the available stored procedures:

          SELECT * FROM sys_procedures
          

Columns

Name Type Description
CatalogName String The database containing the stored procedure.
SchemaName String The schema containing the stored procedure.
ProcedureName String The name of the stored procedure.
Description String A description of the stored procedure.
ProcedureType String The type of the procedure, such as PROCEDURE or FUNCTION.

CData Cloud

sys_procedureparameters

Describes stored procedure parameters.

The following query returns information about all of the input parameters for the SelectEntries stored procedure:

SELECT * FROM sys_procedureparameters WHERE ProcedureName='SelectEntries' AND Direction=1 OR Direction=2

Columns

Name Type Description
CatalogName String The name of the database containing the stored procedure.
SchemaName String The name of the schema containing the stored procedure.
ProcedureName String The name of the stored procedure containing the parameter.
ColumnName String The name of the stored procedure parameter.
Direction Int32 An integer corresponding to the type of the parameter: input (1), input/output (2), or output(4). input/output type parameters can be both input and output parameters.
DataTypeName String The name of the data type.
DataType Int32 An integer indicating the data type. This value is determined at run time based on the environment.
Length Int32 The number of characters allowed for character data. The number of digits allowed for numeric data.
NumericPrecision Int32 The maximum precision for numeric data. The column length in characters for character and date-time data.
NumericScale Int32 The number of digits to the right of the decimal point in numeric data.
IsNullable Boolean Whether the parameter can contain null.
IsRequired Boolean Whether the parameter is required for execution of the procedure.
IsArray Boolean Whether the parameter is an array.
Description String The description of the parameter.
Ordinal Int32 The index of the parameter.

CData Cloud

sys_keycolumns

Describes the primary and foreign keys.

The following query retrieves the primary key for the Products table:

         SELECT * FROM sys_keycolumns WHERE IsKey='True' AND TableName='Products' 
          

Columns

Name Type Description
CatalogName String The name of the database containing the key.
SchemaName String The name of the schema containing the key.
TableName String The name of the table containing the key.
ColumnName String The name of the key column.
IsKey Boolean Whether the column is a primary key in the table referenced in the TableName field.
IsForeignKey Boolean Whether the column is a foreign key referenced in the TableName field.
PrimaryKeyName String The name of the primary key.
ForeignKeyName String The name of the foreign key.
ReferencedCatalogName String The database containing the primary key.
ReferencedSchemaName String The schema containing the primary key.
ReferencedTableName String The table containing the primary key.
ReferencedColumnName String The column name of the primary key.

CData Cloud

sys_foreignkeys

Describes the foreign keys.

The following query retrieves all foreign keys which refer to other tables:

         SELECT * FROM sys_foreignkeys WHERE ForeignKeyType = 'FOREIGNKEY_TYPE_IMPORT'
          

Columns

Name Type Description
CatalogName String The name of the database containing the key.
SchemaName String The name of the schema containing the key.
TableName String The name of the table containing the key.
ColumnName String The name of the key column.
PrimaryKeyName String The name of the primary key.
ForeignKeyName String The name of the foreign key.
ReferencedCatalogName String The database containing the primary key.
ReferencedSchemaName String The schema containing the primary key.
ReferencedTableName String The table containing the primary key.
ReferencedColumnName String The column name of the primary key.
ForeignKeyType String Designates whether the foreign key is an import (points to other tables) or export (referenced from other tables) key.

CData Cloud

sys_primarykeys

Describes the primary keys.

The following query retrieves the primary keys from all tables and views:

         SELECT * FROM sys_primarykeys
          

Columns

Name Type Description
CatalogName String The name of the database containing the key.
SchemaName String The name of the schema containing the key.
TableName String The name of the table containing the key.
ColumnName String The name of the key column.
KeySeq String The sequence number of the primary key.
KeyName String The name of the primary key.

CData Cloud

sys_indexes

Describes the available indexes. By filtering on indexes, you can write more selective queries with faster query response times.

The following query retrieves all indexes that are not primary keys:

          SELECT * FROM sys_indexes WHERE IsPrimary='false'
          

Columns

Name Type Description
CatalogName String The name of the database containing the index.
SchemaName String The name of the schema containing the index.
TableName String The name of the table containing the index.
IndexName String The index name.
ColumnName String The name of the column associated with the index.
IsUnique Boolean True if the index is unique. False otherwise.
IsPrimary Boolean True if the index is a primary key. False otherwise.
Type Int16 An integer value corresponding to the index type: statistic (0), clustered (1), hashed (2), or other (3).
SortOrder String The sort order: A for ascending or D for descending.
OrdinalPosition Int16 The sequence number of the column in the index.

CData Cloud

sys_connection_props

Returns information on the available connection properties and those set in the connection string.

The following query retrieves all connection properties that have been set in the connection string or set through a default value:

SELECT * FROM sys_connection_props WHERE Value <> ''

Columns

Name Type Description
Name String The name of the connection property.
ShortDescription String A brief description.
Type String The data type of the connection property.
Default String The default value if one is not explicitly set.
Values String A comma-separated list of possible values. A validation error is thrown if another value is specified.
Value String The value you set or a preconfigured default.
Required Boolean Whether the property is required to connect.
Category String The category of the connection property.
IsSessionProperty String Whether the property is a session property, used to save information about the current connection.
Sensitivity String The sensitivity level of the property. This informs whether the property is obfuscated in logging and authentication forms.
PropertyName String A camel-cased truncated form of the connection property name.
Ordinal Int32 The index of the parameter.
CatOrdinal Int32 The index of the parameter category.
Hierarchy String Shows dependent properties associated that need to be set alongside this one.
Visible Boolean Informs whether the property is visible in the connection UI.
ETC String Various miscellaneous information about the property.

CData Cloud

sys_sqlinfo

Describes the SELECT query processing that the Cloud can offload to the data source.

See SQL Compliance for SQL syntax details.

Discovering the Data Source's SELECT Capabilities

Below is an example data set of SQL capabilities. Some aspects of SELECT functionality are returned in a comma-separated list if supported; otherwise, the column contains NO.

NameDescriptionPossible Values
AGGREGATE_FUNCTIONSSupported aggregation functions.AVG, COUNT, MAX, MIN, SUM, DISTINCT
COUNTWhether COUNT function is supported.YES, NO
IDENTIFIER_QUOTE_OPEN_CHARThe opening character used to escape an identifier.[
IDENTIFIER_QUOTE_CLOSE_CHARThe closing character used to escape an identifier.]
SUPPORTED_OPERATORSA list of supported SQL operators.=, >, <, >=, <=, <>, !=, LIKE, NOT LIKE, IN, NOT IN, IS NULL, IS NOT NULL, AND, OR
GROUP_BYWhether GROUP BY is supported, and, if so, the degree of support.NO, NO_RELATION, EQUALS_SELECT, SQL_GB_COLLATE
OJ_CAPABILITIESThe supported varieties of outer joins supported.NO, LEFT, RIGHT, FULL, INNER, NOT_ORDERED, ALL_COMPARISON_OPS
OUTER_JOINSWhether outer joins are supported.YES, NO
SUBQUERIESWhether subqueries are supported, and, if so, the degree of support.NO, COMPARISON, EXISTS, IN, CORRELATED_SUBQUERIES, QUANTIFIED
STRING_FUNCTIONSSupported string functions.LENGTH, CHAR, LOCATE, REPLACE, SUBSTRING, RTRIM, LTRIM, RIGHT, LEFT, UCASE, SPACE, SOUNDEX, LCASE, CONCAT, ASCII, REPEAT, OCTET, BIT, POSITION, INSERT, TRIM, UPPER, REGEXP, LOWER, DIFFERENCE, CHARACTER, SUBSTR, STR, REVERSE, PLAN, UUIDTOSTR, TRANSLATE, TRAILING, TO, STUFF, STRTOUUID, STRING, SPLIT, SORTKEY, SIMILAR, REPLICATE, PATINDEX, LPAD, LEN, LEADING, KEY, INSTR, INSERTSTR, HTML, GRAPHICAL, CONVERT, COLLATION, CHARINDEX, BYTE
NUMERIC_FUNCTIONSSupported numeric functions.ABS, ACOS, ASIN, ATAN, ATAN2, CEILING, COS, COT, EXP, FLOOR, LOG, MOD, SIGN, SIN, SQRT, TAN, PI, RAND, DEGREES, LOG10, POWER, RADIANS, ROUND, TRUNCATE
TIMEDATE_FUNCTIONSSupported date/time functions.NOW, CURDATE, DAYOFMONTH, DAYOFWEEK, DAYOFYEAR, MONTH, QUARTER, WEEK, YEAR, CURTIME, HOUR, MINUTE, SECOND, TIMESTAMPADD, TIMESTAMPDIFF, DAYNAME, MONTHNAME, CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, EXTRACT
REPLICATION_SKIP_TABLESIndicates tables skipped during replication.
REPLICATION_TIMECHECK_COLUMNSA string array containing a list of columns which will be used to check for (in the given order) to use as a modified column during replication.
IDENTIFIER_PATTERNString value indicating what string is valid for an identifier.
SUPPORT_TRANSACTIONIndicates if the provider supports transactions such as commit and rollback.YES, NO
DIALECTIndicates the SQL dialect to use.
KEY_PROPERTIESIndicates the properties which identify the uniform database.
SUPPORTS_MULTIPLE_SCHEMASIndicates if multiple schemas may exist for the provider.YES, NO
SUPPORTS_MULTIPLE_CATALOGSIndicates if multiple catalogs may exist for the provider.YES, NO
DATASYNCVERSIONThe CData Data Sync version needed to access this driver.Standard, Starter, Professional, Enterprise
DATASYNCCATEGORYThe CData Data Sync category of this driver.Source, Destination, Cloud Destination
SUPPORTSENHANCEDSQLWhether enhanced SQL functionality beyond what is offered by the API is supported.TRUE, FALSE
SUPPORTS_BATCH_OPERATIONSWhether batch operations are supported.YES, NO
SQL_CAPAll supported SQL capabilities for this driver.SELECT, INSERT, DELETE, UPDATE, TRANSACTIONS, ORDERBY, OAUTH, ASSIGNEDID, LIMIT, LIKE, BULKINSERT, COUNT, BULKDELETE, BULKUPDATE, GROUPBY, HAVING, AGGS, OFFSET, REPLICATE, COUNTDISTINCT, JOINS, DROP, CREATE, DISTINCT, INNERJOINS, SUBQUERIES, ALTER, MULTIPLESCHEMAS, GROUPBYNORELATION, OUTERJOINS, UNIONALL, UNION, UPSERT, GETDELETED, CROSSJOINS, GROUPBYCOLLATE, MULTIPLECATS, FULLOUTERJOIN, MERGE, JSONEXTRACT, BULKUPSERT, SUM, SUBQUERIESFULL, MIN, MAX, JOINSFULL, XMLEXTRACT, AVG, MULTISTATEMENTS, FOREIGNKEYS, CASE, LEFTJOINS, COMMAJOINS, WITH, LITERALS, RENAME, NESTEDTABLES, EXECUTE, BATCH, BASIC, INDEX
PREFERRED_CACHE_OPTIONSA string value specifies the preferred cacheOptions.
ENABLE_EF_ADVANCED_QUERYIndicates if the driver directly supports advanced queries coming from Entity Framework. If not, queries will be handled client side.YES, NO
PSEUDO_COLUMNSA string array indicating the available pseudo columns.
MERGE_ALWAYSIf the value is true, The Merge Mode is forcibly executed in Data Sync.TRUE, FALSE
REPLICATION_MIN_DATE_QUERYA select query to return the replicate start datetime.
REPLICATION_MIN_FUNCTIONAllows a provider to specify the formula name to use for executing a server side min.
REPLICATION_START_DATEAllows a provider to specify a replicate startdate.
REPLICATION_MAX_DATE_QUERYA select query to return the replicate end datetime.
REPLICATION_MAX_FUNCTIONAllows a provider to specify the formula name to use for executing a server side max.
IGNORE_INTERVALS_ON_INITIAL_REPLICATEA list of tables which will skip dividing the replicate into chunks on the initial replicate.
CHECKCACHE_USE_PARENTIDIndicates whether the CheckCache statement should be done against the parent key column.TRUE, FALSE
CREATE_SCHEMA_PROCEDURESIndicates stored procedures that can be used for generating schema files.

The following query retrieves the operators that can be used in the WHERE clause:

SELECT * FROM sys_sqlinfo WHERE Name = 'SUPPORTED_OPERATORS'
Note that individual tables may have different limitations or requirements on the WHERE clause; refer to the Data Model section for more information.

Columns

Name Type Description
NAME String A component of SQL syntax, or a capability that can be processed on the server.
VALUE String Detail on the supported SQL or SQL syntax.

CData Cloud

sys_identity

Returns information about attempted modifications.

The following query retrieves the Ids of the modified rows in a batch operation:

         SELECT * FROM sys_identity
          

Columns

Name Type Description
Id String The database-generated Id returned from a data modification operation.
Batch String An identifier for the batch. 1 for a single operation.
Operation String The result of the operation in the batch: INSERTED, UPDATED, or DELETED.
Message String SUCCESS or an error message if the update in the batch failed.

CData Cloud

sys_information

Describes the available system information.

The following query retrieves all columns:

SELECT * FROM sys_information

Columns

NameTypeDescription
ProductStringThe name of the product.
VersionStringThe version number of the product.
DatasourceStringThe name of the datasource the product connects to.
NodeIdStringThe unique identifier of the machine where the product is installed.
HelpURLStringThe URL to the product's help documentation.
LicenseStringThe license information for the product. (If this information is not available, the field may be left blank or marked as 'N/A'.)
LocationStringThe file path location where the product's library is stored.
EnvironmentStringThe version of the environment or rumtine the product is currently running under.
DataSyncVersionStringThe tier of CData Sync required to use this connector.
DataSyncCategoryStringThe category of CData Sync functionality (e.g., Source, Destination).

CData Cloud

Connection String Options

The connection string properties are the various options that can be used to establish a connection. This section provides a complete list of the options you can configure in the connection string for this provider. Click the links for further details.

For more information on establishing a connection, see Establishing a Connection.

Authentication


PropertyDescription
AccessTokenAccessToken of the currently authenticated user.
ContractIdContractId of the currently authenticated user.

SSL


PropertyDescription
SSLServerCertSpecifies the certificate to be accepted from the server when connecting using TLS/SSL.

Logging


PropertyDescription
VerbositySpecifies the verbosity level of the log file, which controls the amount of detail logged. Supported values range from 1 to 5.

Schema


PropertyDescription
BrowsableSchemasOptional setting that restricts the schemas reported to a subset of all available schemas. For example, BrowsableSchemas=SchemaA,SchemaB,SchemaC .

Miscellaneous


PropertyDescription
MaxRowsSpecifies the maximum rows returned for queries without aggregation or GROUP BY.
MaxThreadsThe Max Thread.
PagesizeSpecifies how many issues the driver will retrieve for each request. The max value for a Smaregi API is 1000. However, The max value for a DailySum table exepect. This table max value is 100.
PseudoColumnsSpecifies the pseudocolumns to expose as table columns. Use the format 'TableName=ColumnName;TableName=ColumnName'. The default is an empty string, which disables this property.
TimeoutSpecifies the maximum time, in seconds, that the provider waits for a server response before throwing a timeout error. The default is 60 seconds. Set to 0 to disable the timeout.
CData Cloud

Authentication

This section provides a complete list of the Authentication properties you can configure in the connection string for this provider.


PropertyDescription
AccessTokenAccessToken of the currently authenticated user.
ContractIdContractId of the currently authenticated user.
CData Cloud

AccessToken

AccessToken of the currently authenticated user.

Data Type

string

Default Value

""

Remarks

AccessToken of the currently authenticated user.

CData Cloud

ContractId

ContractId of the currently authenticated user.

Data Type

string

Default Value

""

Remarks

ContractId of the currently authenticated user.

CData Cloud

SSL

This section provides a complete list of the SSL properties you can configure in the connection string for this provider.


PropertyDescription
SSLServerCertSpecifies the certificate to be accepted from the server when connecting using TLS/SSL.
CData Cloud

SSLServerCert

Specifies the certificate to be accepted from the server when connecting using TLS/SSL.

Data Type

string

Default Value

""

Remarks

If using a TLS/SSL connection, this property can be used to specify the TLS/SSL certificate to be accepted from the server. Any other certificate that is not trusted by the machine is rejected.

This property can take the following forms:

Description Example
A full PEM Certificate (example shortened for brevity) -----BEGIN CERTIFICATE----- MIIChTCCAe4CAQAwDQYJKoZIhv......Qw== -----END CERTIFICATE-----
A path to a local file containing the certificate C:\cert.cer
The public key (example shortened for brevity) -----BEGIN RSA PUBLIC KEY----- MIGfMA0GCSq......AQAB -----END RSA PUBLIC KEY-----
The MD5 Thumbprint (hex values can also be either space or colon separated) ecadbdda5a1529c58a1e9e09828d70e4
The SHA1 Thumbprint (hex values can also be either space or colon separated) 34a929226ae0819f2ec14b4a3d904f801cbb150d

If not specified, any certificate trusted by the machine is accepted.

Use '*' to signify to accept all certificates. Note that this is not recommended due to security concerns.

CData Cloud

Logging

This section provides a complete list of the Logging properties you can configure in the connection string for this provider.


PropertyDescription
VerbositySpecifies the verbosity level of the log file, which controls the amount of detail logged. Supported values range from 1 to 5.
CData Cloud

Verbosity

Specifies the verbosity level of the log file, which controls the amount of detail logged. Supported values range from 1 to 5.

Data Type

string

Default Value

"1"

Remarks

This property defines the level of detail the Cloud includes in the log file. Higher verbosity levels increase the detail of the logged information, but may also result in larger log files and slower performance due to the additional data being captured.

The default verbosity level is 1, which is recommended for regular operation. Higher verbosity levels are primarily intended for debugging purposes. For more information on each level, refer to Logging.

When combined with the LogModules property, Verbosity can refine logging to specific categories of information.

CData Cloud

Schema

This section provides a complete list of the Schema properties you can configure in the connection string for this provider.


PropertyDescription
BrowsableSchemasOptional setting that restricts the schemas reported to a subset of all available schemas. For example, BrowsableSchemas=SchemaA,SchemaB,SchemaC .
CData Cloud

BrowsableSchemas

Optional setting that restricts the schemas reported to a subset of all available schemas. For example, BrowsableSchemas=SchemaA,SchemaB,SchemaC .

Data Type

string

Default Value

""

Remarks

Listing all available database schemas can take extra time, thus degrading performance. Providing a list of schemas in the connection string saves time and improves performance.

CData Cloud

Miscellaneous

This section provides a complete list of the Miscellaneous properties you can configure in the connection string for this provider.


PropertyDescription
MaxRowsSpecifies the maximum rows returned for queries without aggregation or GROUP BY.
MaxThreadsThe Max Thread.
PagesizeSpecifies how many issues the driver will retrieve for each request. The max value for a Smaregi API is 1000. However, The max value for a DailySum table exepect. This table max value is 100.
PseudoColumnsSpecifies the pseudocolumns to expose as table columns. Use the format 'TableName=ColumnName;TableName=ColumnName'. The default is an empty string, which disables this property.
TimeoutSpecifies the maximum time, in seconds, that the provider waits for a server response before throwing a timeout error. The default is 60 seconds. Set to 0 to disable the timeout.
CData Cloud

MaxRows

Specifies the maximum rows returned for queries without aggregation or GROUP BY.

Data Type

int

Default Value

-1

Remarks

This property sets an upper limit on the number of rows the Cloud returns for queries that do not include aggregation or GROUP BY clauses. This limit ensures that queries do not return excessively large result sets by default.

When a query includes a LIMIT clause, the value specified in the query takes precedence over the MaxRows setting. If MaxRows is set to "-1", no row limit is enforced unless a LIMIT clause is explicitly included in the query.

This property is useful for optimizing performance and preventing excessive resource consumption when executing queries that could otherwise return very large datasets.

CData Cloud

MaxThreads

The Max Thread.

Data Type

string

Default Value

"1"

Remarks

CData Cloud

Pagesize

Specifies how many issues the driver will retrieve for each request. The max value for a Smaregi API is 1000. However, The max value for a DailySum table exepect. This table max value is 100.

Data Type

string

Default Value

"1000"

Remarks

Number of Issue entries retrieved in each page.

CData Cloud

PseudoColumns

Specifies the pseudocolumns to expose as table columns. Use the format 'TableName=ColumnName;TableName=ColumnName'. The default is an empty string, which disables this property.

Data Type

string

Default Value

""

Remarks

This property allows you to define which pseudocolumns the Cloud exposes as table columns.

To specify individual pseudocolumns, use the following format: "Table1=Column1;Table1=Column2;Table2=Column3"

To include all pseudocolumns for all tables use: "*=*"

CData Cloud

Timeout

Specifies the maximum time, in seconds, that the provider waits for a server response before throwing a timeout error. The default is 60 seconds. Set to 0 to disable the timeout.

Data Type

int

Default Value

60

Remarks

This property controls the maximum time, in seconds, that the Cloud waits for an operation to complete before canceling it. If the timeout period expires before the operation finishes, the Cloud cancels the operation and throws an exception.

The timeout applies to each individual communication with the server rather than the entire query or operation. For example, a query could continue running beyond 60 seconds if each paging call completes within the timeout limit.

Setting this property to 0 disables the timeout, allowing operations to run indefinitely until they succeed or fail due to other conditions such as server-side timeouts, network interruptions, or resource limits on the server. Use this property cautiously to avoid long-running operations that could degrade performance or result in unresponsive behavior.

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 24.0.9175