end export - dbmanagement.info

Download Report

Transcript end export - dbmanagement.info

Loading Utilities
Loading Utilities in Teradata

MULTILOAD

BTEQ

FASTEXPORT

FASTLOAD
2
MULTILOAD

Batch mode utility that runs on the host system.

Supports up to five populated tables.

Multiple operations with one pass of input files.

Conditional logic for applying changes.

Supports INSERTs, UPDATEs, DELETEs and UPSERTs;

Affected data blocks only written once.

Full Restart capability.

Error reporting via error tables.
3
Phases of IMPORT Task

Preliminary :Basic set up

DML Transaction: Send the DML steps to the AMPs

Acquisition : Send the input data to the AMPs

Application: Apply the input data to appropriate table(s)

Cleanup: Basic clean up
4
Phase 1: Preliminary

Validate all statements MultiLoad and SQL

Create work tables One per target table

Create error tables Two per target table

Create Restart log One per IMPORT run

Apply locks to target tables Prevent DDL
5
Phase 2: DML Transaction

Send prototype DML to the Teradata Database

Store DML steps in work tables

Add a USING modifier to the request

Allows link between DML and transaction record
6
Phase 3: Acquisition
 Get the data from host and apply it to appropriate AMP Worktables
– Add “Match Tag” information to record.
– Make blocks and send “quickpath” to AMPs.
– Deblock and resend record to “correct” AMP.
 Reblock and store in worktable of target table.
– Sort the reblocked records in the work tables.
– Sort by hash value and sequence to be applied.
 Set up transition to the Application phase.
– Upgrade locks on target tables to Write.
– Set table headers for Application phase.
– This is effectively the “point of no return”.
NOTE:– Errors that occur in this phase go into the Acquisition Error
 Table (default name is ET_tablename).
 There is no acquisition phase activity for a DELETE Task.
7
Phase 4: Application

Execute MLOAD for each target table as a single multi-statement request.

AMPs independently apply changes to target tables.

Executed as a single transaction without rollback.

Restartable based on last checkpoint.

No transient journal needed.



Note:
Errors that occur in this phase go into the Application Error
Table (default name is UV_tablename).
8
Phase 5: Cleanup

All locks are released.

Table headers are restored across all AMPs.

Statistics are reported.

Final Error Code is reported.

Target tables are made available to other users.

Work Tables are dropped.

Empty Error Tables are dropped.

Log Table is dropped (if Error Code = 0).

MLOAD Session Logoff: LOGOFF request is sent to each AMP with a session.
9
DELETE Task Differences from
IMPORT Task

Deleting based on a UPI access is not permitted.

A DML DELETE statement is sent to each AMP with a match tag parcel.

No Acquisition phase because no variable input records to apply.

Application phase reads each target block and deletes qualifying rows.

Why use MultiLoad DELETE (versus SQL DELETE)?




