Unix Technical Forum

Re: [Info-Ingres] Formatting dates on insert or update - Helprequired please

This is a discussion on Re: [Info-Ingres] Formatting dates on insert or update - Helprequired please within the Ingres forums, part of the Database Server Software category; --> At 10:10 PM +1200 8/2/07, Richard Harden wrote: >Hi all, > > >I have a small database procedure that ...


Go Back   Unix Technical Forum > Database Server Software > Ingres

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-20-2008, 09:58 PM
Karl & Betty Schendel
 
Posts: n/a
Default Re: [Info-Ingres] Formatting dates on insert or update - Helprequired please

At 10:10 PM +1200 8/2/07, Richard Harden wrote:
>Hi all,
>
>
>I have a small database procedure that on insert into tableA, it inserts a related row into tableB
>Where currently it uses
>
><snipped for brevity of course>
>Insert into std_activity_references (:std_activity_no,'WP Rev Date',char(date('today'),10) )
><snip...>
>
>Where because ii_date_format is set to Multinational4, the dates thus inserted are in the form dd/mm/yyyy.
>
>Is there any simple way of formating the dates so that it is inserted into the record in the format dd-mmm-yyyy


Dates don't have any format when stored. They are stored as a
binary structure giving the date, and time as GMT if there's a
time part.

Dates are displayed according to the II_DATE_FORMAT setting,
and at present that's almost your only option. You can
also cast the dates to varchar within an SQL query, and
when that's done, the conversion is under the control of
the SET DATE_FORMAT statement, which might be undocumented;
I haven't looked. The server date format is initialized to
the II_DATE_FORMAT when you start a session, but you can
change it with SET DATE_FORMAT. That only affects date
conversions done within the server, though, not outside
conversions which are done when you retrieve a date as a
date type.

Karl
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:26 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com