cat > script <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
unset MSPAGER;
alter loans;
.?
.^
.i
number
integer
.^
shortinteger
e
.p
Number
.d
.e
.n
.i
.d
credit_limit
dollar
5
1
r
d
x
.n
.n
credit_limit
real
e
.q
select tab_name, attr_name, attr_dtname from sys_attrs, sys_tables
	where sys_tables.tab_name = 'loans'
	and sys_tables.tab_number = sys_attrs.attr_tabnum
	group by sys_tables.tab_name order by 1;
alter loans;
.n
.n
.n
.n
final
.d
.$
select tab_name, attr_name, attr_dtname from sys_attrs, sys_tables
	where sys_tables.tab_name = 'loans'
	and sys_tables.tab_number = sys_attrs.attr_tabnum
	group by sys_tables.tab_name order by 1;
alter loans;
.x
.n
.n
.n
.x
.q
select tab_name, attr_name, attr_dtname from sys_attrs, sys_tables
	where sys_tables.tab_name = 'loans'
	and sys_tables.tab_number = sys_attrs.attr_tabnum
	group by sys_tables.tab_name order by 1;
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 755 script
cat > stdout <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
* * 
Name for Attribute #1: name 
Data Type: character ----------  Interactive Alter Table  ----------

The following commands may be used with the Interactive Alter Table.

.?          print this help file
.! CMD      escape to the shell to execute the command CMD
.^          go to previous attribute and reprompt for its value
.$          abort this session; do NOT alter the table
.d          display all entered values for this record
.e          enter the record into the table and begin prompting for  the  next
            record
.i      +   insert a new record before the current one
.n      *   go on to the next record without entering the current one
.p      +   return to the previous record and reprompt  for  attribute  values
            (values already entered are not lost).  It is not possible to back
            up more than one record using .p
.q          quit the Interactive Interface and return control back to EMPRESS;
            create the table as entered
.r          reset the current attribute values to null
.x      *   delete the current record

__________________________________________________

        *   valid only in .p mode
        +   not valid in .p mode
Data Type: character 
Name for Attribute #1: name 
Data Type: character 
Name for Attribute #1: Data Type: 
Ready .Data Type: integer 
Ready .
Data Type: character 
Name for Attribute #1: number Data Type: smallint 

Name for Attribute #1: Number 
Data Type: smallint 
Allow Null Values? Yes 

Data Type: smallint 
Data Type: character 
Name for Attribute #3: date 
Data Type: date 
Name for Attribute #3: 


Name for Attribute #3: Data Type: Maximum Number of Dollar Digits: Type: 
Ready .
Ready .

Name for Attribute #3: credit_limit 
Data Type: dollar 
Maximum Number of Dollar Digits: 5 
Type: 1 
Allow Null Values? Yes 


Ready .

Name for Attribute #3: date 
Data Type: date 
Name for Attribute #4: amount 
Data Type: dollar 
Name for Attribute #5: Data Type: 
Ready .
Name for Attribute #6: * . . . tab_name                          attr_name                         attr_dtname

loans                             Number                            smallint
                                  name                              character
                                  date                              date
                                  amount                            dollar
                                  credit_limit                      real
* 
Name for Attribute #1: Number 
Data Type: smallint 
Name for Attribute #2: name 
Data Type: character 
Name for Attribute #3: date 
Data Type: date 
Name for Attribute #4: amount 
Data Type: dollar 
Name for Attribute #5: credit_limit 
Data Type: real *** invalid data type 
Data Type: real 

Name for Attribute #5: credit_limit 
Data Type: real 
Allow Null Values? Yes 

Data Type: real * . . . tab_name                          attr_name                         attr_dtname

loans                             Number                            smallint
                                  name                              character
                                  date                              date
                                  amount                            dollar
                                  credit_limit                      real
* 
Name for Attribute #1: Number 
Data Type: smallint 
Name for Attribute #1: name 
Data Type: character 
Name for Attribute #2: date 
Data Type: date 
Name for Attribute #3: amount 
Data Type: dollar 
Name for Attribute #4: credit_limit 
Data Type: real 
Name for Attribute #4: * . . . tab_name                          attr_name                         attr_dtname