MultiLoad DELETE is faster and uses less disk space and I/O (no Transient Journal).
MultiLoad DELETE is restartable.
If SQL DELETE is aborted, Teradata applies Transient Journal rows.
SQL DELETE can be resubmitted, but starts from beginning.
10
MultiLoad Statements
.LOGTABLE [ restartlog_tablename ] ;
.LOGON [ tdpid/userid, password ] ;
.BEGIN MLOAD TABLES [ tablename1, ... ]
WORKTABLES [ worktablename1, ... ] ,
ERRORTABLES [ errortablename1 errortablename2 , ... ]
ERRLIMIT [number of rows]
CHECKPOINT [checkpoint in minutes or no of records]
TENACITY [tenacity in min]
AMPCHECK [Ampcheck parameter]
SESSIONS [no of sessions];
.LAYOUT [ layout_name ] ;
.FIELD ….. ;
.FILLER ….. ;
.DML LABEL [ label ] ;
.IMPORT INFILE [ filename ]
[ FROM m ] [ FOR n ] [ THRU k ]
[ FORMAT FASTLOAD | BINARY | TEXT | UNFORMAT | VARTEXT 'c' ]
LAYOUT [ layout_name ]
APPLY [ label ] [ WHERE condition ] ;
.END MLOAD ;
.LOGOFF ;
11
MLOAD DELETE EXAMPLE
.LOGTABLE RETAIL.EMP_EXP_LOG;
.LOGON DEMOTDAT/DBC,DBC;
.BEGIN DELETE MLOAD TABLES RETAIL.EMPLOYEE_EXP;
DELETE FROM RETAIL.EMPLOYEE_EXP WHERE EMP_EXP < 6
;
.END MLOAD;
.LOGOFF;
12
MLOAD UPSERT EXAMPLE
.LOGTABLE RETAIL.EMP_SAL_LOG;
.LOGON DEMOTDAT/DBC,DBC;
.BEGIN MLOAD TABLES RETAIL.EMPLOYEE_SAL,RETAIL.EMPLOYEE_SAL_HIST;
.LAYOUT EMPLOYEE_TRANS;
.FILLER JOBCODE * VARCHAR(3);
.FIELD EMPNO
* VARCHAR(8);
.FIELD DEPTNO
* VARCHAR(5);
.FIELD SALARY
* VARCHAR(11);
.DML
LABEL PAYROLL
DO INSERT FOR MISSING UPDATE ROWS;
UPDATE RETAIL.EMPLOYEE_SAL SET SALARY=:SALARY WHERE EMPNO=:EMPNO;
INSERT INTO RETAIL.EMPLOYEE_SAL(EMPNO,SALARY)
VALUES(:EMPNO,:SALARY);
.DML
LABEL TERMINATE;
DELETE FROM RETAIL.EMPLOYEE_SAL WHERE EMPNO=:EMPNO;
INSERT INTO RETAIL.EMPLOYEE_SAL_HIST(EMPNO,DEPTNO)
VALUES (:EMPNO,:DEPTNO);
.IMPORT INFILE mload_upsert
FORMAT VARTEXT '~' DISPLAY ERRORS NOSTOP
LAYOUT EMPLOYEE_TRANS
APPLY PAYROLL WHERE JOBCODE='PAY'
APPLY TERMINATE WHERE JOBCODE='DEL'
;
.END MLOAD;
.LOGOFF;
13
MLOAD VARTEXT EXAMPLE
.LOGTABLE RETAIL.EMPLOYEE_TEST_LOG;
.LOGON DEMOTDAT/DBC,DBC;
DATABASE RETAIL;
DROP TABLE RETAIL.EMPLOYEE_TEST_ET;
DROP TABLE RETAIL.EMPLOYEE_TEST_WT;
DROP TABLE RETAIL.EMPLOYEE_TEST_UV;
.BEGIN IMPORT MLOAD TABLES EMPLOYEE_TEST
WORKTABLES RETAIL.EMPLOYEE_TEST_WT
ERRORTABLES RETAIL.EMPLOYEE_TEST_ET
RETAIL.EMPLOYEE_TEST_UV
;
.LAYOUT EMPLOYEE_TEST_LAYOUT;
.FIELD I_EMPNO * VARCHAR(15);
.FIELD I_NAME * VARCHAR(18);
14
EXAMPLE Contd
.DML LABEL EMPLOYEE_TEST_INS;
INSERT EMPLOYEE_TEST
VALUES (
:I_EMPNO,
: I_NAME
);
.IMPORT INFILE mload_vartext.txt
FORMAT VARTEXT '~'
LAYOUT EMPLOYEE_TEST_LAYOUT
APPLY EMPLOYEE_TEST_INS;
.END MLOAD;
.LOGOFF;
15
MultiLoad Limitations

No data retrieval capability.

Concatenation of input data files is not allowed.

Host will not process arithmetic functions.

Host will not process exponentiation or aggregates.

Cannot process tables defined with USI’s, Referential Integrity, Join
Indexes, Hash Indexes, or Triggers.
16
FASTLOAD

Purpose
– Load large amounts of data into an empty table at high speed.

Concepts
–
–
–
–

Loads into an empty table with no secondary indexes.
Has two phases - creates an error table for each phase.
Status of run is displayed.
Checkpoints can be taken for restarts.
Restrictions
– Only load 1 empty table with 1 FastLoad job.
– Teradata Database will accommodate up to 15 FL/ML/FE applications at one time.
– Tables defined with Referential integrity, secondary indexes, Join Indexes,
HashIndexes, or Triggers cannot be loaded with FastLoad.
– Tables with Soft Referential Integrity (V2R5) can be loaded with FastLoad.
– Duplicate rows cannot be loaded into a multiset table with FastLoad.
– If an AMP goes down, FastLoad cannot be restarted until it is back online.
17
FASTLOAD-PHASE1

