DateTimeStamp - can I set vDB to automate my DTStamp?

Barry G. Sumpter barrysum at bigpond.net.au
Sun Mar 25 15:59:35 CDT 2012


Thanks Thorsten.
Thanks Ruslan.

Could we please update the wiki 
for the DateTime field 
to show either or both of these methodologies?

All my best


------------
Message: 2
Date: Sun, 25 Mar 2012 00:44:31 +0100
From: Thorsten Hohage <thohage at genericobjects.de>
To: Valentina Developers <valentina at lists.macserve.net>
Subject: Re: DateTimeStamp - can I set vDB to automate my DTStamp?
Message-ID: <BB739733-FAA5-4DD2-9CBD-8F7E2717396C at genericobjects.de>
Content-Type: text/plain; charset=us-ascii

Hi Barry,

On 2012-03-25, at 00:39, Barry G. Sumpter wrote:

> Is there a way to automate Valentina to do the DateTimeStamp work for me?

perhaps I'm way to tired, but do you want Valentina automatically create a
timestamp when you insert or update a record?

Then you need a trigger, I attached two of mine below.

Btw. when connecting to Valentina, I put the current OS user name as a
connection property so I can set the name automatically.

Hope this is what you asked for.

regards,

Thorsten Hohage
-- 

Valentina Technology Evangelist
generic objects  GmbH - Leiter Solution Center Nord




CREATE OR replace TRIGGER "TRCArticle_BI" BEFORE INSERT ON "TRCArticle"

FOR EACH ROW

	BEGIN
		new.creationStamp = now();
		new.changeStamp = now();


		declare cUser VARCHAR(256);
		Set cUser = get property currentUser of connection;

		new.creationUser = cUser;
		new.changeUser = cUser; 
	END;



CREATE OR replace TRIGGER "TRCArticle_BU" BEFORE UPDATE ON "TRCArticle"

FOR EACH ROW

	BEGIN
		new.changeStamp = now();

		declare cUser VARCHAR(256);
		Set cUser = get property currentUser of connection;
		new.changeUser = cUser; 
	END;

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

Message: 6
Date: Sun, 25 Mar 2012 17:53:35 +0200
From: Ruslan Zasukhin <ruslan_zasukhin at valentina-db.com>
To: "valentina at lists.macserve.net" <valentina at lists.macserve.net>
Subject: Re: DateTimeStamp - can I set vDB to automate my DTStamp?
Message-ID: <CB950C1F.FCDDA%ruslan_zasukhin at valentina-db.com>
Content-Type: text/plain;	charset="US-ASCII"

On 3/25/12 4:19 AM, "Barry G. Sumpter" <barrysum at bigpond.net.au> wrote:

Hi Barry,

> I'd still like to know if valentina will allow me to set the DateTime 
> field to auto populate.

You mean insert NOW()  on insert of record ?

You can use trigger for this

Please check 

http://valentina-db.com/dokuwiki/doku.php?id=valentina:vcomponents:vsql:refe
rence:reference 

Something like this:

CREATE TRIGGER trig_before_insert_T1
  BEFORE INSERT
  ON T1
BEGIN
       fldDate = NOW();
END

Please check WIKI ..


--
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information http://www.paradigmasoft.com

[I feel the need: the need for speed]




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

_______________________________________________
Valentina mailing list
Valentina at lists.macserve.net
http://lists.macserve.net/mailman/listinfo/valentina


End of Valentina Digest, Vol 111, Issue 32
******************************************



More information about the Valentina mailing list