Re: New user needs help with dates in a table
Posted in 1997
>From: Brian <.finnegan@pangea.ca> >Date: Fri, 11 Apr 1997 18:17:47 -0500 >X-Informix-List-Id: <news.36476> > >bradley hanson wrote: >> Can you set the dbdate env variable right in your Informix program? And >> if so, will that override whatever the user has his env set to? > >In an esql/c program, you'd do a putenv(). This works if it happens before the first DATE operation (and you use putenv() correctly, which is typically harder than it looks). Once the first date operation occurs (probably when you connect to the database), it is too late; the value of DBDATE has been trapped and can't be reset (unless the source code has changed since 6.0x, which I haven't checked but would not expect to be the case). >In 4gl, I think you'd sqlexit(), use the run command to export the >environment var, then reconnect. That won't work -- what is set in the environment of the child process has no effect whatsoever on the environment of the parent process. You'd use putenv() again, wrapped up for use with I4GL. I've posted on this subject before, so you should be able to find out all the gory details in one of the news archives (eg http://www.dejanews.com). There is also some of my source code out there for setenv.c which is arguably more reliable than using the standard putenv() call, especially from I4GL code. >Brian Finnegan Pangea.ca Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>