Step 1 – FastLoad is executed on a host and sends blocks of records to PE sessions.

Step 2 – Parsing Engine Sessions receive a block of records from the FastLoad utility
and simple passes the block to an AMP via the BYNET.

Step 3 – The AMP receives a block of records in memory.

Step 4 – The AMP hashes each record in the block and redistributes each row to the
Message Passing Layer (PDE and BYNET).

Step 5 – The Message Passing Layer delivers rows to the appropriate AMP based on
row hash value. Each AMP collects the rows in memory.

Step 6 – When enough rows are collected to fill a block, the AMP writes the block to
disk.
18
FASTLOAD-PHASE2

Step 1 – FastLoad receives the END LOADING; statement.

Step 2 – FastLoad sends a request to the Parsing Engine to indicate the start of Phase
2.

Step 3 – The PE broadcasts the start of Phase 2 to all AMPs.

Step 4 – Each AMP reads its blocks in from disk.

Step 5 – Each AMP sorts its data rows based on row hash sequence.

Step 6 – Each AMP writes the sorted blocks back to disk.
19
FASTLOAD ERROR TABLES

ErrorTable1






Contains one row for each row which failed to be loaded due to constraint
violations or translation errors.
The table has three columns:
ErrorCode Integer The Error Code in DBC.ErrorMsgs.
ErrorFieldName VarChar(30) The column that caused the error.
DataParcel VarByte(64000) The data record sent by the host.

ErrorTable2





For non-duplicate rows, captures those rows that cause a UPI duplicate violation.
Duplicate rows are counted and reported but not captured.
Error tables are automatically dropped if empty upon completion of the run.
Performance Note: Rows are written into error tables one row at a time.
Errors slowdown FastLoad.
20
FASTLOAD EXAMPLE(TEXT MODE)
.logon demotdat/dbc,dbc;
DATABASE RETAIL;
DROP TABLE EMPLOYEE_TEST;
DROP TABLE ET_EMPLOYEE_TEST_ER1;
DROP TABLE UV_EMPLOYEE_TEST_ER2;
CREATE SET TABLE RETAIL.employee_test ,NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL
(
EmpNo VARCHAR(3) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
Name VARCHAR(8) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
Emp_Join_DT DATE FORMAT 'yyyy-mm-dd',
Emp_Birth_DT DATE FORMAT 'yyyy-mm-dd')
UNIQUE PRIMARY INDEX ( EmpNo );
BEGIN LOADING
employee_test
ERRORFILES
ET_EMPLOYEE_TEST_ER1,
UV_EMPLOYEE_TEST_ER2;
21
EXAMPLE (Contd)
SET RECORD TEXT ;
DEFINE
I_EmpNo (CHAR(3)),
I_Name (CHAR(8)),
I_Emp_Join_DT (CHAR(8)),
I_Emp_Birth_DT(CHAR(8))
FILE=C:\Documents and Settings\shalini.agarwal\fload_text_record.txt;
INSERT INTO employee_test
VALUES (
:I_EmpNo,
:I_Name,
:I_Emp_Join_DT (DATE, FORMAT 'YYYYMMDD'),
:I_Emp_Birth_DT (DATE, FORMAT 'YYYYMMDD')
);
.END LOADING;
.LOGOFF;
22
FASTLOAD EXAMPLE(VARTEXT)
.logon demotdat/dbc,dbc;
DATABASE RETAIL;
DROP TABLE EMPLOYEE_TEST;
DROP TABLE ET_EMPLOYEE_TEST_ER1;
DROP TABLE UV_EMPLOYEE_TEST_ER2;
CREATE SET TABLE RETAIL.employee_test ,NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL
(
EmpNo VARCHAR(15) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
Name VARCHAR(18) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL)
UNIQUE PRIMARY INDEX ( EmpNo );
BEGIN LOADING
employee_test
ERRORFILES
ET_EMPLOYEE_TEST_ER1,
UV_EMPLOYEE_TEST_ER2;
23
EXAMPLE (Contd)
SET RECORD VARTEXT "~" ;
DEFINE
I_EmpNo (VARCHAR(15)),
I_Name (VARCHAR(18))
FILE=C:\Documents and Settings\shalini.agarwal\fload_vartext;
INSERT INTO employee_test
VALUES (
:I_EmpNo,
:I_Name
);
.END LOADING;
.LOGOFF;
24
FASTLOAD WITH NULLIF
DEFINE in_Acctno (CHAR(9))
,in_Status (CHAR(10))
,in_Trnsdate (CHAR(10), NULLIF = '0000-00-00')
,in_Balfwd (INTEGER)
,in_Balcurr (CHAR(7))
FILE = infile5;
INSERT INTO Accounts VALUES (
:in_Acctno
,:in_Status
,:in_Trnsdate (FORMAT 'YYYY-MM-DD')
,:in_Balfwd
,:in_Balcurr);
25
FASTLOAD WITH RECORD
.logon demotdat/dbc,dbc;
DATABASE RETAIL;
DROP TABLE DEPT_TEST;
DROP TABLE ET_DEPT_TEST_ER1;
DROP TABLE UV_DEPT_TEST_ER2;
CREATE SET TABLE RETAIL.DEPT_TEST ,NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL
(
DepNo VARCHAR(15) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
Dep_Name VARCHAR(18) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL)
UNIQUE PRIMARY INDEX ( DepNo );
BEGIN LOADING
DEPT_test
ERRORFILES
ET_DEPT_TEST_ER1,
UV_DEPT_TEST_ER2;
26
EXAMPLE (Contd)
SET RECORD VARTEXT "~" ;
DEFINE
I_DepNo (VARCHAR(15)),
I_Dep_Name (VARCHAR(18))
FILE=C:\Documents and Settings\shalini.agarwal\fload_vartext_record.txt;
RECORD 2;
INSERT INTO DEPT_test
VALUES (
:I_DepNo,
:I_DepNo
);
.END LOADING;
.LOGOFF;
27
FASTEXPORT

