The CONVERT command converts a QBE query to an SQL query.
If you specify CONVERT ?, the prompt panel shown in the following figure
displays. You can complete the command on the prompt panel.
If your query contains substitution variables, and you do not provide values for them on your
CONVERT command, a prompt panel displays. You can use this panel to supply the values for the
variables. For example, assume that you write the following query, and save it as THISONE:
Q.STAFF | NAME | DEPT | JOB | COMM |
| P. AO. | &DEPT | P. | P. |
Now, suppose that you want to convert it to SQL, but specify only:
The prompt panel shown in the following figure displays:
When you enter the department number (84), the following SQL query displays:
SELECT "NAME", "JOB", "COMM"
WHERE ("DEPT" = 84)
ORDER BY 0000001
The CONVERT command does not operate on a QBE query at a remote location.
A single QBE insert or delete query can result in multiple SQL
statements after the conversion. These statements are all placed on the SQL Query panel. However,
all of the statements after the first are turned into query comments (each line is preceded by two
hyphens). Use the Delete key to remove the hyphens from any statements that you want to run. You
must place a semicolon at the end of every SQL statement except the last. The DSQEC_RUN_MQ global
variable controls support for multi-statement queries.