Home » Developer & Programmer » Forms » Insert sysdate on commit
Insert sysdate on commit [message #201782] Mon, 06 November 2006 13:07 Go to next message
tessdeveloper
Messages: 17
Registered: August 2006
Location: Ireland
Junior Member
Hi there,

I have a fairly basic problem here.

I need to insert sysdate to a date field on the database when a user inserts a record on the formside.

I'm doing the sysdate insert during a pre_insert trigger that is residing on one of the forms blocks.

here is a sample of the code i am using, even though the compiler throws no errors

:BLOCK.REP_DATE := SYSDATE;

Any help with this would be greatly appreciated.

Re: Insert sysdate on commit [message #201795 is a reply to message #201782] Mon, 06 November 2006 15:39 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
You said
... pre_insert trigger that is residing on one of the forms blocks ...

Not ONE OF the form blocks, but EXACTLY the one that contains that date field. Of course, don't forget to COMMIT data (otherwise you won't see anything from another session).

[EDIT] Additionally, it is not a PRE_INSERT, but PRE-INSERT trigger. And yes, it works - I tried it.

[Updated on: Mon, 06 November 2006 15:41]

Report message to a moderator

Re: Insert sysdate on commit [message #201840 is a reply to message #201782] Tue, 07 November 2006 01:03 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
You could also specifiy it in the 'default' value for that item.

David
Re: Insert sysdate on commit [message #201874 is a reply to message #201782] Tue, 07 November 2006 02:58 Go to previous messageGo to next message
tessdeveloper
Messages: 17
Registered: August 2006
Location: Ireland
Junior Member
jez, i reckon posting the commit will do the job. A schoolboy error.

sorry for bothering ye lads.
Re: Insert sysdate on commit [message #202015 is a reply to message #201874] Tue, 07 November 2006 21:23 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
No sweat! Any time.

David
Previous Topic: Update Problem
Next Topic: No of detail block records.
Goto Forum:
  


Current Time: Sat Feb 08 17:02:04 CST 2025