Previous Topic: DISPLAY - Display Keys and ColumnsNext Topic: DQL - Change to DQL Mode


DRAW - Create a Simple Query

Purpose

Entering the DRAW command creates a simple query that finds all the simple columns for the table named in the operand. Additional operands differ according to whether you are in DQL Mode or SQL Mode.

When to Use It

Use DRAW to automatically create a query or, on the Editor panel, to quickly copy all column names at the end of any query text. If on the Editor panel and part of a statement already exists, simply delete the extra statement.

DQL Mode Syntax

Enter

With

When You Want to Create a Query That:

DRAW

table-name

Finds data in all simple columns.

DRAW

table-name ALL

Find data in all simple and compound columns.

SQL Mode Syntax

Enter

With

When You Want to Create a Query That:

DRAW

table-name

Finds data in all simple columns.

DRAW

table-name
INSERT

Contains an INSERT clause instead of SELECT.

DRAW

table-name
UPDATE

Contains an UPDATE clause instead of SELECT.

DRAW

table-name
DELETE

Contains a DELETE clause instead of SELECT.

See the chapter on SQL query syntax for information about using SQL statements.

Example

=> draw cai-accts-rec Place the cursor on the desired name and press the appropriate PFkey ------------------------------------------------------------------------DQA20 DATAQUERY: DIRECTORY OF TABLES DATADICTIONARY BASE ID: 189 ----------------------------------------------------------------------------- TABLE NAME |STATUS| DESCRIPTION ----------------------------------------------------------------------------- ADDRESS | O | CAI-ACCTS-REC | O | ORDER ENTRY DEMO ACCTS RECORD CAI-CUST-REC | O | CUSTOMERS RECORD CAI-DETAIL-REC | O | DETAILS RECORD CAI-ITEMS-REC | O | ITEMS RECORD

Result

=> ------------------------------------------------------------------------DQD10 DATAQUERY: EDITOR ----------------------------------------------------------------------------- NAME: _______________ TYPE: QUERY STATUS: PRIVATE DESCRIPTION: ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+. .. ================================ T O P ===================================== 01 FIND CAI-ACCTS-REC ROWS 02 PRINT FROM CAI-ACCTS-REC ORD-ID BILL-DT BILL-YR BILL-MO 03 BILL-DAY ORD-AMT FRT-AMT DISC-AMT CUST-ID IND-CD CUST-NO .. =========================== B O T T O M ================================== ----------------------------------------------------------------------------- <PF1> HELP <PF2> RETURN <PF3> EXECUTE <PF4> SAVE <PF5> DIALOG DEF <PF6> DELETE <PF7> BACKWARD <PF8> FORWARD <PF9> UPDATE <PF10> VALIDATE <PF11> RIGHT/LEFT <PF12> CREATE MODE