ISQL vs UNIX to run query
598847Nov 15 2007 — edited Nov 16 2007OK - I have a strange problem. I have a query that I wrote that works perfectly if I am logged into and running it through ISQL but the same exact query ran in the UNIX environment produces all kinds of errors. Does any one have any clue why this would happen?
Here is the code:
Select cus_lname, cus_fname,
count(charter.char_trip)"Total Charters",
sum(model.MOD_CHG_MILE * charter.CHAR_DISTANCE) "Charter Revenue"
From charter, CUSTOMER, AIRCRAFT, Model
WHERE CUSTOMER.CUS_CODE = CHARTER.CUS_CODE AND
CHARTER.AC_NUMBER = AIRCRAFT.AC_NUMBER AND
AIRCRAFT.MOD_CODE = MODEL.MOD_CODE
Group by cus_lname, cus_fname
Order by cus_lname, cus_fname
;
Here is the result from isql:
********** RobAir - Customer Charter and Revenue Report **********
Run By:S00835940
CUS_LNAME CUS_FNAME Total Charters Charter Revenue
Brown James 1 $965.20
Dunne Leona 2 $1,975.60
Farriss Anne 1 $3,698.90
O'Brian Amy 1 $3,698.90
Orlando Myron 19 $40,955.60
Ramas Alfred 1 $2,345.30
Smith Kathy 1 $1,518.10
Smith Olette 1 $2,199.60
Williams George 18 $37,546.50
Page No: 1
9 rows selected
Here is the error from UNIX:
SP2-0734: unknown command beginning "From hartm..." - rest of line ignored.
SP2-0734: unknown command beginning "WHERE CUST..." - rest of line ignored.
SP2-0734: unknown command beginning "CHARTER.AC..." - rest of line ignored.
SP2-0734: unknown command beginning "AIRCRAFT.M..." - rest of line ignored.
SP2-0044: For a list of known commands enter HELP
and to leave enter EXIT.
SP2-0734: unknown command beginning "Group by c..." - rest of line ignored.
SP2-0734: unknown command beginning "Order by c..." - rest of line ignored.
1 Select cus_lname, cus_fname,
2 count(charter.char_trip)"Total Charters",
3* sum(model.MOD_CHG_MILE * charter.CHAR_DISTANCE) "Charter Revenue"
Any thoughts on how to deal with this so it works in both environments. All my other queries work just fine.
Thanks for any help I can get.