SQL*Plus Reference
-- set define off

-- put a carriage return
define crlf=chr(10)
   fk.status||&&crlf||&&crlf   fk_status
undefine crlf;


-- batch for startup should be in login.sql

-- break
break on index_name 

-- column command (format a column)
column column_position format 99
column amount format 999,999,999
column column_name format A30
column osuser format a15 word_wrapped

-- don't print column 
column sort2 noprint

-- save date in a field and then use it...
Column TODAY noprint NEW_VALUE TODAY_DATE
select to_char(sysdate, 'YYYYMMDD') TODAY from dual;
define out_file=bak_code_objects&&TODAY_DATE..DDL

-- compute a colum
COMPUTE function LABEL label_name OF column column column
... ON break_column_2

COMPUTE sum LABEL sum_of_bytes OF bytes
... ON break_column_2


--

-- Standard @ beginning
set echo off
----------------------------------------------------------------------------------------------
--  Script.sql
--
--  Description ...
--  Author
--
--  Usage: @script owner object_name (%=wild card)
--
set termout off
set verify off
set doc off
set feedback off
set recsep off

set pagesize 0
--
define lsize=133
set linesize &&lsize
--
define out_file=output.ddl
spool &&out_file
--


-- Standard @ end
spool off
set doc off
set feedback on
set pagesize 30
set termout on
set echo on
-- start &&out_file
-- exit


define 1 = &table_name;
undefine 1;
undefine table_name;


set linesize 200;
set verify off;
set feedback off;
set verify on;
set feedback on;

set termout off
set verify off
set doc off
set feedback off
set recsep off
define ls=200

column txt format a&&ls word_wrapped
column xxx format a70

set linesize &&ls
set pagesize 0
define fn=recompile.ddl
spool &&fn




-- timing
timing start xxx;
SELECT  "DB_TRANSACTION"."ACCOUNT_NUMBER" ,
           "DB_TRANSACTION"."CUSTOMER_SEQNBR" ,
           "DB_TRANSACTION"."TRANSACTION_DATE" ,
           "DB_TRANSACTION"."TRANSACTION_AMT" 
--           "DB_TRANSACTION_TYPE"."TRANSACTION_TYPE_DESCR"     
FROM "DB_TRANSACTION" 
-- FROM "DB_TRANSACTION" ,           "DB_TRANSACTION_TYPE"      
        WHERE 
-- ( "DB_TRANSACTION_TYPE"."TRANSACTION_GROUPING_CODE" = 'P')
-- and          
( "DB_TRANSACTION"."TRANSACTION_DATE" >= to_date('1998-09-02','YYYY-MM-DD') )
and          ( "DB_TRANSACTION"."TRANSACTION_AMT" = 77.66 )
-- and account_number like '%'
and account_number = '08502729'
-- and "DB_TRANSACTION_TYPE".transaction_type_id = "DB_TRANSACTION_TYPE".transaction_type_id
;
timing show;
timing stop xxx;