sqlplus newbie question on 'compute sum'
794093Aug 27 2010 — edited Aug 27 2010I am new to Oracle, and am trying to get a simple grand total to work. I spent
all day online and using books like Oracle SQL*Plus, and have not been able to
figure out what is wrong. I have a pretty simple table (the data doesn't really
matter) and I want to total the sum of the CODE column.
sqlplus -s ${FW_DB_USER}/${FW_DB_PASSWD}@${FW_DB_SID} <<EOF
set feedback off
clear breaks
clear computes
set NEWPAGE 1
set PAGESIZE 70
set LINESIZE 70
col COUNTRY format a25
col CODE format a8
BREAK ON REPORT
COMPUTE SUM LABEL 'TOTAL ' OF CODE ON REPORT
select country, code from bl_country_gdds where clmin='10' and rownum<10;
exit 0
EOF
Here is what I get. You can see that it prints the dashed line as if it were going to
print the sum, but it does not.
I am sure this is something simple and stupid, but for the life of me I cannot figure out
what it is. Any help would be greatly appreciated.
qafusion01:~> ./test.sh 0
COUNTRY CODE
------------------------- --------
Afghanistan 93
Albania 355
Aruba 297
Belgium 32
Belize 501
Bhutan 975
Botswana 267
Brunei Darussalam 673
Cameroon 237
--------