It seems that I've inadvertently touched a few nerves with this one...

I have to say, too, that I have been unable to find a way to make what I
want work. I've tried as many variations as I could think of after doing
what I needed to do the simple way: delete the defaults. I have re-instated
them in my form for that table which is fine but it leaves open the
(remote-ish) possibility that the table could be updated from the Data
Browser or the R:>.

Having done what I needed and then not been able to find a way to get my old
way to work currently it seemed sensible to approach the requirement a different
way - always one of R:Base's strong points anyway.

By the way, from what I understood from Razzak's intimation that the default
value in the table Data Definition should now be a "plain" value and that a
computed value should be used for other values makes perfect sense but seems
to have restrictions that make it unsuitable in some instances. Maybe I'm not
understanding properly and I need to look again in due course. Nevertheless:

My attempted solution was to try to use two triggers to do what I want but I
have never used triggers before and couldn't find the right syntax in my
procedure file to get what I wanted to work. I got the table altered to
include the triggers, I put the file successfully (and the various subsequent
changes that I made) and everything seemed okay but didn't work.

What I want is this:

I have two date columns - Entry_Date & Up_Date - both of which need to be
set to the current date on insertion of a new row and Up_Date needs to be
updated to the current date whenever the row is changed.

I created two procedure files - one to do both updates on insert and the
other to do the update on update of the row.

I tried before and after triggers, all sorts of where clauses but nothing
got changed - the best that I got was the message that the data had been
updated by another user but it never was.

I'll probably kick myself for not seeing the obvious but could somebody
please put me out of my misery and show me where I'm going wrong?

Thanks in advance,
Regards,
Alastair.




----- Original Message ----- From: "James Bentley" <[email protected]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Friday, January 30, 2009 7:12 PM
Subject: [RBASE-L] - Re: ERROR- Specified default value is not valid for
column Re...


Karen,

I prefer to control such action in TRIGGERS because in my applications
form are not the only method of inserting and updating records.  With my
address tables I need to keep track of who and when actions were
performed. I was able to partially solve my problem by a major redesign of
the structure by placing audit information in the master table instead of
the subordinate address table.  I had to resort to this because RBase
implements BEFORE/AFTER INSERT and UPDATE TRIGGERS as read only cursors.
When I tried to change audit fields in the subject record during the
TRIGGER is created an endless loop that turminate when I exceeded some
internal limit. I know of several competitive databases that implement
TRIGGERS with an updateable cursor.
I have had such an enhancement request in for several years to make the
BEFORE INSERT and the BEFORE UPDATE triggers have an updateable cursor.

Maybe some day.

Jim Bentley
American Celiac Society
[email protected]
tel: 1-504-737-3293


--- On Fri, 1/30/09, [email protected] <[email protected]> wrote:

From: [email protected] <[email protected]>
Subject: [RBASE-L] - Re: ERROR- Specified default value is not valid for
column Re...
To: "RBASE-L Mailing List" <[email protected]>
Date: Friday, January 30, 2009, 7:50 AM
Jim:   You're right, we couldn't use a computed
column either.  I think in
our case the updating of this date column would have been
done only in 2 places
within a form, so we made a form variable instead for
Colname = .#DATE  so
that the date would update if we entered a row or saved a
change.   Could also
handle this with a trigger if you want to keep track of
r> prompt changes or
other programs that might do an Update.

Karen


> Using a computed column doesn't work for me as a
reload resets the value
> whereas I am using such a field to track changes for
audit purposes.
>
> Perhaps in v9.0.
>
> Jim Bentley







--------------------------------------------------------------------------------



No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.0.233 / Virus Database: 270.10.16/1925 - Release Date: 01/30/09
07:37:00

--- RBASE-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]

(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE: Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body, place any text to search for.
================================================


Reply via email to