Focal Point
Maintain Module issue

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4021056651

March 01, 2006, 02:27 AM
Qalqili
Maintain Module issue
hi All

i have some issue at the Maintain Procedure:

i Create the Maintain Application that update this table in SQLServer Database
{First Name , Last Name , Account Number , TransAction Time , TransAction User} by Inserting new record contain only the {First Name , Last Name , Account Number}
my quistion here i want to set the TransAction Time to the Time Of the Server and the TransAction User to the User whoes logged into the Dashboard ?

any suggestion Smiler


WF 7.7.0.3HF3 / WinXP- WF-Client & Apache / DevStd 7.7.0.3HF3 win XP.
March 01, 2006, 03:09 AM
Pete
Hey Q,

I work oracle not with Sqlserver , but the way i go about is , that i create a update trigger for the DB table , this has the advantage that you dont have to fill in the user and date in maintain , because you can define that in your database trigger

I'm almost sure that you can DB triggers in sqlserver also.

Peter


D: WF 7.6.2 P. : WF 7.6.2 on W2003
------------------------------------------------------------------
I see myself as an intelligent, sensitive human, with the soul of a clown which forces me to blow it at the most important moments.

-Jim Morrison-

March 01, 2006, 03:22 AM
Pete
i've googled this up for you

CREATE TRIGGER myTRIGGER on THETABLE
INSTEAD OF UPDATE
AS
UPDATE THETABLE
SET
DT = GETDATE(),
NM = COALESCE(inserted.NM, USER)
FROM inserted
WHERE THETABLE.ID = inserted.ID
GO


something like this must work


D: WF 7.6.2 P. : WF 7.6.2 on W2003
------------------------------------------------------------------
I see myself as an intelligent, sensitive human, with the soul of a clown which forces me to blow it at the most important moments.

-Jim Morrison-

March 01, 2006, 04:28 AM
Qalqili
it is working
Smiler Smiler
thanX Peter


WF 7.7.0.3HF3 / WinXP- WF-Client & Apache / DevStd 7.7.0.3HF3 win XP.