Re: DBDATE / DBMONEY in SQL =?ISO-8859-1?Q?=E4ndern?= ??
Posted in 2007
On Tue, 2007-07-10 at 12:59 +0000, Ian Michael Gumby wrote: > > > >From: Carsten Haese <carsten@uniqsys.com> > >On Tue, 2007-07-10 at 09:39 +0000, hoffiman@googlemail.com wrote: > > > [Bitte, Ich spreche nicht Deutsches.] > > >In English: > > > >I'm not aware of a way to set the date format with an SQL command. One > >possibility would be to load the data into an auxiliary table that is > >identical to the target table except that date columns are replaced by > >char(10) columns. You can then transfer the data to the target table and > >translate the date columns with mdy(x[6,7],x[9,10],x[1,4]) into real > >dates. > > > >Hope this helps, > > > >-- > This doesn't make sense. Maybe that's because you nicht sprechen Deutsch ;) > The date is stored in an intermediate format and should be formattable via > regex from the SQL statement. (Sorry my mind is a bit garbled from doing too > many different database things as well as languages.) > > There should be an SQL function that would allow you to format the date from > the internal format to a more readable string on the fly. The OP wants to go the other way. He has an unload file with dates in yyyy-mm-dd format and wants to load them into a date column without setting the DBDATE environment variable. I suggested one way of doing that. It probably is neither the only way nor the best way to do this, but it is a way to achieve what the OP asked for. -- Carsten Haese http://informixdb.sourceforge.net