Re: HELP: INSERTing character data to DATETIME field
Posted in 1996
ashok kapur wrote: > > I am trying to INSERT character date-time data into a DATETIME YEAR TO > SECOND column. The character data format is %m/%d/%y %H:%m:%S and I can > not figure out how to convert this character string to DATETIME format. > Oh, by the way, I am using the DBACCESS utility. >if you can change the format of the data to %y-%m-%d %H:%m:%S you then can insert it directly, as long as %y always returns 4-character year, and all the rest always return 2-character values (e.g. "09" not "9"). If not, you'll have to load into a temp table and get the strings in the right format before inserting; DATETIME is very stict in its format (as opposed to, say, DATE). This is all doable via Stored Procedures and the like, but not easily enough that I can explain to a new user with now manuals. The manuals are orderable: Informix Guide to SQL set of three manuals (Tutorial, Reference, Syntax) version 7.1 is part number 000-7635. If you're local SE is a nice guy, you might be able to get a set for free, but don't tell them I said so. > > I am also looking for some string conversion functions in Informix so > that I can take a string that has last name and suffix and strip out the > last name from the suffix. > Again, stored procedure might be the way to go, although there are caveats I'll explain once you get your hands on basic syntax. > -- > Ashok Kapur (akapur@thomtech.com) > Thomson Technology Consulting Group > 1375 Piccard Drive, Suite 250 > Rockville, MD 20850 -- //////////////// ======================================================= ////////// // Dennis J. Pimple Informix Software, Inc. ////// / /// Principal Consultant 5299 DTC Blvd Suite 740 ///// // //// dennisp@informix.com Englewood CO 80111 //// // ///// /// // ////// recept: 303-850-0210 // // /////// direct: 303-740-5611 Opinions expressed are mine, / /////////// fax: 303-843-6408 and do not necessarily //////////////// http://www.informix.com reflect those of my employer