Postman collection
Items Read

pixiReadAddItems

Returns additional item records (supplier-specific item data such as EAN, supplier item number and prices) from `AddItems`, filtered by key, date range and supplier.

Reads rows from the table AddItems. These rows hold supplier-specific item data: EAN/UPC, supplier item number, internal item number, prices, VAT rate and the preferred-supplier flag.

The procedure first prepares the parameters:

  • If RowCount is set and not 0, the number of returned rows is limited to RowCount.
  • If AddItemKey is not passed, it is set to 0.
  • If SupplNr is empty or contains only spaces, it is treated as not set.

It then runs exactly one of the following queries. The first branch whose condition matches wins:

  1. Create or update date (CreateAndUpdateDateFrom and/or CreateAndUpdateDateTo set): returns records with AddItemKey > AddItemKey.
    • The from bound matches if CreateDate or UpdateDate is >= CreateAndUpdateDateFrom.
    • The to bound matches if CreateDate or UpdateDate is < CreateAndUpdateDateTo.
  2. Create date (CreateDateFrom and/or CreateDateTo set): returns records with AddItemKey > AddItemKey and CreateDate >= from and < to.
  3. Update date (UpdateDateFrom and/or UpdateDateTo set): returns records with AddItemKey > AddItemKey and UpdateDate >= from and < to.
  4. Key range (RowCount passed, even as 0): returns records with AddItemKey > AddItemKey.
  5. Single key (otherwise): returns the record with AddItemKey = AddItemKey.

In all branches the optional SupplNr filter limits the result to one supplier. Branches 1 to 4 are sorted by AddItemKey ascending. This allows paging: pass the last received AddItemKey together with RowCount to get the next page.

Notes

  • The table is read with NOLOCK, so uncommitted changes may be visible.
  • Without any parameter, AddItemKey becomes 0 and the single-key branch runs. This normally returns no rows.
  • Passing RowCount = 0 selects the key-range branch without a row limit. This returns all matching records, which can be slow on large tables.
  • The bounds of the combined create/update filter are each checked against either date column. A record can therefore match even if neither date lies inside the range, for example when CreateDate is before the range and UpdateDate is after it.
  • Only blank values of SupplNr are normalised. Leading spaces are not trimmed and can cause no match.
  • Date filters take precedence over each other in this order: combined create/update, create, update. Lower-priority date parameters are ignored when a higher-priority one is set.
  • All upper bounds are exclusive (<).
  • The header comment says "supplier data", but the procedure returns additional item records.
  • Column types are not visible in the code. Types marked unknown are assumed from the column names.

Tables used

AddItems · Read
SQL object:
dbo.pipiReadAddItems
Updated at 2026-10-30