Difference in timestamp values
Hi,
We have a project for like to like migration for R12 to R16, but ther are differences in the timestamp values calulated between the two enviornments
The R12 Production server is 5 hrs head of R16 production server.
i have applied the following formula to both the production report:
Timestampdiff(SQL_TSI_MINUTE,TIMESTAMP '2009-07-06 12:12:12',TIMESTAMP '2009-08-07 11:11:11')
the results are in Minutes:
R12:44578
R16:46019
Is this because of the difference in server timing? or R16 has a feature to calulate the difference without considering the timezones, daylight saving etc which the R12 lacks, because when i checked which of the 2 difference is correct, the R16 differnce seems to be correct.
Please share your thoughts on this as it is affecting large no .of reports.
Many Thanks
/* Formatted on 2012/04/12 15:56 (Formatter Plus v4.8.8) */
DECLARE
v_time1 date;
v_time2 date;
v_time_diff number;
BEGIN
SELECT To_Date(TO_CHAR (wss_gdp_time, 'DD-MON-YYYY HH12:MI:SS'),'DD-MON-YYYY HH12:MI:SS')
INTO v_time1
FROM tab1
WHERE wss_gdp_time = (SELECT MAX (wss_gdp_time)
FROM tab1) AND ROWNUM <= 1;
SELECT to_Date(TO_CHAR (wss_gdp_time, 'DD-MON-YYYY HH12:MI:SS'),'DD-MON-YYYY HH12:MI:SS')
INTO v_time2
FROM tab1
WHERE wss_gdp_time = (SELECT MAX (wss_gdp_time)
FROM tab1
WHERE wss_gdp_time < (SELECT MAX (wss_gdp_time)
FROM tab1))
AND ROWNUM <= 1;
SELECT ((v_Time1-v_time2) * 1440)
INTO v_time_diff
FROM DUAL;
DBMS_OUTPUT.put_line (v_time1 || ' ' || v_time2 || ' ' || v_time_diff);
IF v_time_diff > '10'
THEN
DBMS_OUTPUT.put_line ('ALERT');
ELSE
DBMS_OUTPUT.put_line ('No ALERT');
END IF;
END;
/
Similar Messages
-
Difference in minutes for two timestamp values
Dear All,
I am having two timestamp values and need to calculate the total time in minutes between them and store in a variable.
Can you please help me.
Eg:
T1 = 12-APR-12 06.01.56.000000 AM
T2 = 10-APR-12 06.14.32.000000 AM
I want to have T3 as the total time difference beteween T1 and T2 in minutes.
Not able to convert +000000001 23:47:24.000000000 in minutes
The above value I got was by just substracting T1 and T2
Thanks!/* Formatted on 2012/04/12 15:56 (Formatter Plus v4.8.8) */
DECLARE
v_time1 date;
v_time2 date;
v_time_diff number;
BEGIN
SELECT To_Date(TO_CHAR (wss_gdp_time, 'DD-MON-YYYY HH12:MI:SS'),'DD-MON-YYYY HH12:MI:SS')
INTO v_time1
FROM tab1
WHERE wss_gdp_time = (SELECT MAX (wss_gdp_time)
FROM tab1) AND ROWNUM <= 1;
SELECT to_Date(TO_CHAR (wss_gdp_time, 'DD-MON-YYYY HH12:MI:SS'),'DD-MON-YYYY HH12:MI:SS')
INTO v_time2
FROM tab1
WHERE wss_gdp_time = (SELECT MAX (wss_gdp_time)
FROM tab1
WHERE wss_gdp_time < (SELECT MAX (wss_gdp_time)
FROM tab1))
AND ROWNUM <= 1;
SELECT ((v_Time1-v_time2) * 1440)
INTO v_time_diff
FROM DUAL;
DBMS_OUTPUT.put_line (v_time1 || ' ' || v_time2 || ' ' || v_time_diff);
IF v_time_diff > '10'
THEN
DBMS_OUTPUT.put_line ('ALERT');
ELSE
DBMS_OUTPUT.put_line ('No ALERT');
END IF;
END;
/ -
Reading Timestamp value into an SSIS variable
I need to read the last timestamp value (MAX(TimeStampValue)) from a table, store it in a variable in SSIS and using the variable, perform a comparison against another table and load delta records.
The string data type is not playing well with the timestamp data type and things get even more complicated if I try to store the timestamp value as a varchar in a table.
Is there any variable data types in SSIS that will store the timestamp value easier than a string?It could be due to the time stamp value being incompatible with the date time functions which you need to fix.
So to make it conform manipulate on its value to get the proper format.
PS: Varchar WILL swallow any text, please be more specific, think how others would be reproducing YOUR issue.
Arthur My Blog -
SQL*Loader and timestamp values
I'm loading timestamp values (among other data) from a text file into Oracle using SQL*Loader.
The data I load is formatted like the following:
2008/11/13 23:55:21.366
2008/11/13 23:55:22.782
2008/11/13 23:55:25.879
Hence my control file look like this:
TSTAMP TIMESTAMP "YYYY/MM/DD HH24:MI:SS.FF",
The timestamp data in the input file are in UTC, however I load into a column that is of type "TIMESTAMP(3)", i.e. in server time. This is on purpose. I do not want the data to be in UTC when I look at them.
Therefore after the load I have to manually do
UPDATE mytable
SET tstamp = tstamp + (tstamp - sys_extract_utc(tstamp));
This update-after-loading actually takes quite some time due to the amount of records. I would like to avoid it and instead do it as part of the load. Is this possible somehow?
I'm on Oracle 10.2.
Thanks.Hi
What about setting a special Time Zone in your database?
You have two options when setting which time zone the database belongs to. You can either qualify it as a displacement from GMT/UTC in the format of 'hh:mm' or you can specify it as a name that has an entry in the V$TIMEZONE table.
select tzname,tzabbrev from V$TIMEZONE_NAMES;
select DBTIMEZONE from dual;
ALTER database SET TIME_ZONE = 'Denmark/Copenhagen';
select SESSIONTIMEZONE from dual;
select CURRENT_TIMESTAMP from dual;
See that link
http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/create.htm#sthref319
Edited by: Hub on Dec 7, 2008 3:58 PM -
How to compare 2 timestamp value (in terms of minutes)
Hi all.
I've got 2 timestamp value a,b. I would like to count the different (in terms of minutes).
I tried a.compareTo(b), but it's not work.
pls help.
Thanks
Regards,
KinI assume by "timestamp value" you mean Dates or longs.
Ever thought of basic maths?
date a - date b? Dates can be expressed in longs, as you might know.
For more info read the API. -
Hello Experts,
I want to know the sizes of some tables (e.g. TCURR). In different threads the transaction db02old and the function module 'DB_GET_TABLE_SIZE' are mentioned for that purpose.
I wonder that using these methods two different sizes are
Using transaction db02old I get a size of 81.920 for TCURR.
Using function module 'DB_GET_TABLE_SIZE' I get a size of 79.937 for TCURR. Why is there a difference between both values?
Thanks for your help.
Regards,
TobiasDB02old gives the correct information as it directly updates value from Database.
Function module 'DB_GET_TABLE_SIZE' depends on the variables you have set and it useful for ccms operations.
regards
nag
Edited by: welcomenag on Jul 6, 2009 4:15 PM -
Hi,
I found that there is difference in assigned values to differentn WBSs, in CJ30/32 and S_ALR_87013558...why this difference is coming?Thanks Nitin,
Few values which are not flowing especially the open commitments from PP are coming in SLR_..58 report. But i don't know why there is still inconsistency in the assigned values.
If you don't mind can you please explain me what actually happens when we run the program R...... you have mentioned in your reply. Is it necessary that this program has to be run frequently to bring in those open commitments to PS report ? or it's a one time job i.e once it is run from that moment onward system will start flowing the open commitment values to the reports. -
To get previous day timestamp of a timestamp value in java
Hi,
I have a timestamp variable, say settledTimeStamp which is passed as a runtime argument to a query. I should also send another timestamp variable say previousTimeStamp whose value should be previous day timestamp, ie for settledTimeStamp.
For example,
Todays date= May 9th 2008.
say settledTimeStamp to May 7th 2008.
I should get the timestamp value for previous day to SettleDate i.e May 6th, 2008.
I am showing this as an example because I tried with Calendar options too but it takes current timestamp and gives previous days timestamp which is not the same as I required. Like it returns May 8th as my previousTimeStamp if I work with Calendar options....
Can anyone help me on this?An object of the Calendar class represents a specific point in time. The fields, such as DAY_OF_MONTH, allow you to access meaningful parts of that specific point in time and use them. Calendar.DAY_OF_MONTH is a field, and it doesn't represent the "current day" or any particular point in time at all. It's used to ask a particular Calendar object what its DAY_OF_MONTH is.
import java.util.Calendar;
public class Test {
public static void main(String[] args) {
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(99999999999L);
int year = cal.get(Calendar.YEAR); //cal, what is your YEAR?
System.out.println(year);
int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); //cal, what is your DAY_OF_WEEK?
System.out.println(dayOfWeek);
boolean inApril = Calendar.APRIL == cal.get(Calendar.MONTH); //cal, are you in the month of APRIL?
System.out.println(inApril );
System.out.println(cal); //cal, tell me all about yourself
}Really, the documentation can do a better job explaining it than I can. Read it. And there are numerous Calendar and Date tutorials all over the internet. Date processing in java is not the easiest thing, so it can take a bit of getting used to, but you will have to read the documentation and write code yourself to understand it.
Oh, and you mark your question as answered and then dispense duke stars to posts you felt were helpful. I don't think people here really care much about them. -
I have bought an iPhone 4S in Brazil and I would like to know if I can replace my old iPhone for a new one (iPhone 5S), at some Apple Store in USA, if I pay just the difference between both values.
You're welcome.
I would advise against that for the reasons I provided.
Could I have my iPad 2 for the new one paying the difference between their values?
No. Sell the existing yourself and use the proceeds to purchase a new iPad. -
Get the timestamp value in the form of array of 8 bytes, whileretrieving da
3) How we can get the timestamp value in the form of array of 8 bytes, while retrieving the data?
4.) How we can pass the 8 byte array to stored procedure? What will the data type of the parameter?duplicate post:
timestamp value in the form of array of 8 bytes -
Timestamp value in the form of array of 8 bytes
1) How we can get the timestamp value in the form of array of 8 bytes, while retrieving the data?
2) How we can pass the 8 byte array to stored procedure? What will the data type of the parameter?1). using to_char
SQL> select to_char(systimestamp, 'ddmmyyyy') from dual ;
TO_CHAR(
10052006
SQL>2). as varchar2, and use to_timestamp to convert to timestamp:
SQL> select to_timestamp('10052006', 'ddmmyyyy') from dual ;
TO_TIMESTAMP('10052006','DDMMYYYY')
10-MAY-06 12.00.00.000000000 AM
SQL> -
DB timestamp value with JVM TimeZone
Hi all,
If we have database timestamp "*1970-01-01T16:00:00*", no matter what Time Zone the jvm is running with, we get the java.sql.Timestamp object representing the time "1970-01-01T16:00:00" locally(Shang Hai, Las Vegas, London...). So, the UTC time will be different as well.
I need to do some conversion work to make database timestamp "1970-01-01T16:00:00" as UTC time. Although it will be different in jvms with different time zones, they all mean the same time(UTC time, same million seconds from UTC Time 1970-01-01T00:00:00.000) and will be consistent.
For how to do the conversion, do you have any suggestion?Seems like an odd request.
1. If your database does NOT specify a timezone then the jdbc connection string would have a way to do that explicitly.
2. If you database DOES specify a timezone then you would need to write SQL (not java) that returned a unspecified timezone value, probably a string, which you would use to create a java timestamp (for example via SimpleDateFormat).
The above or course presumes that you understand that the jdbc has perfectly acceptable ways of getting correct timestamps from databases and that displaying a timestamp value has nothing to do with that. -
Strange Timestamp value problem
Hi gurus,
Please help me. And thanks in advance!
I have a stored procedure that creates an xml document, which includes a timestamp value converted from a date type column. When this procedure is run through a job, the converted timestamp value is considered invalid by our partner in that it has a plus (+) sign and some 0's at the end. But when I run the procedure manually from SQL*Plus, the timestamp value comes out valid. Here is what I have for the results.
Result when run from within the server through a job:
<ScheduleFor>
<ScheduledDateTime>2007-10-23T10:15:43+00:00</ScheduledDateTime>
</ScheduleFor>
Result when manually run from SQL*Plus:
<ScheduleFor>
<ScheduledDateTime>2007-10-23T10:16:36-05:00</ScheduledDateTime>
</ScheduleFor>
And here is the SQL for the above:
select xmlelement("ScheduleFor",
xmlelement("ScheduledDateTime", to_char(to_timestamp_tz(to_char(sysdate,
'YYYY-MM-DD HH24:MI:SS'), 'YYYY-MM-DD HH24:MI:SS.FF'),'YYYY-MM-DD"T"HH24:MI:SSTZH:TZM'))
) into v_xml
from dual;
Does anyone have an idea why I get this? We are on Oracle 10g Enterprise Edition Release 10.2.0.3.0.
Thanks a lot.
BenThanks again! You are right. This does change the time zone to 8:0:
ALTER SESSION SET TIME_ZONE = '-8:0';
select xmlelement("ScheduleFor",
xmlelement("ScheduledDateTime", to_char(to_timestamp_tz(to_char(sysdate,
'YYYY-MM-DD HH24:MI:SS'), 'YYYY-MM-DD HH24:MI:SS.FF'),'YYYY-MM-DD"T"HH24:MI:SSTZH:TZM'))
from dual;
<ScheduleFor><ScheduledDateTime>2007-10-24T08:37:05-08:00</ScheduledDateTime></ScheduleFor>
I will tell the DBA to fix it.
Thanks again!
Ben -
Difference between copy value and use one as many
hi
what is the difference between copy value and use one as many?
thanks[http://help.sap.com/saphelp_nw2004s/helpdata/en/26/d22366565be0449d7b3cc26b1bab10/content.htm]
[http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/df564b6aa24fc9ab0d685460747de5/content.htm]
Much better understanding of UseOneAsMany: [http://help.sap.com/saphelp_nw2004s/helpdata/en/38/85b142fa26c811e10000000a1550b0/content.htm]
Edited by: Praveen Gujjeti on Feb 18, 2010 11:42 AM -
Difference between a value table and a check table?
What is the difference between a value table and a check table?
Value Table
This is maintained at Domain Level.
When ever you create a domain , you can entered allowed values. For example you go to Domain SHKZG - Debit/credit indicator. Here only allowed values is H or S.
When ever you use this Domain, the system will forces you to enter only these values.
This is a sort of master check . To be maintained as a customization object. This mean that if you want to enter values to this table you have to create a development request & transport the same.
Check table
For example you have Employee master table & Employee Transaction table.
When ever an employee Transacts we need to check whether that employee exists , so we can refer to the employee master table.
This is nothing but a Parent & Child relationship . Here data can be maintained at client level , no development involved.
As per DBMS what we call foregin key table, is called as check table in SAP.
Reward points for the answer
Maybe you are looking for
-
Hi Two problems - one of which is driving med crazy!! Have the latest updates, and the display is connected to a MBA (mid 2011). The two are almost alwayes connected, and every time I wake the MBA from sleep, the Thunderbold Display does not "support
-
Hello i need the metal case where mij microsim is in i cant find it anyware
I need te outside case where you put the simcard in do anyone know where i can buy it im from the netherlands so maby in a shop there ?
-
Some of the camera photos missing geotagging
I,m using iPhone 4 with iOS5.... the gps location is ON for the camera, but some of the photos taken withthe camera are missing the geotagging. Cant find a pattern or a reason for it.few photos has the geo tagging and suddenly few images are without
-
AVI files delete video component
Hi... New problem. Pretty significant as it brings my current project to a stand still. I capture video files of my screen with "Debut". It is a trial version but I don't think that has anything to do with it. I get great video clips from it, one of
-
Print Cartridge Error (Electrical Failed Pen)
I'm using an HP Deskjet F4400 series, and I just replaced my empty black cartridge. Prior to that, the color cartridge was around 75% full. After installing the black cartridge, I have an error with the color cartridge, Print Cartridge Error (Elect