Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread Error #901 when adding a check constraint to a table
Wed, Feb 15 2012 10:06 AMPermanent Link

Lucian

Hi

I am trying to add a check constraint to a table. The check looks like this:

(BirthDate>=DATE '1930-01-01') AND (BirthDate<=DateAdd('YEAR',-18,CURRENT_TIMESTAMP))

BirthDate is a column
DateAdd is a user function

From the help file I'm getting that a

<CheckExpression> = Any valid SQL expression that does not include any sub-queries

What am I doing wrong?

I'm using EDB Manager for the job and my Elevate version number is 2.05 build 11. Perhaps this has been fixed already?

Thx,
Lucian
Wed, Feb 15 2012 10:47 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Lucian


What happens if you try and run the statement as part of a select sql?

Also does the error message give you any more information?

Roy Lambert [Team Elevate]
Wed, Feb 15 2012 10:49 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Lucian


Can you show the definition for DateAdd. I'm just wondering about CURRENT_TIMESTAMP and if it should be CURRENT_DATE

Roy Lambert [Team Elevate]
Wed, Feb 15 2012 10:52 AMPermanent Link

Lucian

Sorry about that, I thout the error number was enough. here's the full deal:

ElevateDB Error #901 An error occurred with the  routine at line 1 and column 48 (An attempt was made to execute the unprepared procedure dateadd)

Works fine in SELECT.

regards
Lucian
Wed, Feb 15 2012 10:54 AMPermanent Link

Lucian

>Can you show the definition for DateAdd

Do you still need that? It's the one in the extension ng, anyway
Wed, Feb 15 2012 10:58 AMPermanent Link

Lucian

As a workaround I could probably use what David Cornelius suggested in the extension ng (the stuff with INTERVAL) ... however if this is a bug, it should get fixed, no?

regards
Lucian
Wed, Feb 15 2012 11:02 AMPermanent Link

Lucian

Well, anyway, the workaround works.
I don't care any more...

regards
Lucian
Tue, Feb 21 2012 7:40 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Lucian,

<< I'm using EDB Manager for the job and my Elevate version number is 2.05
build 11. Perhaps this has been fixed already? >>

Probably, but I'll double-check to make sure before the new EDB build goes
out this week.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image