尝试更新MySQL数据库中的时间戳
我不太关注你想要实现的目标,考虑到你的代码中没有UPDATE查询
我已经能够设置时间戳,但它设置在所有切片上 尝试使用正确的术语。时间戳在计算机语言中具有明确的含义,并且设置时间戳是没有意义的。 对不起,如果我误解了,可能是你发布的太多了。 您能否将代码缩小到您认为问题所在的位置?好的,让我澄清问题出在哪里以及我想要解决的问题做。在原始数据Feed中,我正在以组的形式获取数据。从本质上讲,如果设备实际上具有正确的日期和时间,但它们没有,那么这将是正常的。当这些设备首次上线时,它们从01/01/2000 00:00:00开始。涉及的表是: 展开 | 选择 | Wrap | 行号
我刚注意到这些记录的时间很好,它是错误的日期。因为SP从get_node_content获取返回的记录,是否有一种方法可以在插入时更改记录的日期?我会看到我能在这里发现什么来试图自己解决我的问题。如果有人能想到某种方式只改变日期,请随意开火:)
Hello everyone, hope you are all doing fine. What I''m attempting to do and have been tearing my hair out over for the last few weeks is trying to update timestamps in my MySQL database when this data gets fed in by an XML data feed. The data comes in as a group of slices. The number of slices per feed could be different so I have to dynamically find a way to take my existing stored procedure and expand on it. The problem I have is the timestamps can be incorrect. I am capturing the time/date that the record gets written to the database in a separate field. What I''m trying to do is: 1. Count the number of records that come in from the raw XML feed. 2. Compare the time difference between two of the record slices. 3. Take the last record of the batch and apply the time/date in the database. 4. Apply that time/date stamp less the difference for the previous records. Onto my Stored Procedures: There are two SPs involved, one is named parse_raw and the other get_node_content. The SP parse_raw calls get_node_content to break the raw XML into individual slices.
Expand|Select|Wrap|Line Numbers 解决方案 trying to update timestamps in my MySQL databaseI don''t quite follow what you are trying to achieve, considering there is no UPDATE query in your code
I have been able to get the time stamp to be set but it sets on all the slicesTry to use correct terminology. A timestamp has a definite meaning in computer language and to SET a timestamp is meaningless. I''m sorry if I have mis-understood, it may be you have posted too much. Could you narrow the code down to where you think the problem is?
Ok, let me clarify where the problem is and what I''m trying to do. In the raw data feed, I''m getting data in groups. Essentially, this would be fine if the devices actually had the correct date and time but they do not. When these devices first come online, they start at 01/01/2000 00:00:00. The table involved is: Expand|Select|Wrap|Line NumbersI just noticed that the time of these records is fine, it is the date that is wrong. Is there a method of changing the date of the record when it gets inserted since the SP takes the returned record from get_node_content? I''ll see what I can uncover here to try to resolve my problem on my own. If anyone can think of some way to change only the date, feel free to fire away :)更多推荐
改变时间戳
发布评论