Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date, Time Stamps 1

Status
Not open for further replies.

GuntherKS

MIS
Nov 13, 2000
13
US
I successfully inserted information into an oracle database, but I want to insert a date/time stamp to tell me when they insert the data. I have a column created in Oracle with the 'date' format. Is there a script I can write for this, or is their a function that will do it for me in VID?

Thanks
 
Do it in the oracle database at column level. You can set the column to have a default value, either that or you use
Code:
sysdate
in the insert statement. this will then insert the servers date/time into the column for you.

James :) James Culshaw
jculshaw@active-data-solutions.co.uk
 
I used a Form Manager to manage the updates and inserts. Upon click of the save button I tried to have txtTime.value = sysdate. This does not work. However, when I manually type in a date into txtTime.value It works fine.

Any more suggestions would be appreciated. Thanks for the help.

Kevin
 
Yes, that because SYSDATE will only work in a SQL string, or a stored procedure. It might be easier, and it is more effciient to create all your inserts and updates as Stored procedures in Oracle and then you can use sysdate. If you are using Visual Interdev, I think yu would need to use the VB Date() statement in your form as Interdev usies VBScript.

James :) James Culshaw
jculshaw@active-data-solutions.co.uk
 
After bouncing this off other co-workers, I have found an answer. Interdev uses FormatDateTime(date,0). 'Now' can be substituted for Date for the current date. '0' is general formatting that works best with Oracle. The code I used to make it work looks something like this:

getcurrentdate = FormatDateTime(now,0)
txtTStamp.value = getcurrentdate
rsITSxxx.updateRecord

Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top