7.2.1. Custom SQL Linked to Products, or Linked to Categories

fmCustomSQL, fmMySQLHelp

The "Custom SQL" section of Store Manager allows to link products or categories to a specific SQL that was previously created and run SQL commands directly on the main product page.

To perform this, during SQL query creation in Custom SQL section, choose "Linked to Products" or "Linked to Categories":

Magento Store Manager Custom SQL Section Link SQL to Product/Category entity

For example, create the query that would delete the gift card account with zero balance.

Magento Store Manager Custom SQL Section SQL Example

Go to the main product page. In the top panel, you can see the Custom SQL option.

Magento Store Manager Custom SQL Section

Select the products and to activate the necessary SQL command, use the browse [...] button, which opens the drop-down list.

Magento Store Manager Select SQL to Run

You can create as many commands as you need. Do not forget to link your SQLs to products or categories and you will be able to choose the necessary query on the product page.

To get more information about linking Custom SQL(s) to the Products or Categories look through this guide:

What Is Custom SQL? How to Use Magento Custom SQLs for Data Management?