vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Paulo Cooker wrote: > Hi, > Where can I find information (syntax) about functions that I can use in > SPL? Like, SUBSTR, COALESCE, CURRENTDATE, ROUND, ... I'd say "the manual", but that's just a guess. I've never actually read one. -- "C'est pas parce qu'on n'a rien à dire qu'il faut fermer sa gueule" - Coluche |
| |||
| In message <br7uli$epk8$2@ID-64669.news.uni-berlin.de>, Obnoxio The Clown <obnoxio@hotmail.com> writes >Paulo Cooker wrote: > >> Hi, >> Where can I find information (syntax) about functions that I can use in >> SPL? Like, SUBSTR, COALESCE, CURRENTDATE, ROUND, ... > >I'd say "the manual", but that's just a guess. I've never actually read one. I'm sure you are right, and with a bit of effort they can still be downloaded from www.ibm.com. Pardon me while I go and wash my mouth out. :-P > -- Five Cats Email to: cats_spam at uk2 dot net |
| |||
| Five Cats wrote: > Obnoxio The Clown <obnoxio@hotmail.com> writes >> Paulo Cooker wrote: >>> Where can I find information (syntax) about functions that I >>> can use in SPL? Like, SUBSTR, COALESCE, CURRENTDATE, ROUND, >>> ... >> >> I'd say "the manual", but that's just a guess. I've never actually >> read one. > > I'm sure you are right, and with a bit of effort they can still be > downloaded from www.ibm.com. Pardon me while I go and wash my mouth > out. :-P More precisely, that information is in the Informix Guide to SQL: Syntax manual, and the starting point for Informix materials can be http://www.ibm.com/software/data/informix/library (but you can omit the software/data/ bit and end up at the same point). Of course, some of the names are spelled differently, too. SUBSTR and ROUND are spelled like that, but CURRENTDATE is spelled TODAY or CURRENT YEAR TO DAY depending somewhat on what you want to do next. Off the top of my head, I don't think there is a direct mapping for COALESCE; I'd probably write it as: CREATE FUNCTION coalesce(v1 VARCHAR(255) DEFAULT NULL, v2 VARCHAR(255) DEFAULT NULL, vn VARCHAR(255) DEFAULT NULL ) RETURNING VARCHAR(255) AS retval; IF v1 IS NOT NULL THEN RETURN v1; ELSIF v2 IS NOT NULL THEN RETURN v2; ELSE RETURN vn; END IF; END FUNCTION; You would have to generalize this to the maximum number of arguments you are going to pass to the function. This version is good for any data type other than CHAR(n) or LVARCHAR(n) where n > 255 - or blobs in any of their guises. (Errrm; caution - this understanding of COALESCE is based on a quick review of the top few items found by Googling "SQL function COALESCE", and therefore could need to be changed for standards compliance. I suspect it is more user-friendly than the standardized version.) -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/ |
| |||
| larini@email.com (Paulo Cooker) wrote in message news:<8efe8056.0312101031.28e2b1bd@posting.google. com>... > Hi, > Where can I find information (syntax) about functions that I can use in SPL? > Like, SUBSTR, COALESCE, CURRENTDATE, ROUND, ... > > Thanks a lot Hi. You need "IBM Informix guide to SQL (Syntax)". In this manual see "Segments"->"Expression" "IBM Informix guide to SQL (Syntax)" in pdf-file you may download from ibm.informix.com |