loans                             amount                            dollar
                                  date                              date
                                  name                              character
* 
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 stdout
cat > stdout.jp_euc <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
* * 
ȥӥ塼̾ #1: name 
ǡסcharacter                      ----------  Interactive Alter Table  ----------

   ʲ˼ޥɤ Interactive Alter Table ǻȤȤǤޤ

 .?             إץեɽ롣
 .! CMD         ˥פޥ CMD ¹Ԥ롣
 .^             °˹ԤͤϤƤ¥
 .$             ߤΰϢ˴ơ֥Ƥѹʤ
 .d             쥳ɤϤ줿Ƥͤɽ롣
 .e             쥳ɤơ֥ϤΥ쥳ɤϤ¥
 .i          +  ߤΥ쥳ɤ˿쥳ɤ롣
 .n          *  ߤΥ쥳ɤϤ˼Υ쥳ɤ˰ܤ롣
 .p          +  Υ쥳ɤꡢ°ͤϤ¥ʤǤϤ줿ͤ
                ʤˡ.p ǤϰĤΥ쥳ɤޤǤʤ
 .q             å⡼ɤȴ EMPRESS ᤷϤ줿
                ơ֥롣
 .r             ߤ°ͤ null ᤹
 .x          *  ߤΥ쥳ɤ롣
____________________________________________________________________________

             *  .p ⡼ɤǤΤͭ
             +  .p ⡼ɤǤ̵
ǡסcharacter 
ȥӥ塼̾ #1: name 
ǡסcharacter 
ȥӥ塼̾ #1: ǡס
Ǥ .ǡסinteger 
Ǥ .
ǡסcharacter 
ȥӥ塼̾ #1: number ǡסsmallint 

ȥӥ塼̾ #1: Number 
ǡסsmallint 
NULL ͤǧޤ ? Yes 

ǡסsmallint 
ǡסcharacter 
ȥӥ塼̾ #3: date 
ǡסdate 
ȥӥ塼̾ #3: 


ȥӥ塼̾ #3: ǡסMaximum Number of Dollar Digits: Type: 
Ǥ .
Ǥ .

ȥӥ塼̾ #3: credit_limit 
ǡסdollar 
Maximum Number of Dollar Digits: 5 
Type: 1 
NULL ͤǧޤ ? Yes 


Ǥ .

ȥӥ塼̾ #3: date 
ǡסdate 
ȥӥ塼̾ #4: amount 
ǡסdollar 
ȥӥ塼̾ #5: ǡס
Ǥ .
ȥӥ塼̾ #6: * . . . tab_name                          attr_name                         attr_dtname

loans                             Number                            smallint
                                  name                              character
                                  date                              date
                                  amount                            dollar
                                  credit_limit                      real
* 
ȥӥ塼̾ #1: Number 
ǡסsmallint 
ȥӥ塼̾ #2: name 
ǡסcharacter 
ȥӥ塼̾ #3: date 
ǡסdate 
ȥӥ塼̾ #4: amount 
ǡסdollar 
ȥӥ塼̾ #5: credit_limit 
ǡסreal *** ǡפŬڤǤ
ǡסreal 

ȥӥ塼̾ #5: credit_limit 
ǡסreal 
NULL ͤǧޤ ? Yes 

ǡסreal * . . . tab_name                          attr_name                         attr_dtname

loans                             Number                            smallint
                                  name                              character
                                  date                              date
                                  amount                            dollar
                                  credit_limit                      real
* 
ȥӥ塼̾ #1: Number 
ǡסsmallint 
ȥӥ塼̾ #1: name 
ǡסcharacter 
ȥӥ塼̾ #2: date 
ǡסdate 
ȥӥ塼̾ #3: amount 
ǡסdollar 
ȥӥ塼̾ #4: credit_limit 
ǡסreal 
ȥӥ塼̾ #4: * . . . tab_name                          attr_name                         attr_dtname

loans                             amount                            dollar
                                  date                              date
                                  name                              character
* 
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 stdout.jp_euc
cat > tag <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
Exercise the interactive alter table
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 tag
