Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Current_Date, Current_Timestamp issue in table structures
Thu, Jan 27 2011 6:17 AMPermanent Link

Adam Brett

Orixa Systems

I am migrating from DBISAM.

I have a COLUMN DateSent TIMESTAMP.

In DBISAM I use DEFAULT Current_Date.

This sets the DateSent field's value to the current date with TIME portion = "00:00:00".

When the User actions the record the DateSent field is updated to the precise NOW Timestamp.

This is useful, as it means that users can see all the items which haven't been actioned. I realise it is not perfect DB design ... but the users like it & are used to it.

--

I cannot use the COLUMN DEFINITION:

DateSent TIMESTAMP DEFAULT Current_Date

in ElevateDB ... it chokes, seeing a mismatch between the data-type of the column and its default value.

How can I fix this or work around it? Can I define the accuracy of the Current_Timestamp variable for example?
Thu, Jan 27 2011 7:16 AMPermanent Link

John Hay

Adam

> I have a COLUMN DateSent TIMESTAMP.
> In DBISAM I use DEFAULT Current_Date.
> This sets the DateSent field's value to the current date with TIME portion = "00:00:00".
> When the User actions the record the DateSent field is updated to the precise NOW Timestamp.
> This is useful, as it means that users can see all the items which haven't been actioned. I realise it is not perfect
DB design ... but the users like it & are used to it.
> --
> I cannot use the COLUMN DEFINITION:
> DateSent TIMESTAMP DEFAULT Current_Date
> in ElevateDB ... it chokes, seeing a mismatch between the data-type of the column and its default value.
> How can I fix this or work around it? Can I define the accuracy of the Current_Timestamp variable for example?
>

How about Datesent TIMESTAMP DEFAULT CAST(Current_Date AS TIMESTAMP)

John

Thu, Jan 27 2011 8:40 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

And if that doesn't work use a trigger where you can easily set it to whatever you want.

Roy Lambert [Team Elevate]

ps let us know if it does work - it could be useful to know about.
Thu, Jan 27 2011 5:09 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Adam,

<< in ElevateDB ... it chokes, seeing a mismatch between the data-type of
the column and its default value. >>

I'll make sure this is fixed for the next build.

The workaround is to use:

CAST(CURRENT_DATE() AS TIMESTAMP)

as the default expression.

--
Tim Young
Elevate Software
www.elevatesoft.com
Thu, Jan 27 2011 5:43 PMPermanent Link

Adam Brett

Orixa Systems

SUPER GOOD Tim ... Thanks.

The CAST is the biz for now.

I am going to have to do a lot of work to figure out the niceties of TRIGGERS, JOBS etc., etc. so much functionality!

(and now I've read the posts about using Elevate as a WebDB with an on-line DBAdmin tool on another thread, which sounds brilliant!)

Adam
Fri, Jan 28 2011 5:09 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Adam,

<< I am going to have to do a lot of work to figure out the niceties of
TRIGGERS, JOBS etc., etc. so much functionality! >>

Yes, there's a ton of new stuff. Smiley

<< (and now I've read the posts about using Elevate as a WebDB with an
on-line DBAdmin tool on another thread, which sounds brilliant!) >>

Yep, and it will be ready as soon as I'm done messing with the HTML
interface (I hate doing web front-end work).

--
Tim Young
Elevate Software
www.elevatesoft.com


Image