Re: DBDATE / DBMONEY in SQL ���ndern ??
Posted in 2007
Topics: Migration, Import/Export & Data Conversion
>From: Carsten Haese <carsten@uniqsys.com> > >Maybe that's because you nicht sprechen Deutsch ;) > And my english is piss poor to. :-) > > 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. > Ok... So you can't use an UDR on a LOAD or INSERT Statement? As Marco points out, you can use a python/ruby/perl script to modify the data before the load. (And you're the keeper of the python module, right. ;-) Sorry if Im off in left field. Just thinking if you can use an user defined function to format the data out of the database, that you should be able to use one on the insert/import too. Is that wrong? -G _________________________________________________________________ http://liveearth.msn.com
On Jul 10, 11:35 am, "Ian Michael Gumby" <im_gu...@hotmail.com> wrote: > >From: Carsten Haese <cars...@uniqsys.com> > > >Maybe that's because you nicht sprechen Deutsch ;) > > And my english is piss poor to. :-) > > > > > > 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. If you are willing to write a loader or data reformatter in C you can get my packare datelib_ak which can read almost any date format and convert it into an Informix DATE or DATETIME in internal representation for upload. You can also then pass those to Informix ESQL/C library functions to convert to a string in standard form for loading. Indeed, the ESQL/C library contains date conversion functions of it's own which can convert many standard formats - not as flexible as my library which can even translate fuzzy dates like 'yesterday' and 'last year' but for your needs it may be enough. Art S. Kagel Art S. Kagel