Exports large volumes of formatted data from Teradata to a host file.

Takes advantage of multiple sessions.

Export from multiple tables.

Uses Support Environment.

Fully automated restart.
28
FASTEXPORT COMMANDS
.BEGIN EXPORT
SESSIONS max min
TENACITY hours
SLEEP minutes

SESSIONS:
–
–
Maximum, and optionally, minimum number of sessions the utility may use - defaults to 4 for
UNIX FastExport.
The utility will log on two additional SQL sessions: one for the Restart Log and one for the
SELECT.

TENACITY:

SLEEP:

.END EXPORT;
–
–
–
–
Number of hours FastExport will try to establish a connection to the system; default is 4.
Number of minutes that FastExport will wait between logon attempts; default is 6.
Delimits a series of commands that define a single EXPORT action.
Causes the utility to send the SELECT(s) to the Teradata Database.
29
The SELECT Request

Defines the data to be returned to the host, server, or client workstation.

The job may consist of multiple SELECT statements which will be executed
sequentially by FastExport.

Applies normal transaction locks (READ lock) which are fully automatic.

These locks are normally held by the utility until all response rows have been moved to
AMP spool, and then are released.

Restrictions - you cannot use SELECT (in a FastExport job) with the following:
–
Equality condition for a Primary Index or USI
30
FASTEXPORT EXAMPLE(ACCEPT)
fexp<<EOF
.LOGTABLE TPCH.PARTSUPP_LOG;
.LOGON demotdat/dbc,dbc;
.ACCEPT SUPPKEY FROM FILE partsupp.param;
DATABASE TPCH;
.BEGIN EXPORT
SESSIONS 2;
.EXPORT OUTFILE partsuppacc.txt
FORMAT TEXT
MODE RECORD;
31
EXAMPLE(Contd)
SELECT CAST(PS_PARTKEY AS CHAR(4)),
CAST(PS_SUPPKEY AS CHAR(3)) ,
CAST(PS_AVAILQTY AS CHAR(4)) ,
CAST(PS_SUPPLYCOST AS CHAR(17)) ,
CAST(PS_COMMENT AS CHAR(199))
FROM TPCH.PARTSUPP WHERE PS_SUPPKEY=&SUPPKEY;
.END EXPORT;
.LOGOFF;
EOF
32
FASTEXPORT EXAMPLE(MULTIPLE)
fexp<<EOF
.LOGTABLE TPCH.RESTART_LOG;
.LOGON demotdat/dbc,dbc;
.DISPLAY 'Exporting Line_item-&SYSDATE4';
.BEGIN EXPORT ;
.EXPORT OUTFILE line_item.txt
FORMAT TEXT
MODE RECORD
OUTLIMIT 100;
SELECT * FROM TPCH.LINEITEM;
.END EXPORT;
.DISPLAY 'Exporting ORDERTBL-&SYSDATE4';
.BEGIN EXPORT ;
.EXPORT OUTFILE ordertbl.txt
FORMAT TEXT
MODE RECORD
OUTLIMIT 100;
SELECT * FROM TPCH.ORDERTBL;
.END EXPORT;
.LOGOFF;
EOF
33
FASTEXPORT EXAMPLE(SET)
fexp<<EOF
.LOGTABLE TPCH.PARTSUPP_LOG;
.LOGON demotdat/dbc,dbc;
.SET SUPPKEY TO 33;
DATABASE TPCH;
.BEGIN EXPORT
SESSIONS 2;
.EXPORT OUTFILE partsupp.txt
FORMAT TEXT
MODE RECORD
;
SELECT CAST(PS_PARTKEY AS CHAR(4)),
CAST(PS_SUPPKEY AS CHAR(3)) ,
CAST(PS_AVAILQTY AS CHAR(4)) ,
CAST(PS_SUPPLYCOST AS CHAR(17)) ,
CAST(PS_COMMENT AS CHAR(199))
FROM TPCH.PARTSUPP WHERE PS_SUPPKEY=&SUPPKEY;
.END EXPORT;
.LOGOFF;
EOF
34
FASTEXPORT EXAMPLE(TEXT MODE)
fexp<<EOF
.LOGTABLE TPCH.SUPPLIER_TEMP_LOG;
.LOGON demotdat/dbc,dbc;
DATABASE TPCH;
.BEGIN EXPORT
SESSIONS 2;
.EXPORT OUTFILE supplier.txt
FORMAT TEXT
MODE RECORD
;
SELECT CAST(S_SUPPKEY AS CHAR(3) ),
CAST(S_NAME AS CHAR(25)) ,
CAST(S_ADDRESS AS CHAR(40)) ,
CAST(S_NATIONKEY AS CHAR(2)) ,
CAST(S_PHONE AS CHAR(15)) ,
CAST(S_ACCTBAL AS CHAR(17)) ,
CAST(S_COMMENT AS CHAR(101))
FROM TPCH.SUPPLIER;
.END EXPORT;
.LOGOFF;
EOF
35
BASIC TERADATA QUERY(BTEQ)

