2. Custom SQL
fmCustomSQL, fmAddNewSQLDialog, fmEditExistSQLDialog - Custom SQL Section
This section can be used to work with your store DB, fetching data easier and faster. You can create and execute SQL queries and bulk update CubeCart data instantly. Note that it requires the above average skills as it may be destructive if performed incorrectly. It is strongly recommended to make full Database backup before executing any query.
Custom SQL section has 2 tabs: Edit and Logs
Edit tab has two sections: the top one is showing the query content (SQL text), and the bottom one lists all available queries.
Once you create and execute any SQL query in the edit tab, you'll see the logs tab. It shows if any error occurs while executing the query. Please note that it is strongly recommended to make database backup before executing any query.
In Custom SQL context menu or toolbar you can find the following options:
- Allows you to load SQL query that was previously saved into file.
- Allows you to save any SQL query into file.
- New SQL allows you to create new SQL query. Once you click on the new SQL icon, you'll see the blank form which is used to create new query. Specify any name here and hit Ok.
- Note: It is a good idea to use informative names to cope with your queries easily.
- At the bottom of the page you'll see the new query icon. Now you can either run Query builder or write query text in the top part of Edit tab directly. Once you're finished with this query hit the save button and execute the Query suing corresponding button. The results tab will appear, showing the result (if you update any table) or the returned data (if you select any data using SQL query), arranged according to a certain condition.
- Allows you to rename any SQL Query listed at the bottom.
- Allows you to delete selected SQL queries. Note that you will not be able to undo the delete action, unless you've saved the queries into file.
- Allows you to execute the SQL code and to check the result.
- When creating complicated queries it's more convenient to use Visual Query Builder.