Re: Problem with SELECT statment (bounced mail)
Posted in 1996
} } ------- =_aaaaaaaaaa } Content-Type: text/plain; charset="us-ascii" } Content-Description: Session Transcript } } 550 myhost.subdomain.domain (tcp)... Host unknown } 550 <jacek@myhost.subdomain.domain>... Host unknown } } ------- =_aaaaaaaaaa } Content-Type: message/rfc822 } Content-Description: Returned Content } } Received: from hpbs3645.boi.hp.com by paloalto.access.hp.com with SMTP } (1.37.109.16/15.5+ECS 3.3) id AA265145698; Wed, 1 May 1996 11:34:58 -0700 } Return-Path: <jparker@hpbs3645.boi.hp.com> } Received: by hpbs3645.boi.hp.com } (1.38.193.4/15.5+IOS 3.22) id AA07587; Wed, 1 May 1996 12:32:02 -0600 } From: Jack Parker <jparker@hpbs3645.boi.hp.com> } Message-Id: <9605011832.AA07587@hpbs3645.boi.hp.com> } Subject: Re: Problem with SELECT statment } To: jacek@myhost.subdomain.domain (Jacek Brzozowski) } Date: Wed, 1 May 96 12:32:02 MDT } In-Reply-To: <4m298i$k13@sunrise.pg.gda.pl>; from "Jacek Brzozowski" at Apr 29, 96 11:30 am } Mailer: Elm [revision: 70.85] } } > } > } > Hello, } > I have a problem with SQL SELECT ... statment. } > We're running 4GL 4.10 with OnLine 5.0 on HP G30 machine } > running HP-UX 9.00. } > } > --------------------------------------------------------- } > Table name : table_x } > --------------------------------------------------------- } > field_1 decimal(8,2) } > field_2 decimal(8,2) } > .... } > field_n decimal(8,2) } > --------------------------------------------------------- } > } > View name : view_v } > --------------------------------------------------------- } > CREATE VIEW view_v ( field_1v, field_2v,.., ) } ################################################################# } > AS SELECT field_1+field_2, field_3,.. } ^ } If so then there's a problem. } ################################################################# } } > FROM table_x } > --------------------------------------------------------- } > SELECT sum( field_1v+field_2v+field_3v+...) } > INTO sum1 } > FROM view_v } } This is not SQL. You cannot (last time I checked) SELECT ... INTO in SQL. } You can do this in SPL, esql/c (?) and 4gl, but not SQL. } } } > } > SELECT sum( field_1v*100+field_2v*100+field_3v*100+...)/100 } > INTO sum2 } > FROM view_v } > } > sum1<>sum2 !!! ( ex. 423597 <> 423613.65 ) } > =========================================================== } } 1 - you may have a problem with rounding in the intermediate variables. } } 2 - Definitely put parens around each of the (field1v*100) pairs. } } 3 - do you get the same error when you: } } SELECT (field_1v*100)/100 ??? } } cheers } j. } _____________________________________________________________________________ } Jack Parker - Hewlett Packard, DMD/IS Boise, Idaho, USA } jparker@hpbs3645.boi.hp.com Back in Boise } _____________________________________________________________________________ } } If anything can go wrong, fix it. To hell with Murphy. } _____________________________________________________________________________ } Any opinions expressed herein are my own and not those of my employers. } _____________________________________________________________________________ } } ------- =_aaaaaaaaaa-- } -- _____________________________________________________________________________ Jack Parker - Hewlett Packard, DMD/IS Boise, Idaho, USA jparker@hpbs3645.boi.hp.com Back in Boise _____________________________________________________________________________ If anything can go wrong, fix it. To hell with Murphy. _____________________________________________________________________________ Any opinions expressed herein are my own and not those of my employers. _____________________________________________________________________________