Utility for submitting SQL requests to the Teradata database.

Runs on every supported platform — laptop to mainframe.

Flexible and easy-to-use report writer.

Exports data to a client system from the Teradata database as displayable characters
suitable for reports, or in native host format, suitable for other applications.

Reads input data and imports it to the Teradata database as INSERTs,
UPDATEs or DELETEs.

Limited ability to branch forward to a LABEL, based on a return code or an
activity count.
36
Types of BTEQ Export

1. Field Mode (REPORT)
When submitting BTEQ requests to a Teradata database, you may have noted that
output is always provided with column headings and underscores, with numerics
aligned to the right,characters to the left, and all output displayed in the center of
the screen or report. This is the default output of BTEQ (suitable for reports).
REPORT – output is truncated to 254 characters

2. Record Mode (DATA)
You might require output data in a flat-file format with binary data, no headings, etc.

3. INDICDATA
Host computer systems rarely have the built-in capability to recognize or handle
NULL data.

4. Data Interchange Format (DIF)
Use the DIF output option if you need data in a format suitable for PC-based
applications such as VISICALC and Lotus 1-2-3.
37
BTEQ Export Commands

.EXPORT DATA Sends results to a host file in record mode.

.EXPORT INDICDATA Sends query results that contain indicator variables to a host file.
Allows Host programs to deal with nulls.

.EXPORT REPORT Sends results to a host file in field mode.

Data set contains column headings and formatted data. Data is truncated if exceeds
254 (REPORT).


