Date difference when converting Calendar date to sql date

I am trying to convert a Calendar date to sql date. The only problem in the conversion is sql date adds 1 month to the original date. Due to this my query results show different data than what it is suppossed to show.
Here is my code
Calendar startDate = Calendar.getInstance();
startDate.set(2006, 10, 01, 00, 00); // 1-Oct-2006
return (new java.sql.Date(date.getTimeInMillis()));
on the last statement it adds a month to original date. So the final date i get is 1-Nov-2006.
Any solution to this problem?
Thanks
Sameer

Thanks everyone for quick response.
I have read javadocs many times but that does not
change the fact that Calendar and Sql date
interpretation is different.No, it isn't. You are setting the moth to november when you set the month to 10, and november is what java.sql.Date is showing. So where is the difference? You are doing it wrong and that is why you get the wrong month.
How the f do you think that the calender should know that you want october when you set it to november?
My application is deployed through web service and
the clients may access it through any programming
langague (java, php, ec). Even I am testing it
through java and php. Still doesn't matter. You need to subtract the month by one if you want to let your user use 1 for january.
While testing it through java month is different but
through php its correct.Read the docs.
Can smoeone please give me the best possibel solution
to this?see above

Similar Messages

  • Convert Calendar to Java.sql.Date

    I seached for a solution for converting a Calendar-object to a java.sql.date for inserting it into a MySQL DB (DateTime). I know this question is a FAQ. The solution I found is the following code:
    java.sql.Date sqlDate =  new java.sql.Date(cal.getTime().getTime() );When i do a print of the sqlDate to the console I get: sqlDate: 2005-06-27
    But when I look into de DB I get the following date: 27/05/1905
    I know that in Java the months are starting from 0-�11 and that the years counting is starting from 1900. But I assume that the solution is not to just add the correct month and year manually. because I get a correct console-output. If I do this I get a correct DB Date, but a wrong console-date.

    II dont know if you found an answer but I needed a similar solution so I wrote a test program.
    Let me know if this solves the problem for you.
    import java.util.*;
    import java.sql.*;
    public class dateTest{
    public static void main(String args[]){
    // Step by step
    // Calendar rightNow = Calendar.getInstance();
    // java.util.Date today = rightNow.getTime();
    // long theTime = today.getTime();
    // java.sql.Date sDate = new java.sql.Date(theTime);
    // In one line
    java.sql.Date sDate = new java.sql.Date(Calendar.getInstance().getTime().getTime());
    System.out.println("sDate is: "+sDate.toString());
    }

  • Needed help regarding converting  string to java.sql.Date format

    I have a a function which returns a calendar object. The date must be inserted to Oracle DB using java.sql.Date format.
    So i have converted the Calendar object to java.sql.Date format using the following code
    java.sql.Date publicationDate = new java.sql.Date(book.getPublicationDate().getTime().getTime());But while getting inserted into the DB it was in mm/dd/yyyy format whereas i wanted dd/mm/yyyy format
    Can any body please help out how to store the date in dd/mm/yyyy format ?

    Can u please explain this a bit
    This is my code
    public int addBook(List<Book> BookList) throws SQLException, ParseException{
              System.out.println("Hi there");
              Book book = new Book();
              BookDB bookDb = new BookDB();
              //listLength =      BookList.length;
              String bookId = null;
                   try{
                        DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
                        con  = DriverManager.getConnection("jdbc:oracle:thin:@10.123.79.195:1521:findb01","e115314", "e115314");
                        addBook = con.prepareStatement("insert into ABC_Book values(?,?,?,?,?,?,?)");
                        Iterator<Book> iterator = BookList.iterator();
                        while(iterator.hasNext()){
                             book = (Book)iterator.next();
                             System.out.println(book.getBookId());
                             addBook.setString(1,book.getBookId());
                             addBook.setString(2,book.getTitle());
                             addBook.setString(3,book.getAuthor());
                             addBook.setString(4,book.getPublisher());
                             System.out.println(book.getPublicationDate());
                             System.out.println("Before Date");
                             System.out.println("book.getPublicationDate().getTime()"+book.getPublicationDate().getTime());
                             java.sql.Date publicationDate = new java.sql.Date(book.getPublicationDate().getTime().getTime());
                             SimpleDateFormat formatter = new SimpleDateFormat("dd/mm/yyyy");
                             dateString = formatter.format(publicationDate);
                             System.out.println("Today is"+dateString);
                             java.sql.Date date = (java.sql.Date)formatter.parse(dateString);
                             System.out.println("date"+date);
                             //java.sql.Date publicationDate = (Date)book.getPublicationDate().getTime();
                             //System.out.println("Value of date is"+publicationDate);
                             System.out.println("After Date");
                             addBook.setDate(5,publicationDate);
                             addBook.setString(6,book.getCountry());
                             addBook.setString(7,book.getLanguage());
                             rs = addBook.executeQuery();
                             //con.commit();
                             rowCount = rowCount + rs.getRow();
                        return rowCount;
                   catch(SQLException se){
                        se.printStackTrace();
                   finally{
                        con.close();
                        System.out.println("After adding ");
              return 0;
         }

  • Trying to convert String to java.sql.Date

    I need to convert a String (in the format "yyyy-mm-dd") to java.sql.Date
    It was suggested I use the following,
    SimpleDateFormat formater = new SimpleDateFormat("yyyy-mm-dd");
    Date result = formater.parse(dbirth.getText());
    However, It seem to produce a java.util.Date
    Error: found java.util.Date
    Required : java.sql.Date
    Can anyone help?
    Thanks, Marika

    I need to convert a String (in the format
    "yyyy-mm-dd") to java.sql.Date
    It was suggested I use the following,
    SimpleDateFormat formater = new
    SimpleDateFormat("yyyy-mm-dd");
    Date result = formater.parse(dbirth.getText());
    However, It seem to produce a java.util.Date
    Error: found java.util.Date
    Required : java.sql.Date
    Can anyone help?
    Thanks, Marika SimpleDateFormat formater = new SimpleDateFormat("yyyy-mm-dd");
    java.util.Date parsedDate = formater.parse(dbirth.getText());
    java.sql.Date result = new java.sql.Date(parsedDate.getTime());

  • HT201415 actually i am use iphone5 in bangladesh. But i am facing some problem , when i am useing the internet over cellular data network. when i am open the cellular data on but no icon E display but when Enable 3G on-of then E is aviable.its a device pr

    actually i am use iphone5 in bangladesh. But i am facing some problem , when i am useing the internet over cellular data network. when i am open the cellular data on but no icon E display but when Enable 3G on-of then E is aviable.its a device problem or Carrier ?

    Hafizur Rahman wrote:
    when i am open the cellular data on but no icon E display but when Enable 3G on-of then E is aviable.its a device problem or Carrier ?
    Problem? I'm not even sure what your problem is, much less whether it's a problem with the phone or the carrier.

  • How do I preserve date/time when converting to DNG?

    When I convert a file to DNG format in Lightroom, it changes the capture time in the metadata to the current date and time, rather than copying the source data.  Is there a way in which I can tell it to leave my dates alone?

    You wrote: “I noticed my mistake. It seems that what the conversion process was changing was the ‘Metadata Date’ and ‘Date Time’ fields, but ‘Date Time ‘" and ‘Date Time Digitized’ were remaining the proper, original date. The cause of my confusion was that my Metadata panel view was hiding all but the ‘Date Time’ field, so it appeared as though it had overwritten my prior date information.”
    Date/times in photo metadata can be very confusing.  There are all these fields with confusing names imposed by legacy industry standards -- I challenge anyone except a metadata nerd like me to remember the meanings and differences of Date/Time, Date/Time Original, Date/Time Digitized, Capture Time, Metadata Date, Modify Date, ....  The worst are the two XMP fields Date Created and Create Date, which have two very different meanings!  And every app and operating system makes a half-hearted attempt to "simplify" it for the user by choosing different names.   
    LR makes no serious attempt to make this easy for the user, and over the first several versions, it's handling of date/times was pretty sloppy. (It still has outstanding bugs that don't crop up that often in practice.)  You would think that at least LR would provide roll-over tool tips on the field names in the Metadata panel explaining each field.

  • Conversion failed when converting the varchar value to data type int

    Hi, I am unable to resolve this error and would like some assistance please.
    The below query produces the following error message -
    Msg 245, Level 16, State 1, Line 1
    Conversion failed when converting the varchar value 'NCPR' to data type int.
    Select Pc2.Assess,
                    Select Pc1.Title
                    From Pc1
                    Where Pc1.Assess = Pc2.Assess
                ) [Title]
            From Pc2
    However, when I run the query below I get the results shown in the image . Ie. nothing. Pc1 & Pc2 are aliases and are the same table and the assess field is an int. I found NCPR in one cell but that column (prop) is not used in the query. The table
    is nearly 25k rows.
    SELECT * FROM Pc1 WHERE Pc1.Assess LIKE '%NCPR%' OR ISNUMERIC(Pc1.Assess) = 0
    Thank you

    WHERE ISNUMERIC(id) = 1 and there are obviously no 'NCPR' records in the view as per my previous post.
    That is a bad assumption - SQL Server does not have to evaluate the query in the order you are expecting it to.
    Take this simple example
    CREATE TABLE #example
    col1 VARCHAR(50) NOT NULL
    INSERT INTO #example VALUES ('1'), ('2'), ('NaN')
    SELECT * FROM
    SELECT * FROM #example
    WHERE ISNUMERIC(col1) = 1
    ) X
    (3 row(s) affected)
    col1
    1
    2
    (2 row(s) affected)
    compare to
    CREATE TABLE #example
    col1 VARCHAR(50) NOT NULL
    INSERT INTO #example VALUES ('1'), ('2'), ('NaN')
    SELECT * FROM
    SELECT * FROM #example
    WHERE ISNUMERIC(col1) = 1
    ) X
    WHERE col1 = 1
    (3 row(s) affected)
    col1
    1
    Msg 245, Level 16, State 1, Line 8
    Conversion failed when converting the varchar value 'NaN' to data type int.

  • Conversion failed when converting the varchar value to data type int error

    Hi, I am working on a report which is off of survey information and I am using dynamic pivot on multiple columns.
    I have questions like Did you use this parking tag for more than 250 hours? If yes specify number of hours.
    and the answers could be No, 302, 279, No and so on....
    All these answers are of varchar datatype and all this data comes from a partner application where we consume this data for internal reporting.
    When I am doing dynamic pivot I get the below error.
    Error: Conversion failed when converting the varchar value 'No' to data type int.
    Query
    DECLARE @Cols1 VARCHAR(MAX), @Cols0 VARCHAR(MAX), @Total VARCHAR(MAX), @SQL VARCHAR(MAX)
    SELECT @Cols1 = STUFF((SELECT ', ' + QUOTENAME(Question) FROM Question GROUP BY Question FOR XML PATH('')),1,2,'')
    SELECT @Cols0 = (SELECT ', COALESCE(' + QUOTENAME(Question) + ',0) as ' + QUOTENAME(Question) FROM Question GROUP BY Question FOR XML PATH(''))
    SET @SQL = 'SELECT QID, QNAME' + @Cols0 + '
    FROM (SELECT QID, QNAME, ANSWERS, Question
    FROM Question) T
    PIVOT (MAX(ANSWERS) FOR Question IN ('+@Cols1+')) AS P'
    EXECUTE (@SQL)
    I am using SQL Server 2008 R2.
    Please guide me to resolve this.
    Thanks in advance..........
    Ione

    create table questions (QID int, QNAME varchar(50), ANSWERS varchar(500), Question varchar(50))
    Insert into questions values(1,'a','b','c'), (2,'a2','b2','c2')
    DECLARE @Cols1 VARCHAR(MAX), @Cols0 VARCHAR(MAX), @Total VARCHAR(MAX), @SQL VARCHAR(MAX)
    SELECT @Cols1 = STUFF((SELECT ', ' + QUOTENAME(Question) FROM Questions GROUP BY Question FOR XML PATH('')),1,2,'')
    SELECT @Cols0 = (SELECT ', COALESCE(' + QUOTENAME(Question) + ',''0'') as ' + QUOTENAME(Question) FROM Questions GROUP BY Question FOR XML PATH(''))
    SET @SQL = 'SELECT QID, QNAME' + @Cols0 + '
    FROM (SELECT QID, QNAME, ANSWERS, Question
    FROM Questions) T
    PIVOT (MAX(ANSWERS) FOR Question IN ('+@Cols1+')) AS P'
    EXECUTE (@SQL)
    drop table questions

  • Convert string into java.sql.Date

    Hi,
    I want to convert a date in string form into java.sql.Date to persist into the database column with Date as its datatype in Oracle. I'm trying as follows:
    import java.sql.Date;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    public class DateTest
    public static void main(String[] args)
    String strDate = "2002-07-16 14:45:01";
         System.out.println("strDate = "+strDate);
    Date aDate = null;
    try
    if(strDate != null && !strDate.trim().equals(""))
         SimpleDateFormat aSDF = new SimpleDateFormat();
         aSDF.applyPattern("yyyy-MM-dd hh:mm:ss");
         java.util.Date utilDate = aSDF.parse(strDate);
    System.out.println("utildate = "+utilDate);
         aDate = new Date(utilDate.getTime());
         aDate.setTime(utilDate.getTime());      
         System.out.println("aDate = "+aDate);
    catch (ParseException e)
    System.out.println("Unable to parse the date - "+strDate);
    catch (Exception ex)
    ex.printStackTrace();
    System.out.println("Caught Exception :"+ex.getMessage());
    It gives the output as :
    strDate = 2002-07-16 14:45:01
    utildate = Tue Jul 16 14:45:01 IST 2002
    aDate = 2002-07-16
    If I put this value into the database table, I can see only the date. Time part is missing. Is this the problem with java.sql.Date or Oracle datatype Date? Please help me asap.
    Thanks in advance.
    Regards,
    Rajapriya.R.

    If I put this value into the database table, I can
    see only the date. Time part is missing. Is this the
    problem with java.sql.Date or Oracle datatype Date?This is not a problem, this is the defined behaviour of the Date type. RTFAPI and have a look at Timestamp, while you're at it.

  • Conversion failed when converting the nvarchar value to data type int when returning nvarchar(max) from stored procedure

    Thank you for your help!!! 
    I've created a stored procedure to return results as xml.  I'm having trouble figuring out why I'm getting the error message "Conversion failed when converting the nvarchar value '<tr>.....'
    to data type int.    It seems like the system doesn't know that I'm returning a string... Or, I'm doing something that I just don't see.
    ALTER PROCEDURE [dbo].[p_getTestResults]
    @xml NVARCHAR(MAX) OUTPUT
    AS
    BEGIN
    CREATE TABLE #Temp
    [TestNameId] int,
    [MaxTestDate] [DateTime],
    [Name] [nvarchar](50),
    [Duration] [varchar](10)
    DECLARE @body NVARCHAR(MAX)
    ;WITH T1 AS
    SELECT DISTINCT
    Test.TestNameId
    , replace(str(Test.TotalTime/3600,len(ltrim(Test.TotalTime/3600))+abs(sign(Test.TotalTime/359999)-1)) + ':' + str((Test.TotalTime/60)%60,2)+':' + str(Test.TotalTime%60,2),' ','0') as Duration
    ,MaxTestDate = MAX(TestDate) OVER (PARTITION BY TM.TestNameId)
    ,TestDate
    ,TM.Name
    ,Test.TotalTime
    ,RowId = ROW_NUMBER() OVER
    PARTITION BY
    TM.TestNameId
    ORDER BY
    TestDate DESC
    FROM
    Test
    inner join TestName TM on Test.TestNameID = TM.TestNameID
    where not Test.TestNameID in (24,25,26,27)
    INSERT INTO #Temp
    SELECT
    T1.TestNameId
    ,T1.MaxTestDate
    ,T1.[Name]
    ,T1.Duration
    FROM
    T1
    WHERE
    T1.RowId = 1
    ORDER BY
    T1.TestNameId
    SET @body ='<html><body><H3>TEST RESULTS INFO</H3>
    <table border = 1>
    <tr>
    <th> TestNameId </th> <th> MaxTestDate </th> <th> Name </th> <th> Duration </th></tr>'
    SET @xml = CAST((
    SELECT CAST(TestNameId AS NVARCHAR(4)) as 'td'
    , CAST([MaxTestDate] AS NVARCHAR(11)) AS 'td'
    , [Name] AS 'td'
    , CAST([Duration] AS NVARCHAR(10)) AS 'td'
    FROM #Temp
    ORDER BY TestNameId
    FOR XML PATH('tr'), ELEMENTS ) AS NVARCHAR(MAX))
    SET @body = @body + @xml +'</table></body></html>'
    DROP TABLE #Temp
    RETURN @xml
    END
    closl

    Your dont need RETURN inside SP as you've declared @xml already as an OUTPUT parameter. Also you can RETURN only integer values using RETURN statement inside stored procedure as that's default return type of SP.
    so just remove RETURN statement and it would work fine
    To retrieve value outside you need to invoke it as below
    DECLARE @ret nvarchar(max)
    EXEC dbo.[P_gettestresults] @ret OUT
    SELECT @ret
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Date difference function that returns minutes between two dates and excludes weekends and holidays

    Is there a way to get this to work as a function? 
    Currently returns error "Select statements included within a function cannot return data to a client"
    CREATE FUNCTION [dbo].[WorkDays](@DateFrom datetime,@DateTo datetime)
    RETURNS int
    AS
    BEGIN
    --Working time
    DECLARE @WTFrom TIME = '8:00AM';
    DECLARE @WTTo TIME = '5:00PM';
    DECLARE @minCount BIGINT
    --Date ranges
    IF (DATEDIFF(HOUR, @DateFrom, @DateTo) > 12)
    BEGIN
    WITH CTE AS
    SELECT @DateFrom AS DateVal
    UNION ALL
    SELECT DATEADD(HOUR, 1, DateVal)
    FROM CTE
    WHERE DateVal < DATEADD(HOUR, -1,@DateTo)
    SELECT DATEDIFF(minute, MIN(CTE.DateVal), MAX(CTE.DateVal))
    FROM CTE
    WHERE (CAST(CTE.DateVal AS time) > @WTFrom AND CAST(CTE.DateVal AS time) < @WTTo) AND DATEPART(dw, CTE.DateVal) NOT IN (1, 7) AND NOT EXISTS (SELECT * FROM Holiday AS H WHERE H.holiday = CTE.DateVal)
    OPTION (MAXRECURSION 0);
    END;
    ELSE
    BEGIN
    WITH CTE AS
    SELECT @DateFrom AS DateVal
    UNION ALL
    SELECT DATEADD(MINUTE, 1, DateVal)
    FROM CTE
    WHERE DateVal < DATEADD(MINUTE, -1,@DateTo)
    SELECT DATEDIFF(minute, MIN(CTE.DateVal), MAX(CTE.DateVal))
    FROM CTE
    WHERE (CAST(CTE.DateVal AS time) > @WTFrom AND CAST(CTE.DateVal AS time) < @WTTo) AND DATEPART(dw, CTE.DateVal) NOT IN (1, 7) AND NOT EXISTS (SELECT * FROM Holiday AS H WHERE H.holiday = CTE.DateVal)
    OPTION (MAXRECURSION 0);
    END;
    END
    Thanks for your help.

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules (you do not). Temporal
    data should use ISO-8601 formats (you do not!). Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. 
    We hate functions in SQL. This is a declarative language and you are using it like 1950's FORTRAN. We hate local variables (more FORTRAN!)
     The name of a function has to be either a known, common name, like “sine”, “cosine” etc. Or it is “<verb>_<object>”; you think a noun is a verb! Do you really need BIGINT? Why did you invite garbage data with it? Why do you think that SQL
    uses AM/PM? Have you never seen the TIME data type? 
    Think about “date_val” as a data element name. A date is a unit of temporal measurement on a calendar scale. This would be a “<something>_date” in a valid schema. 
    >> Is there a way to get this to work as a function? <<
    Probably, but why do it wrong?
    Build a calendar table with one column for the calendar data and other columns to show whatever your business needs in the way of temporal information. Do not try to calculate holidays in SQL -- Easter alone requires too much math.
    The julian_business_nbr is how SQL people do this. Here is the skeleton. 
    CREATE TABLE Calendar
    (cal_date DATE NOT NULL PRIMARY KEY, 
     julian_business_nbr INTEGER NOT NULL, 
    Here is how it works:
    INSERT INTO Calendar 
    VALUES ('2007-04-05', 42), 
     ('2007-04-06', 43), -- Good Friday 
     ('2007-04-07', 43), 
     ('2007-04-08', 43), -- Easter Sunday 
     ('2007-04-09', 44), 
     ('2007-04-10', 45); --Tuesday
    To compute the business days from Thursday of this sample week to next Tuesday:
    SELECT (C2.julian_business_nbr - C1.julian_business_nbr)
      FROM Calendar AS C1, Calendar AS C2
     WHERE C1.cal_date = '2007-04-05',
       AND C2.cal_date = '2007-04-10'; 
    See how simple it can be when you stop trying to write FORTRAN and think in sets? 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Problems with Custom Data Types when converting from TS 1.0 to 3.0.

    I am currently involved in the process of converting a test environment from TestStand 1.0, LabVIEW 5.1, and Windows NT to TestStand 3.0, LabVIEW 7.0, and Windows XP. We use a custom Operator Interface developed in LV. Based on the entered Model and Serial number, the appropriate Test Sequence is called. We also use a custom Process Model. The steps in the Test Sequence are either LV code modules or DLLs created in C++. We have LV SubVIs and C++ API functions that allow the developers of the test steps to add data to various Custom Data Types. For example, a developer may set up a test to add a note (Step.Result.Notes[x].String) when the test fails. Step.Result.Notes is a container for an array of strings. The attempt to set a note first attempts to use SetDimensions to redimension the array, then SetValString to set the value. These notes are added to the report. On the old system, everything worked fine. A note could be added to any result. On the new system, if a note is added to say the 5th result, but results 1-4 do not have a note, the test sequence ends and the Operator Interface returns to waiting for data entry (as if no test ever happened). No report is generated. The LabVIEW libraries have been modified to solve this problem by calling SetDimensions to incrementally increase the array size by one, and populating the unused TestStand array elements with an empty array of LabVIEW strings using the SetValString call . In other words, based on the previous example, if the user wants to set a note for the 5th result, the notes for results 1-4 must first be sent an empty array of strings. The report will only display the note for Result 5 (as desired). In addition to this being cumbersome, attempting to implement the same workaround in the C++ API has been unsuccessful because even though the note arrays for unwanted notes (1-4) is initialized with nothing, it is still displayed as a note (empty) on the report. If anybody knows what is wrong and what the solution is, it will be appreciated.

    Aaron,
    Thanks for your reply. I will attempt to clarify. I am working with a single step. The step calls a DLL. The DLL performs many 'checks' on the UUT (e.g. Model Number Check, Serial Number Check, Calibration Constants Check, etc.). Under the Type Palette - MyTypes.ini, we have a Step Type called TEST_DLL with a container in it called Results. In the Results container are a number of things, but I will only list the important ones:
    Notes (Array of Type 'Notes'; Type 'Notes' is a Custom Data Type (container, Type Definition)containing an array of strings called 'String')
    -Notes are generally set when on of the checks fails, otherwise no Note is set for the check.
    Val (Array of Type 'Val'; Type 'Val' is Custom Data Type (container, Type Definition) containing a Boolean called 'Boolean')
    -Val indicates whether the check passed of failed
    Pseudocode example:
    //Model Number Check
    check# = 0;
    resultBOOL = ModelNumberCheck();
    SetDimensions("Step.Result.Val", 0, "[0]", check#);
    SetValBoolean("Step.Result.Val[check#].Boolean", 0, resultBOOL);
    if(resultBOOL == FAIL)
    Note# = 0;
    SetDimensions("Step.Result.Notes", 0, "[0]", check#);
    SetDimensions(Step.Result.Notes[check#].String, 0, "[0]", Note#);
    SetValString("Step.Result.Notes[check#].String[Note#]", 0, "Model Number Check failed");
    Note# = 1;
    SetDimensions(Step.Result.Notes[check#].String, 0, "[0]", Note#);
    SetValString("Step.Result.Notes[check#].String[Note#]", 0, "Model Number = 1234");
    //Serial Number Check
    check# = 1;
    resultBOOL = SerialNumberCheck();
    SetDimensions("Step.Result.Val", 0, "[0]", check#);
    SetValBoolean("Step.Result.Val[check#].Boolean", 0, resultBOOL);
    if(resultBOOL == FAIL)
    Note# = 0;
    SetDimensions("Step.Result.Notes", 0, "[0]", check#);
    SetDimensions(Step.Result.Notes[check#].String, 0, "[0]", Note#);
    SetValString("Step.Result.Notes[check#].String[Note#]", 0, "Serial Number does not match expected");
    More Checks
    As you can see above, the "Step.Result.Val" array is redimensioned for every check. The "Step.Result.Notes" array is only redimensioned when a note needs to be added for a failing check. If the entire step executes and no check adds a note, the sequence is fine. If every check fails and therefore every check adds a note, the sequence is fine. However, if there are any gaps (e.g. check 0 adds a note, check 1 does not add a note, and check 2 tries to add a note), the sequence will stop. If I add blank notes for every check that would otherwise not have a note, the sequence completes, but the report shows the blank note.
    Also, the exact code that is causing these problems runs fine on our old systems (TestStand 1.0). I hope that I clarified the problem and thanks again for the help.

  • How to keep Date created and Date modified when converting nef to dng

    Hi
    I noticed that when we convert NEF files to DNG in it properties the Date Created and Date Modifed are changed to the present date and not the original dates of the files in question. Is there any way to make such a conversion without changing these proeprties? Yes, I know 'Date taken' does not change--but this info does not show up when you hover a file only the info in its properties does hence me asking the question.
    Also am I correct in assuming that this conversion is 100% lossless, nothing but nothing is lost in the qualtiy and info of the file (besides the file size)? Thank you
    OS: Windows 7 (64)

    A DNG from an NEF is a new file so it’s Windows dates are as of its creation on Windows.  The date modified would further change if you updated the DNG with a new preview and/or embedded metadata into it. 
    If you need the files to have the camera’s creation date, then use Windows Explorer to copy them, don’t convert to DNG, and just Add them to your LR catalog, and tell LR not to add a timezone or otherwise adjust the timestamps which might also update the file modification time.

  • Mediator - convert XSD datetime to SQL date value

    Fusion 11g, JDev 11.1.1, W server 2008
    Hi there,
    using JDev we've defined a DB adapter (towards an ORACLE schema), which basically serves two operations: INSERT and SELECT. On the DB table we've got a DATE_TIME while on on the other side we've defined a wsdl where the INPUT operation takes as parameter an XSD DATETIME value.
    The values have different structures and so we've started to play with the "Assign Values" function on the Mediator component, unfortunately without any success.
    Right now our expression is the following
    from
    ora:formatDate($in.newEventParam/newEventParam/ns:executionTime,"dd-MMM-yy")
    to
    $out.LogCollection/top:LogCollection/top:Log/top:when
    As first question I would like to ask you if our approach is correct and in that case what's wrong with our expression as we tried to use the same pattern as we use in SQL.
    Second, we performed some tests using the EM console. On test failure it shown a stack trace saying only that there was a problem performing a transformation. That's a bit too less, especially when transformation is done on large amount of values. Is there any way to increase trace level and get further details on which transformation didn't work out?
    Thanks in advance
    Alessandro Ilardo

    Thanks Eric for the link. That helped me to get further details about the issue but unfortunately not enough to locate the cause.
    So here I definitely have an issue with the composite application and perhaps another one on getting a SOAP trace from the Mediator log. Even with the finest log level enabled I couldn't see what the Mediator receives from outside.
    The first problem instead, seams to be a missing SOAP parameter, I assume that's why on the log I see this
    [WEBSERVICE.name: AuditService] [J2EE_APP.name: soa-infra] [composite_instance_id: 40011] Transformation failed[[
    oracle.tip.mediator.infra.exception.MediatorException: ORAMED-01203:[No Part]No part exist with name "newEventParam" in source message.Possible Fix:Review the transformation definition in mplan.Contact Oracle Support if the error cannot be fixed.
         at oracle.tip.mediator.service.transformation.XSLTransformer.getPartDocument(XSLTransformer.java:221)
    [J2EE_APP.name: soa-infra] [composite_instance_id: 40011] Got an exception: java.lang.NullPointerException[[
    oracle.tip.mediator.infra.exception.MediatorException: ORAMED-01201:[Error in transform operation]Error occurred while transforming payload.Possible Fix:Review the XSL or source payload. Either the XSL defined does not match with the payload or payload is invalid.
    In this routing there are basically 2 things that take place, an XSL mapping and an Assign value expression.
    Everything is goes fine until we perform a test from the EM, there we get the error.
    Unless someone has further tips on this issue I am considering to make a call from SOAPUI and place WS Monitor in the middle to make sure if the mistake is in the application or platform.
    External WSDL
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://xml.virtual-lab.eu/schema/poc-soa/audit/wsdl" xmlns:ns="http://xml.virtual-lab.eu/schema/poc-soa/audit/def" targetNamespace="http://xml.virtual-lab.eu/schema/poc-soa/audit/wsdl">
         <wsdl:types>
              <schema xmlns="http://www.w3.org/2001/XMLSchema">
                   <import namespace="http://xml.virtual-lab.eu/schema/poc-soa/audit/def" schemaLocation="xsd/AuditParamsDef.xsd"/>
              </schema>
         </wsdl:types>
         <wsdl:message name="addNewRequestMessage">
              <wsdl:part name="newEventParam" type="ns:add"/>
         </wsdl:message>
         <wsdl:message name="searchRequestMessage">
              <wsdl:part name="searchParams" type="ns:search"/>
         </wsdl:message>
         <wsdl:message name="searchResponseMessage">
              <wsdl:part name="returnParam" type="ns:eventObj"/>
         </wsdl:message>
         <wsdl:portType name="AuditPortType">
              <wsdl:operation name="addNewEvent">
                   <wsdl:input message="tns:addNewRequestMessage"/>
              </wsdl:operation>
              <wsdl:operation name="searchForEvents">
                   <wsdl:input message="tns:searchRequestMessage"/>
                   <wsdl:output message="tns:searchResponseMessage"/>
              </wsdl:operation>
         </wsdl:portType>
         <wsdl:binding name="AuditBinding" type="tns:AuditPortType">
              <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
              <wsdl:operation name="addNewEvent">
                   <soap:operation soapAction="urn:#addNewEvent"/>
                   <wsdl:input>
                        <soap:body use="literal"/>
                   </wsdl:input>
              </wsdl:operation>
              <wsdl:operation name="searchForEvents">
                   <soap:operation soapAction="urn:#searchForEvents"/>
                   <wsdl:input>
                        <soap:body use="literal"/>
                   </wsdl:input>
                   <wsdl:output>
                        <soap:body use="literal"/>
                   </wsdl:output>
              </wsdl:operation>
         </wsdl:binding>
         <!--
         <wsdl:service name="AuditService">
              <wsdl:port name="AuditPort" binding="tns:AuditBinding" />
         </wsdl:service>
    -->
    </wsdl:definitions>
    XSL
    <?xml version="1.0" encoding="UTF-8" ?>
    <?oracle-xsl-mapper
    <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
    <mapSources>
    <source type="WSDL">
    <schema location="../AuditService.wsdl"/>
    <rootElement name="newEventParam" namespace=""/>
    <rootElementDatatype name="add" namespace="http://xml.virtual-lab.eu/schema/poc-soa/audit/def"/>
    </source>
    </mapSources>
    <mapTargets>
    <target type="WSDL">
    <schema location="../AuditBackEndService.wsdl"/>
    <rootElement name="LogCollection" namespace="http://xmlns.oracle.com/pcbpel/adapter/db/top/AuditBackEndService"/>
    </target>
    </mapTargets>
    <!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.0.0(build 090618.1440.5219) AT [WED DEC 02 22:51:43 CET 2009]. -->
    ?>
    <xsl:stylesheet version="1.0"
    xmlns:top="http://xmlns.oracle.com/pcbpel/adapter/db/top/AuditBackEndService"
    xmlns:xpath20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.MediatorExtnFunction"
    xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue"
    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
    xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/db/SOA-POC/AuditService/AuditBackEndService%2F"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:med="http://schemas.oracle.com/mediator/xpath"
    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
    xmlns:ns="http://xml.virtual-lab.eu/schema/poc-soa/audit/def"
    xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk"
    xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
    xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.adapter.socket.ProtocolTranslator"
    exclude-result-prefixes="xsi xsl ns xsd top tns plt wsdl xpath20 bpws mhdr oraext dvm hwf med ids xdk xref ora socket">
    <xsl:template match="/">
    <top:LogCollection>
    <top:Log>
    <top:who>
    <xsl:value-of select="/newEventParam/ns:fromUser"/>
    </top:who>
    <top:when/>
    <top:whichClient>
    <xsl:value-of select="/newEventParam/ns:usingClient"/>
    </top:whichClient>
    <top:whichSys>
    <xsl:value-of select="/newEventParam/ns:onSys/@ns:which"/>
    </top:whichSys>
    <top:ipClient>
    <xsl:value-of select="/newEventParam/ns:fromIP"/>
    </top:ipClient>
    <top:wsOperation>
    <xsl:value-of select="/newEventParam/ns:callingWS_Operation"/>
    </top:wsOperation>
    </top:Log>
    </top:LogCollection>
    </xsl:template>
    </xsl:stylesheet>
    Internal WSDL
    <?xml version="1.0" encoding="UTF-8"?>
    <toplink:object-persistence version="Oracle TopLink - 11g Release 1 (11.1.1.1.0) (Build 090527)" xmlns:opm="http://xmlns.oracle.com/ias/xsds/opm" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:toplink="http://xmlns.oracle.com/ias/xsds/toplink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <opm:name>AuditBackEndService-OR</opm:name>
    <opm:class-mapping-descriptors>
    <opm:class-mapping-descriptor xsi:type="toplink:object-relational-class-mapping-descriptor">
    <opm:class>AuditBackEndService.Log</opm:class>
    <opm:alias>LOG</opm:alias>
    <opm:primary-key>
    <opm:field table="LOG" name="ID" xsi:type="opm:column"/>
    </opm:primary-key>
    <opm:events xsi:type="toplink:event-policy"/>
    <opm:querying xsi:type="toplink:query-policy">
    <opm:queries>
    <opm:query name="AuditBackEndServiceSelect" xsi:type="toplink:read-all-query">
    <opm:criteria operator="and" xsi:type="toplink:logic-expression">
    <toplink:left operator="and" xsi:type="toplink:logic-expression">
    <toplink:left operator="equal" xsi:type="toplink:relation-expression">
    <toplink:left name="whichSys" xsi:type="toplink:query-key-expression">
    <toplink:base xsi:type="toplink:base-expression"/>
    </toplink:left>
    <toplink:right xsi:type="toplink:parameter-expression">
    <toplink:parameter name="sys" xsi:type="opm:column"/>
    </toplink:right>
    </toplink:left>
    <toplink:right operator="greaterThanEqual" xsi:type="toplink:relation-expression">
    <toplink:left name="when" xsi:type="toplink:query-key-expression">
    <toplink:base xsi:type="toplink:base-expression"/>
    </toplink:left>
    <toplink:right xsi:type="toplink:parameter-expression">
    <toplink:parameter name="fromWhen" xsi:type="opm:column"/>
    </toplink:right>
    </toplink:right>
    </toplink:left>
    <toplink:right operator="lessThanEqual" xsi:type="toplink:relation-expression">
    <toplink:left name="when" xsi:type="toplink:query-key-expression">
    <toplink:base xsi:type="toplink:base-expression"/>
    </toplink:left>
    <toplink:right xsi:type="toplink:parameter-expression">
    <toplink:parameter name="toWhen" xsi:type="opm:column"/>
    </toplink:right>
    </toplink:right>
    </opm:criteria>
    <opm:arguments>
    <opm:argument name="sys">
    <opm:type>java.lang.String</opm:type>
    </opm:argument>
    <opm:argument name="fromWhen">
    <opm:type>java.lang.String</opm:type>
    </opm:argument>
    <opm:argument name="toWhen">
    <opm:type>java.lang.String</opm:type>
    </opm:argument>
    </opm:arguments>
    <toplink:reference-class>AuditBackEndService.Log</toplink:reference-class>
    <toplink:container xsi:type="toplink:list-container-policy">
    <toplink:collection-type>java.util.Vector</toplink:collection-type>
    </toplink:container>
    </opm:query>
    </opm:queries>
    </opm:querying>
    <opm:attribute-mappings>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>id</opm:attribute-name>
    <opm:field table="LOG" name="ID" xsi:type="opm:column"/>
    <toplink:attribute-classification>java.math.BigDecimal</toplink:attribute-classification>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>who</opm:attribute-name>
    <opm:field table="LOG" name="WHO" xsi:type="opm:column"/>
    <toplink:attribute-classification>java.lang.String</toplink:attribute-classification>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>when</opm:attribute-name>
    <opm:field table="LOG" name="WHEN" xsi:type="opm:column"/>
    <toplink:attribute-classification>java.sql.Timestamp</toplink:attribute-classification>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>whichClient</opm:attribute-name>
    <opm:field table="LOG" name="WHICH_CLIENT" xsi:type="opm:column"/>
    <toplink:attribute-classification>java.lang.String</toplink:attribute-classification>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>whichSys</opm:attribute-name>
    <opm:field table="LOG" name="WHICH_SYS" xsi:type="opm:column"/>
    <toplink:attribute-classification>java.lang.String</toplink:attribute-classification>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>ipClient</opm:attribute-name>
    <opm:field table="LOG" name="IP_CLIENT" xsi:type="opm:column"/>
    <toplink:attribute-classification>java.lang.String</toplink:attribute-classification>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>wsOperation</opm:attribute-name>
    <opm:field table="LOG" name="WS_OPERATION" xsi:type="opm:column"/>
    <toplink:attribute-classification>java.lang.String</toplink:attribute-classification>
    </opm:attribute-mapping>
    </opm:attribute-mappings>
    <toplink:descriptor-type>independent</toplink:descriptor-type>
    <toplink:caching>
    <toplink:cache-type>weak-reference</toplink:cache-type>
    <toplink:always-refresh>true</toplink:always-refresh>
    </toplink:caching>
    <toplink:remote-caching>
    <toplink:cache-type>weak-reference</toplink:cache-type>
    </toplink:remote-caching>
    <toplink:instantiation/>
    <toplink:copying xsi:type="toplink:instantiation-copy-policy"/>
    <toplink:tables>
    <toplink:table name="LOG"/>
    </toplink:tables>
    <toplink:structure>structureName</toplink:structure>
    </opm:class-mapping-descriptor>
    </opm:class-mapping-descriptors>
    <toplink:login xsi:type="toplink:database-login">
    <toplink:platform-class>oracle.toplink.platform.database.oracle.Oracle9Platform</toplink:platform-class>
    <toplink:user-name></toplink:user-name>
    <toplink:connection-url>null</toplink:connection-url>
    </toplink:login>
    </toplink:object-persistence>

  • Numbers entered data dissapears when spreadsheet opened at a latter date

    data entries entered into the spread sheet dissapear.
    We have a spreadsheet setup with formulas to manage our cash flow. When we update it. Close it and come back the next day yesterday's entries have dissapeared
    any thoughts as to why

    Update.  We feel the source of the problem is from the iCloud Windows App on my computer. We do not use the computer on a daily bases. When we shut it down it holds the current spreadsheet update. When we reboot the computer it updates iCloud with the spreadsheet and eliminates any changes made to it From our iPads.
    Interesting.  So maybe iCloud for Windows is overwriting other changes.  That sounds plausible.  If it turns out that was indeed the problem, hope you will have time to stop by and leave a brief note.
    SG

Maybe you are looking for

  • Why does Thunderbird not work with Windows 8.1

    I have used thunderbird now for about 6 years, for all my website accounts. During that time I have had very few problems, about 9 months ago I started using Windows 8, I transferred all my accounts from my old machines running on XP pro to new machi

  • Using the Document Manager Rich Text Editor

    I'm wondering whether there is a reasonable way we can use the Rich Text Editor (based on CKEditor) that is contained within the Document Manager task flow (primarily for editing Wiki pages) outside of the Document Manager itself? We have another typ

  • Image in a DataGrid

    Hello, I want to introduce a image in one datagrid column but I don't know why. I'm trying doing that: private var columns:ArrayCollection = new ArrayCollection([                             {headerText: 'Image', dataField: 'column1', itemRenderer:'x

  • I get an ' unknown error 4200' when I try to make a cd from a purchased audiobook.

    I get an 'unknown error 4200' whe I try to make a cd from a purchased and downloaded audiobook.

  • Adobe download and install issue

    I was able to download and install Flash without any issues.  When I try to download and install Reader I lose connection, then tries to reconnect then tells me to cancel.  This happens on XI, X and others versions.  I am using windows 7 professional