RE: ROUND, where has it gone?
Posted in 1998
I'm not near a database to be able to check whether ROUND() is like = LENGTH(), and can't be used in SPL syntax, but that may be your problem. If that's the case, why not define your variable with the precision you = require, eg DECIMAL(8,3) from a DECIMAL(16,8) variable: LET dec83var =3D dec168var + 0.0005 If you just want to TRUNC, don't add the extra fractional value. cheers RET __________________________________________________________________________= _____ From: Leffler, Jonathan on Sat, 28 Mar 1998 9:47 AM Subject: RE: ROUND, where has it gone? To: 'informix-list@iiug.org'; 'stuke@iname.com' Exactly which version 7 database are you working with? And which tool are you using to create the SPs? To the best of my knowledge, ROUND() et al are present in all 7.x databases, but I could be about to learn otherwise. Specifically, they are present in 7.23.UC4 on Solaris 2.5.1, which is = what I have available to me for testing. SELECT ROUND(3.14159, 4) as round, TRUNC(3.14159, 4) AS trunc FROM 'informix'.SysTables WHERE TabID =3D 1; This gives 3.1416, 3.1415 as you would expect. No SPs here, so that will = allow you to show whether the functions are available to you or not. Assuming that they are, then you have to worry about why you're getting syntax errors... I don't have a built-in function called INT() in = 7.23.UC4 - demonstrated by using the obvious revision of the test above. If you are using ISQL to create the SPs, it will generate syntax error = for you; use DB-Access instead. Yours, Jonathan Leffler (jleffler@visa.com) #include <bother.ms-exchange.h> ---------- From: stuke@iname.com[SMTP:stuke@iname.com] Sent: Friday, March 27, 1998 8:05 AM To: informix-list@iiug.org Subject: ROUND, where has it gone? I have developed some stored procedures for Informix 5 that use the built-in round() function. When I tried to use these sps on an Informix 7 database, the round() just gives me a syntax error. I even can't emulate round() using int() because int() isn't known anymore either. I'm almost sure that both functions were officially documented in the Informix 5 docs but they aren't mentioned in the 7 docs. Am I doing something wrong or were these functions just dropped in 7 and if so, why? And, even more important, what can I do to get the functionality of round in Informix 7? Kai Stuke <stuke@iname.com> Gru_, Kai <Kai.Stuke@iname.com> PGP-Key available on request ------------------ RFC822 Header Follows ------------------ Received: by yes.optus.com.au with ADMIN;28 Mar 1998 09:47:10 +1100 Received: from safer.optus.com.au ([203.13.126.9]) by prairiedog.optus.com.au (Netscape Messaging Server 3.52) with SMTP id AAA4636; Sat, 28 Mar 1998 09:46:44 +1100 Received: by safer.optus.com.au; id JAA24001; Sat, 28 Mar 1998 09:42:57 = +1100 Received: from www.iiug.org(206.175.175.254) by safer.optus.com.au via = smap (3.2) id xma023977; Sat, 28 Mar 98 09:42:26 +1100 Received: (from majordom@localhost) by iiug.iiug.org (8.7.5/8.7.3) id = OAA22846; Fri, 27 Mar 1998 14:19:20 -0600 (CST) Received: from internet.visa.com (portal.visa.com [198.80.42.2]) by = iiug.iiug.org (8.7.5/8.7.3) with SMTP id OAA22833 for = <informix-list@iiug.org>; Fri, 27 Mar 1998 14:19:14 -0600 (CST) Received: by portal.visa.com id AA22969 (InterLock SMTP Gateway 3.0 for informix-list@iiug.org); Fri, 27 Mar 1998 12:19:13 -0800 Received: by portal.visa.com (Protected-side Proxy Mail Agent-1); Fri, 27 Mar 1998 12:19:13 -0800 Message-Id: = <c=3DUS%a=3D_%p=3DVisa%l=3DSW720_X032-980327202145Z-31982@msmailgw2.visa.c= om> From: "Leffler, Jonathan" <jleffler@visa.com> To: "'informix-list@iiug.org'" <informix-list@iiug.org>, "'stuke@iname.com'" <stuke@iname.com> Subject: RE: ROUND, where has it gone? Date: Fri, 27 Mar 1998 12:21:45 -0800 X-Mailer: Microsoft Exchange Server Internet Mail Connector Version = 4.0.995.52 Sender: owner-informix-list@iiug.org Precedence: bulk