.EXPORT DIF Output converted to Data Interchange Format, used to transport data to
various PC programs, such as Lotus 1-2-3.
.EXPORT RESET Reverses the effect of a previous .EXPORT and closes the output file.

LIMIT n Sets a limit on number of rows captured.

OPEN/CLOSE Output Data Set or File is either OPEN or Closed during RETRY

AXSMOD Access module used to export to tape
38
BTEQ EXPORT MODE(DATA)
.logon DEMOTDAT/DBC,DBC;
.EXPORT DATA FILE = order_data_file.dat
.IF ERRORCODE <> 0 THEN .GOTO ERRORFOUND;
SELECT * FROM RETAIL.ORDER_ITEM;
.IF ERRORCODE <> 0 THEN .GOTO ERRORFOUND;
.EXPORT RESET
.LOGOFF;
.QUIT 0;
.LABEL ERRORFOUND
.QUIT 8;
39
BTEQ EXPORT MODE (REPORT)
.logon DEMOTDAT/DBC,DBC;
.EXPORT report FILE =order.dat
.IF ERRORCODE <> 0 THEN .GOTO ERRORFOUND;
SELECT CAST(ORDERNO AS CHAR(8))(TITLE ''),CAST(ORDER_DESC AS CHAR(30)) (TITLE
''), 'x'(title '')
FROM RETAIL.ORDER_ITEM;
.IF ERRORCODE <> 0 THEN .GOTO ERRORFOUND;
.EXPORT RESET
.LOGOFF;
.QUIT 0;
.LABEL ERRORFOUND
.QUIT 8;
40
BTEQ IMPORT Commands

.IMPORT DATA Reads a host file in record mode.

.IMPORT INDICDATA Reads data in host format using indicator variables in record mode
to identify nulls.

FILE Name of input data set in all other environments.

SKIP = n Number of initial records from the data stream that should be skipped before
the first row is transmitted.
41
BTEQ IMPORT MODE (DATA)
. logon DEMOTDAT/DBC,DBC;
.IMPORT DATA FILE = order_data_file.dat
.IF ERRORCODE <> 0 THEN .GOTO ERRORFOUND;
.QUIET ON;
.REPEAT *
USING I_ORDER_NO (VARCHAR(8))
,I_ORDER_DESC (VARCHAR(30))
INSERT INTO RETAIL.ORDER_ITEM
VALUES(:I_ORDER_NO,:I_ORDER_DESC);
.IF ERRORCODE <> 0 THEN .GOTO ERRORFOUND;
.LOGOFF;
.QUIT 0;
.LABEL ERRORFOUND
.QUIT 8;
42
BTEQ IMPORT MODE (REPORT)
.logon DEMOTDAT/DBC,DBC;
.IMPORT FILE = order.dat
.IF ERRORCODE <> 0 THEN .GOTO ERRORFOUND;
.QUIET ON;
.REPEAT 2
USING I_ORDER_NO (CHAR(10))
,I_ORDER_DESC (CHAR(32))
,i_x (CHAR(1))
INSERT INTO RETAIL.ORDER_ITEM
VALUES(:I_ORDER_NO,:I_ORDER_DESC);
.IF ERRORCODE <> 0 THEN .GOTO ERRORFOUND;
.LOGOFF;
.QUIT 0;
.LABEL ERRORFOUND
.QUIT 8;
43
BTEQ CONDITIONAL LOGIC EXAMPLE
DELETE FROM Million_Dollar_Customer ALL;
.IF ERRORCODE = 0 THEN .GOTO TableOK
CREATE TABLE Million_Dollar_Customer
(Account_Number INTEGER
,Customer_Last_Name VARCHAR(20)
,Customer_First_Name VARCHAR(15)
,Balance_Current DECIMAL(9,2));
.LABEL TableOK
INSERT INTO Million_Dollar_Customer
SELECT A.Account_Number, C.Last_Name, C.First_Name, A.Balance_Current
FROM Accounts A INNER JOIN
Account_Customer AC INNER JOIN
Customer C
ON C.Customer_Number = AC.Customer_Number
ON A.Account_Number = AC.Account_Number
WHERE A.Balance_Current GT 1000000;
.IF ACTIVITYCOUNT > 0 THEN .GOTO Continue
.QUIT
.LABEL Continue
44
Thank You
45