Using QMF


CONVERT command

The CONVERT command converts a QBE query to an SQL query. If you specify CONVERT ?, the following Prompt panel 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 ===>

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 fill in 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:

CONVERT THISONE

The following Prompt panel 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 ===>

When you fill in the Department number (84), the following SQL query displays:

SELECT "NAME", "JOB", "COMM"
FROM "Q"."STAFF"
WHERE ("DEPT" = 84)
ORDER BY 0000001

The CONVERT command does not operate on a query at a remote location.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]