CData JDBC Driver for Magento 2019 - Online Help
Questions / Feedback?

ProductImages

CData JDBC Driver for Magento 2019 - Build 19.0.7354

Create, update, delete, and query the available product images for a specific product in Magento.

Select

The driver will use the Magento API to filter the results by StoreId, Id, and ProductId while the rest of the filter is executed client side within the driver. Use the equals (=) comparison to specify values for these columns.

For example, the following queries are processed server side:

SELECT * FROM ProductImages WHERE ProductId = 232
SELECT * FROM ProductImages WHERE ProductId = 232 AND StoreId=2
You can turn off client-side execution by setting SupportEnhancedSQL to false, in which case any search criteria that refers to any other columns or operators will cause an error.

Insert

To add a product image, specify the FileName, FileMimeType, and FileContent fields.

INSERT INTO ProductImages(FileMimeType,FileContent,ProductId) VALUES ('image/png','pfiJRMywXXktwjlucKvsdzgAmP7HPp5idpm0RcLJfenKN4CPd7a3T+tEGijz8vLwAAAAABJRU5ErkJggg==',231)

Update

Magento allows updates for the Label, Position, Exclude, Types, FileName, FileMimeType, and FileContent columns.

UPDATE ProductImages SET Label = 'label 1234' WHERE ProductId = 231 AND Id=2808

Delete

ProductImages can be deleted by providing the Id and ProductId and issuing a DELETE statement.

DELETE FROM ProductImages WHERE ProductId=231 AND Id=1000

To delete ProductImages from a specific store, additionally specify the StoreId.

DELETE FROM ProductImages WHERE ProductId=231 AND Id=1000 AND StoreId=2

Columns

Name Type ReadOnly Description
Id [KEY] Integer True

The Id of the image.

ProductId Integer False

The Id of the product.

Label String False

A label that will be displayed on the frontend when pointing to the image.

Position Integer False

The Sort Order option. The order in which the images are displayed in the MORE VIEWS section.

Exclude Integer False

Specifies the image type that the image will associate to.

Url String True

The URL of the image.

Types String False

Array of image types. Can have the following values: image, small_image, and thumbnail.

FileName String False

Image file name.

FileMimeType String False

File MIME type. Can have the following values: image/jpeg, image/png, etc.

FileContent String False

Image file content (base_64 encoded).

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

The id of the store.

 
 
Copyright (c) 2020 CData Software, Inc. - All rights reserved.
Build 19.0.7354.0