Recording a last updated time for each record in a table
hi
i have a table with 5 columns. and the table has 100 rows of data.
i need to add a sixth column and this column should contain the last updated time of that particular row.
i am allowed to use triggers.
for example, if the 55th row undergoes a change, the 6th column's value for the 55th row should update itself with that particular time.
can any one of you come up with an optimized solution for this please ???
thanx a million in advance and best regards,
novice DBA
:)
Hi,
Here's an example:
CREATE OR REPLACE TRIGGER table_x_biu
BEFORE INSERT OR UPDATE ON table_x
FOR EACH ROW
BEGIN
:NEW.modified_dt := SYSDATE;
END table_x_biu
SHOW ERRORSwhere table_x is your table name, and modified_dt is the DATE column to be populated.
You won't have to specify modified_dt in any INSERT or UPDATE statements. In fact, if you do, the value you give will be ignored, and the trigger will always substitute SYSDATE.
WARNING: if you do get an error message, the line number reported will usually be relative to the first DECLARE or BEGIN statement in the trigger. For example, if I had mis-spelled SYSDATE in the example above, the error message would say there was a problem in line 2, not line 5.
Similar Messages
-
How to get the last update time for a table ?
I want to know the last change of the table data , for example, a record has been changed, how can i get that time?
Regards,
LamentHello
check the tables CDHDR & CDPOS
But the condition when u r checking the these table.for a particular field the at data element level- futhur charactestictab level we have one check box called change document it as tick
Thank u,
santhosh -
Last Access and Last Update Times for objects in Cache
Hi,
We are looking to implement Tangosol cache for our one of our critical J2EE systems and I am pretty new to it. One of the requirements is to know the following timings
-Time when an object was put in a cache X (Last update of the object)
-Time when an object was last accessed in the cache X (Last access time of an object)
Is it possible to get these values through the Tangosol J2EE API?
Thanks,
raviHi Ravi,
You can use InvocationService to access this information - an example is attached.
Regards,
Dimitri<br><br> <b> Attachment: </b><br>DumpCache.java <br> (*To use this attachment you will need to rename 529.bin to DumpCache.java after the download is complete.) -
How to find out last update date for business partner's marketing attribute
How to find out last update date for business partner's marketing attribute??
Im freshie for SAP Application and im assigned to find out last update date for marketing attribute changed
which table is involved??
Yours kindness will be appreciated
thanksYou can take a look at table AUSP as well as CRMD_AUSP_HIST.
The "changed by" and "changed at" are logged on attribute level, not on attribute value level. When you change one specific value, the system does a "re-insert" of all existing values of this attribute.
Take a look at the SAP notes 938426 and 966670 these may assit you in resolving the issue.
Regards,
William Laverde -
Can I plot 2 locations at the same time for each record in a table
I'm trying to plot 2 Locations (2 points on a Power View Map) at the same time for each record/project in a table
I can plot 1 location for each project of course with no problem
but I'm trying to show the Begin Point and the
End Point for each project at the same time
Is this even possible?First of all THANKS this worked!
But now I stumbled on another issue. So I actually have 3 tables (and I've adopted them to the file you sent)
Table 1 => TripData
Trip
LongLat
Location
Type
TypeCode
Size
NW Tour
47.568077, -122.320800
Seattle, WA
Begin
0
1
NW Tour
47.035608, -122.884812
Olympia, WA
End
1
1
Cali Trip
37.808848, -122.412580
San Francisco, CA
Begin
0
1
Cali Trip
32.682611, -117.178348
San Diego, CA
End
1
1
Table 2 =>
TripInfo
Trip
OneLongLat
NTP
NW Tour
47.568077, -122.320800
1/1/2015
Cali Trip
37.808848, -122.412580
1/5/2015
Table 3 =>
ALLTrips
Trip
Stop
Owner
NW Tour
1
Owner1
NW Tour
2
Owner2
NW Tour
3
Owner3
NW Tour
4
Owner4
NW Tour
5
Owner5
Cali Trip
1
Owner6
Cali Trip
2
Owner7
Cali Trip
3
Owner8
Cali Trip
4
Owner9
Cali Trip
5
Owner10
Cali Trip
6
Owner11
This is how the Diagram View looks like in PowerPivot
Trip Data => Trip Info <= ALLTrips
Since I don't know how to post pictures
The MAP FIELDS are as follows
SIZE - Count of Stop(s)
LOCATIONS - OneLongLat followed by
LongLat (drill down feature)
COLOR - Trip
The problem now happens with the drill down feature
You can either plot OneLongLat which is the general location for each trip
Or LongLat of each trip which shows the begin and end points
But you can't use the drill down feature???
If instead of OneLongLat you use a
State Column it actually works!!!
I wonder if it has to do with the fact that both locations used for the drill down are Long/Lat numbers???
Any suggestions???
And again Thanks for the response! -
Sql statement for retrieving the last update time of a table
Hello all,
Can somebody give me an example of sql statement for retrieving the last update time of an oracle table.
Thank you
IlThanks for the fast replies. It works great when I test it as a sql statement but when trying to populate a datalist with it it raises the following exception:
Exception Details: System.ArgumentException: SCN_TO_TIMESTAMP(MAX(ORA_ROWSCN is neither a DataColumn nor a DataRelation for table DefaultView
Part of the Datalist Code:
ItemTemplate>
Line 12: SCN_TO_TIMESTAMP(MAX(ORA_ROWSCN)):
Line 13: <asp:Label ID="SCN_TO_TIMESTAMP_MAX_ORA_ROWSCN__Label" runat="server" Text='<%# Eval("[SCN_TO_TIMESTAMP(MAX(ORA_ROWSCN))]") %>'>
Line 14: </asp:Label><br/>
Line 15: <br/>
{code}
Why is this happening? Any ideas?
Il -
I need a query that selects the amount of records for each day in a table.
I need a query that selects the amount of records for each
day in a table.
Eg the result would be:
date 1 14
date 2 3
etc
Any ideas?sorted:
SELECT count([commentID]),convert(varchar, dateAdded, 112)
FROM COMMENTSgroup by convert(varchar, dateAdded,
112) -
For the last week or three Firefox refreshes two or three times for each refresh. Sometimes it refreshes for no obvious reason. For instance, I'll be in the middle of typing into a forum's post block & it refreshes. Or filling out an online form. Or simply viewing a page.
You can check for issues caused by an extension that isn't working properly.
Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
*Do NOT click the Reset button on the Safe Mode start window.
*https://support.mozilla.org/kb/Safe+Mode
*https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes -
Using Numbers, I need to time-stamp each line in a table for when it was entered
I need to time-stamp each line in a table for when it was entered.
I have a formula which is
"=IF(F18="","",NOW())"
it gives me the answer I want, but every time I edit any data in the formula is recalculates the date/time to reflect the most recent edit. I do not want to do this. I am open to any and all solutions including using a script. I do not really know anything about scripts except that they are really easy to use once it's written.
I have a formula i use in excel but it requires circular references in excel. I tried using this formula in numbers but I get the error that says I cannot reference a cell that references back to the cell i’m inputting the formula into (circular reference. It is easy to use in excel just by limiting the # of iterations in preferences. I can’t seem to find any such preference in numbers. Do you know of one? here is the formula:
"=IF(D4=”",”",IF(B4=”",NOW(),B4))"
I use it to time stamp each line in a spreadsheet. It is the only way to keep all the previous line from recalculating everytime I add a new line. If I can’t use this formula, do you know of a way to timestamp each line without having it update everytime I add a line or edit the form?
Thanks in advance- I know this isn’t exaclty an easy question but I have honestly looked everywhere
emelyHi Emely,
Check the Insert menu:
The highlighted item is slightly misnamed, requiring a bit more than a simple selection (or keypress combination*) to act as a time stamp.
Simply choosing the menu item willproduce the result shown in A2: A time and date value is entered, but only the Date part is displayed.
Setting the cell format to Date and Time, with both parts displayed (as I've done in column B) does show both parts of the Date and Time value, but as you can see, the time part is set to midnight, as it is in any cell where you have entered only the Date part of a Date and Time value. The date was entered here in the same manner as in A3.
To enter both the current Date and current Time, the process has a few more steps:
Select the cell
Go Insert > Date & Time
Before confirming the entry, double-click the cell (now showing the Date) to open this small dialogue:
Click the pop-up menu under Choose Date format:
Choose the last item in the list.
Results as shown in A4 and B4 of the table above.
Regards,
Barry
•Regarding the KB shortcut shown: The Mac OS lets you define a KB shortcut for any top-level menu item. The one in the menu is a user-defined keypress combination, made to be easily remembered, not to be physically convenient to use. If doing your own, you may want to try for something eassier to get your fingers on. -
Hi all,
Under System > Status > Collectors Status
Status shows OK but Last Update Time is not updated. The last update time is frozen.
Anyone has a similar experience? Would someone help, please?
Regards,
NathanHi Nathan,
that seems odd indeed. would not know the cause or any sensibl explaination unless I have system details, Can you pls file an SR for this issue and upload the helpdesk file to the SR?
a helpdesk file is created under system >>maintenance>>helpdesk report
It will create a zip file that we can read in support, see the events the system is capturing, analyze your configuration. That will allow us for very quick follow up. if you want me to track it internally at Oracle pls send me the SR# in a direct mail: [email protected] -- I'm the responsible product manager for RUEI so happy to follow up on this.
R, jurgen -
Last Scan Time vs Last Update Time
All,
I have been using SW to track my Server 2003 boxes as MS will be EOL of these next week. In my Inventory report I include Last Scan and Last Update. As we migrate the boxes to Server 2012 - I had expected to see the 2003 Server OS drop off of the list but that is not happening.
I am getting current "Last Update" (7/13/2015) but the report still says the box has OS Server 2003 and I know it is Server 2012.
What am I missing and the bigger question is - This is for servers only. Do I have confidence that my PC inventory is reflecting the correct updates in my larger inventory?
Any advice would be appreciated.
This topic first appeared in the Spiceworks CommunityIt is my understanding that the 'discovery scan' is just for the initial scan and then there is also an update scan that just checks for differences.
I have my remote collectors to search specific subnets and scan once a week. Ever since the initial scan they all show up during in the inventory. I see most of them being 'updated' in inventory according to the schedule and the timestamp but the "Last Scan Time" never changes. As such my not scanned in 30 days just continues to build up. The "Last Updated Time" gets updated correctly but nothing else.
Is this normal behavior? It doesn't seem like it is considering the Not Scanned in 30 days group exists. It wouldn't make sense for that group to exist if there was no need for a "scan" if "updates" worked just fine.
This topic first appeared in the Spiceworks Community -
What exactly is the "last scan time" and "last update" time
There was a topic last year about this confusion. Here shows the topic and the answers that you might be looking for :)
Have a great day!
-IsaacIt is my understanding that the 'discovery scan' is just for the initial scan and then there is also an update scan that just checks for differences.
I have my remote collectors to search specific subnets and scan once a week. Ever since the initial scan they all show up during in the inventory. I see most of them being 'updated' in inventory according to the schedule and the timestamp but the "Last Scan Time" never changes. As such my not scanned in 30 days just continues to build up. The "Last Updated Time" gets updated correctly but nothing else.
Is this normal behavior? It doesn't seem like it is considering the Not Scanned in 30 days group exists. It wouldn't make sense for that group to exist if there was no need for a "scan" if "updates" worked just fine.
This topic first appeared in the Spiceworks Community -
How to reduce the time for each clips up to 0,04 seconds?
Hi, I'm trying to realize my first time laps. I've need to reduce the time for each clips up to 0,04 seconds, but it seems that the minimum time is 0,1 second. There's a solution?
And use a zip file. Many people can't open RARs.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
Last Entry Date for Each Quarter
Hi,
I want to find out the last entry date for each quarter. The query I am using is this:
SELECT
Country.Name as Country,
CONVERT(DATE,MAX([CreationDate])) as LastDateOfClipEntry,
DATEPART(Year,([CreationDate])) as Year,
DATEPART(Quarter,([CreationDate])) as Quarter
FROM
[dbo].[Clip]
JOIN Office on Office.Code = Clip.Office
JOIN Country on Country.Code = Office.Country
WHERE YEAR(CreationDate) IN (@YEAR)
GROUP BY Country.Name,DATEPART(Year,([CreationDate])) ,DATEPART(Quarter,([CreationDate]))
ORDER BY Country.Name
Now based on the column group I added in my report the result is coming correct but not properly formatted as I want.
Below is the snapshot how its coming now:
I don't want the extra blanks coming for each occurrence. There should be only one line for Australia and in the single line it should show the last entry date for that quarter. How can I achieve that ? Below is the snapshot showing current config:
Thanks a lot in advance. Any help would be appreciated.
Vivek KamathHi Vik2907,
According to your description, you have a matrix which shows you those unexpected cells. Right?
In this scenario, the reason caused this problem is the group setting. Mostly, you set the row group on a wrong field. As we tested in our local environment, if you set the row group on LastDateOfClipEntry, it will render the data as the screenshot you post.
Please check both Row and Column Group setting, make sure they are group on proper field.
Reference:
Tables, Matrices, and Lists (Report Builder and SSRS)
Understanding Groups (Report Builder and SSRS)
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
I am having issues with adjusting the duration of time for each still frame and transition in imovie 11. Each time that I adjust these times, the application does not accept the change, and instead automatically enters its own time. Is there a work around this? Or am I doing something wrong? Please Help!
Thank you,
lagrlHave you tried turning off automatic transitions ? Choose file - project properties and follow the dialogue box to change duration with a slider. iMovie also doesn't allow a transition to be more than 50% duration of the clip its attached to. In other words if the clip is 4 seconds the transition cannot be more than 2 seconds and remember that relates to the first clip as the following clip (right side) is pulled back to overlay it.
Does this help. Perhaps you already know this ?
Maybe you are looking for
-
Installation 9.2.0.2 on hp-UX 11.31
Hello everybody I'm trying to install Oracle database 9.2.0.2 on a HP-UX 11.31 Itanium. I've no choice for now. At the beginning of the installation, I am following message : "OUI cannot determine the platform of the system. This may occur if OUI is
-
How to fix my etrecheck results?
As you can see in my report below I have a lot of bad things on my mac-- even though I didn't think that was possible! Can anyone help me with the step to clean this up? EtreCheck version: 2.1.6 (109) Report generated January 26, 2015 at 3:04:14 PM
-
Error While Installing SAP NetWeaver 7.0 ABAP Trial version
Hi, While installing SAP Netwaver 7.0 ABAP on my Windows XP SP3 virtual m/c i got this error at starting only - Path contains reserved character (':'): K: NWASABAPTRIAL7020 can any one help me out....
-
Allright so I want to set some keys on keyboard so I can stop MPD when I don't want to listing to my music. I just can't figure out how this is set. I now GNOME has this option, and I found it very useful. Any suggestions?
-
Looking for text animation presets beyond those within after fx but haven't really found anything. Do you have any quick suggestions as to where to get additional text animation presets?? I want some super cool/sleek stuff... An example = I really li