CONVERT command
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.
CONVERT Command Prompt
type ===> QUERY
name ===>
To convert an object from temporary storage, enter QUERY
as its type.
To convert an object from the database, enter its name (and
optionally its type).
TARGET ===> QUERY
You can type QUERY to place the SQL query text on the SQL
Query panel, or VARS to place it in the global variable pool.
If you specify no target, the default is QUERY.
CONFIRM ===> YES
Display the Confirmation panel before converting the current
query to the SQL Query panel. YES or NO.
Press Enter to execute the command from this panel.
13=Help 15=End
Please follow the directions on the Command Prompt panel.
Command ===>
Q.STAFF | NAME | DEPT | JOB | COMM |
--------+-----------+--------+-------+------------|
| P. AO. | &DEPT | P. | P. |
CONVERT THISONE
The prompt panel shown in the following figure displays:
CONVERT Command Prompt -- Values of Variables
Your CONVERT command converts a query with variables that need values.
Fill in a value after the arrow for each variable named below:
&DEPT ===>
===>
===>
===>
===>
===>
===>
===>
===>
===>
Then press Enter to execute the command from this panel.
13=Help 15=End
Please give a value for each variable name.
Command ===>
SELECT "NAME", "JOB", "COMM"
FROM "Q"."STAFF"
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.