ViewCriteria error with Timestamp

I'm trying to use viewCriteria with a timestamp. But I'm getting some query errors.
I've done some tests.
1 - Entity attribute is oracle.jbo.domain.Date.
I create the date with the following code:
oracle.jbo.domain.Date d = new oracle.jbo.domain.Date(new java.sql.Timestamp(new java.util.Date().getTime()));
The code for the view criteria:
ViewCriteria vc = this.createViewCriteria();
ViewCriteriaRow vcr = vc.createViewCriteriaRow();
vcr.setAttribute("Hiredate", date created);
vc.addElement(vcr);
this.applyViewCriteria(vc);
this.executeQuery();
Here is the error:
oracle.jbo.SQLStmtException: JBO-27122: SELECT Emp.EMPNO,
Emp.ENAME,
Emp.JOB,
Emp.MGR,
Emp.HIREDATE,
Emp.SAL,
Emp.COMM,
Emp.DEPTNO
FROM EMP Emp
WHERE (((Emp.HIREDATE = TO_DATE('2006-11-28 13:09:54.0', 'yyyy-mm-dd'))))
The query is correct, using to_date function. But there is not a time mask.
2 - Entity Attribute is oracle.jbo.domain.Timestamp
I create the timestamp with the following code:
oracle.jbo.domain.Timestamp d = new oracle.jbo.domain.Timestamp(new java.sql.Timestamp(new java.util.Date().getTime()));
the code for the viewcriteria is the same as in test 1, except that I pass the timestamp object instead of the date to the setAttribute mehtod.
Here is the error:
oracle.jbo.SQLStmtException: JBO-27122: SELECT Emp.EMPNO,
Emp.ENAME,
Emp.JOB,
Emp.MGR,
Emp.HIREDATE,
Emp.SAL,
Emp.COMM,
Emp.DEPTNO
FROM EMP Emp
WHERE (((Emp.HIREDATE = '2006-11-28 13:13:25.019')))
Now the query was constructed with out the to_date function.
How can I use ViewCriteria with a Timestamp ?
Thanks a lot.
John

You should be able to workaround this issue using a customized OracleSQLBuilderImpl class patterned after the following:
package example;
import oracle.jbo.AttributeDef;
import oracle.jbo.ViewCriteria;
import oracle.jbo.ViewObject;
import oracle.jbo.common.Diagnostic;
import oracle.jbo.domain.Timestamp;
import oracle.jbo.server.OracleSQLBuilderImpl;
import oracle.jbo.server.SQLBuilder;
public class CustomOracleSQLBuilderImpl extends OracleSQLBuilderImpl {
    protected String getFormattedRHSCompareFragment(ViewObject vo,
                                                    ViewCriteria vc,
                                                    AttributeDef attrDef,
                                                    int sqlType, String rhs) {
        if (Timestamp.class.equals(attrDef.getJavaType())) {
            return new StringBuffer("TO_DATE('")
                        .append(rhs)
                        .append("', 'yyyy-mm-dd')")
                        .toString();
        else {
          return super.getFormattedRHSCompareFragment(vo, vc, attrDef, sqlType,
                                                    rhs);
    private static SQLBuilder mSQLBuilderInterface;
    synchronized public static SQLBuilder getInterface()
       if (mSQLBuilderInterface == null)
          if (Diagnostic.isOn())
             Diagnostic.println("CustomOracleSQLBuilder reached getInterface");
          mSQLBuilderInterface = (SQLBuilder)(new CustomOracleSQLBuilderImpl());
          if (Diagnostic.isOn())
             Diagnostic.println(mSQLBuilderInterface.getVersion());
       return mSQLBuilderInterface;
}To use a custom SQLBuilder class, you'll need to set the jbo.SQLBuilder property to the fully-qualified name of your custom SQLBuilder class. For example, to use the above class, the value would be example.CustomOracleSQLBuilderImpl
And, of course, the special-case code for the Timestamp attribute would need to be more sophisticated to handle possibly-different forms of querying for a timestamp with varying amounts of time information.

Similar Messages

  • Internal error with timestamp columns

    Hi
    i have a table in which there's a TIMESTAMP column whenever i try to create a form on this table i cannot choose the columns in form builder data block wizard.
    Or even when i try to modify a form which was created before the columns were added.
    it generates this error.
    FRM - 10095: Assertion Failed in iewbdbc_oracle_to_id, at C:myade\608\src\ie\iewbdb.c:703
    i dont even have that directory on my machine!!!!
    i tried this with forms9i & forms6i, same thing with both.
    is it impossible to develope forms on a table having a timestamp column??? or is there another way?
    Any help is REALLY apreciated.
    Thanks in Advance
    Regards
    Tony G.

    No the with timestamp types are not supported. Forms does supplort multiple timezones, but uses normal datatime fields mapping to dates in the DB. The Forms server then takes care of mapping the Client Time to the Database time and visa versa.
    See: http://www.oracle.com/technology/products/forms/pdf/9inewfeatures.pdf
    Section 10

  • Problem with timestamp in query

    I have problem with timestamp in JPA query.
    I wonna select all data from database where difference between two timestamps is more than 3 month.
    Database:
    ID timestamp1 timestamp2
    1 20008-11-19 15:02000 20008-08-19 15:02000
    2 20008-11-19 15:02000 20008-11-14 15:02000
    @Column(name = "timestamp1", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    public Date timestamp1;
    @Column(name = "timestamp2", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    public Date timestamp2;
    sql query works:
    select id from table where
    MONTH( DATE(timestamp1) - DATE(timestamp2) ) > 3
    but how I can write in Java?
    I't doesnt wrk:
    Query query = em.createQuery("SELECT f.id FROM Foo f WHERE MONTH( DATE(f.timestamp1) - DATE(f.timestamp2) ) > 3 ")
    error:
    ExceptionUtil E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method .
    Exception data: <openjpa-1.0.2-r420667:627158 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: An error occurred while parsing the query filter 'SELECT f.id FROM Foo f WHERE MONTH( DATE(f.timestamp1) - DATE(f.timestamp2) ) > 3'.
    Error message: <openjpa-1.0.2-r420667:627158 nonfatal user error> org.apache.openjpa.kernel.jpql.ParseException: Encountered "MONTH (" at character 438, but expected: ["(", "+", "-", ".", ":", "", "=", "?", "ABS", "ALL", "AND", "ANY", "AS", "ASC", "AVG", "BETWEEN", "BOTH", "BY", "CONCAT", "COUNT", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "DELETE", "DESC", "DISTINCT", "EMPTY", "ESCAPE", "EXISTS", "FETCH", "FROM", "GROUP", "HAVING", "IN", "INNER", "IS", "JOIN", "LEADING", "LEFT", "LENGTH", "LIKE", "LOCATE", "LOWER", "MAX", "MEMBER", "MIN", "MOD", "NEW", "NOT", "NULL", "OBJECT", "OF", "OR", "ORDER", "OUTER", "SELECT", "SET", "SIZE", "SOME", "SQRT", "SUBSTRING", "SUM", "TRAILING", "TRIM", "UPDATE", "UPPER", "WHERE", <BOOLEAN_LITERAL>, <DECIMAL_LITERAL>, <IDENTIFIER>, <INTEGER_LITERAL>, <STRING_LITERAL>].
    at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.parse(JPQLExpressionBuilder.java:1665)
    at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.<init>(JPQLExpressionBuilder.java:1645)

    The error is indocating improper formatting of your JPQL string. MONTH is not understood. I would recommend using your SQL string in a createNativeQuery(...) call instead.
    Doug

  • Error with FMLE

    Hi, here is one error with:
    and error is:
    on Win7. Happen during the time of streaming.
    Here is some more information after click on Retry:
    Problem signature:
      Problem Event Name:    APPCRASH
      Application Name:    FlashMediaLiveEncoder.exe
      Application Version:    3.2.0.9932
      Application Timestamp:    4d00aabe
      Fault Module Name:    FlashMediaLiveEncoder.exe
      Fault Module Version:    3.2.0.9932
      Fault Module Timestamp:    4d00aabe
      Exception Code:    80000003
      Exception Offset:    00179491
      OS Version:    6.1.7601.2.1.0.256.1
      Locale ID:    1026
      Additional Information 1:    0a9e
      Additional Information 2:    0a9e372d3b4ad19135b953a78882e789
      Additional Information 3:    0a9e
      Additional Information 4:    0a9e372d3b4ad19135b953a78882e789
    Read our privacy statement online:
      http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
    If the online privacy statement is not available, please read our privacy statement offline:
      C:\Windows\system32\en-US\erofflps.txt

    Tue May 10 2011 12:05:03 : Failed with error 80004002:pFilterVideoMixingRenderer->QueryInterface(&pVMRFilterConfig .p())
    Is your directx up to date ? VMR has 2 versions, 7 and 9. VMR 7 is for directx7 and is legacy. VMR9 is the proper VMR to use. There might be a problem with your directx.
    Tue May 10 2011 12:05:04 : Audio Device Error. The selected audio device "MV Audio Pipe Source" doesn't allow setting volume intensity.
    MV Audio Pipe Source has an error in it with its input pin. It might not have IAMInputMixer
    1) get a copy of graphedit or similar graph building tool. Microsoft directshow sdk has graphedit
    2) add MV Audio pipe source into the graph. Check if it has an input pin. Check if the input pin is IAMInputMixer or not. Right click to view the properties if there is ,
    3) Hook the graph up to a renderer. DirectSound, windows audio, whatever to complete the graph.
    4) Run the graph.
    5) If you had properties earlier, try changing the volume whilst the graph is running. I suspect you dont have IAMInputMixer.

  • Passivation Error with 9.0.3 Release

    I am getting a passivation error with the new 9.0.3 Release Jdeveloper. I have a page-by-page iteration set up and am selecting out of a table that has 9000 rows in it. When I first query the table I do not have any problems, but when I go towards the end I start throwing passivation errors. I run the following chunk of code:
    DcAddressView dav = (DcAddressView)this.getDcAddressView1();
    dav.setWhereClause(whereClause);
    dav.setRangeSize(pageSize);
    dav.setRangeStart(startPos);
    Row[] rows = dav.getAllRowsInRange();
    where whereClause = "1 = 1 and source_ind = '9'"; pageSize = 20; startPos = 5900
    With the whereClause used there is 5948 records in the recordset. When I debug this section of code I throw an exception as I try to setRangeStart(5900) as follows:
    oracle.jbo.PCollException: JBO-28020: Passivation error on collection DcAddressView1, collection id 0, persistent id 1
         void oracle.jbo.PCollException.throwException(java.lang.Class, java.lang.String, java.lang.Object[], java.lang.Exception)
              PCollException.java:39
         boolean oracle.jbo.pcoll.PCollNode.passivateElem(oracle.jbo.pcoll.PCollPersistable, oracle.jbo.pcoll.PCollNode, oracle.jbo.pcoll.PCollection, long)
              PCollNode.java:589
         boolean oracle.jbo.pcoll.PCollNode.passivate()
              PCollNode.java:658
         boolean oracle.jbo.pcoll.PCollection.passivateLRULeafNode()
              PCollection.java:351
         void oracle.jbo.pcoll.PCollection.checkActiveLeafLimit()
              PCollection.java:404
         void oracle.jbo.pcoll.PCollection.nodeRecentlyUsed(oracle.jbo.pcoll.PCollNode)
              PCollection.java:252
         void oracle.jbo.pcoll.PCollNode.<init>(oracle.jbo.pcoll.PCollection, oracle.jbo.pcoll.PCollNode, boolean)
              PCollNode.java:74
         oracle.jbo.pcoll.PCollNode oracle.jbo.pcoll.PCollNode.checkForSplit()
              PCollNode.java:1554
         void oracle.jbo.pcoll.PCollNode.addObject(oracle.jbo.pcoll.PCollPersistable)
              PCollNode.java:1623
         void oracle.jbo.pcoll.PCollNode.addObject(oracle.jbo.pcoll.PCollPersistable)
              PCollNode.java:1611
         void oracle.jbo.pcoll.PCollection.addElement(oracle.jbo.pcoll.PCollPersistable)
              PCollection.java:753
         boolean oracle.jbo.server.QueryCollection.fetch(int)
              QueryCollection.java:1295
         java.lang.Object oracle.jbo.server.QueryCollection.get(int)
              QueryCollection.java:831
         oracle.jbo.Row oracle.jbo.server.ViewRowSetImpl.getRow(int)
              ViewRowSetImpl.java:2619
         int oracle.jbo.server.ViewRowSetIteratorImpl.scrollRange(int)
              ViewRowSetIteratorImpl.java:945
         int oracle.jbo.server.ViewRowSetIteratorImpl.setRangeStart(int)
              ViewRowSetIteratorImpl.java:2161
         int oracle.jbo.server.ViewRowSetImpl.setRangeStart(int)
              ViewRowSetImpl.java:1726
         int oracle.jbo.server.ViewObjectImpl.setRangeStart(int)
              ViewObjectImpl.java:4718
         org.act.dcact.PageList org.act.dcact.bc.AddressModuleImpl.getAddressList(int, int, java.lang.String)
              AddressModuleImpl.java:84
         org.apache.struts.action.ActionForward org.act.dcact.SearchAction.execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
              SearchAction.java:42
         org.apache.struts.action.ActionForward org.apache.struts.action.RequestProcessor.processActionPerform(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.struts.action.Action, org.apache.struts.action.ActionForm, org.apache.struts.action.ActionMapping)
              RequestProcessor.java:446
         void org.apache.struts.action.RequestProcessor.process(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
              RequestProcessor.java:266
         void org.apache.struts.action.ActionServlet.process(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
              ActionServlet.java:1292
         void org.apache.struts.action.ActionServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
              ActionServlet.java:492
         void javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
              HttpServlet.java:740
         void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
              HttpServlet.java:853
         void com.evermind.server.http.ServletRequestDispatcher.invoke(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
              ServletRequestDispatcher.java:721
         void com.evermind.server.http.ServletRequestDispatcher.forwardInternal(javax.servlet.ServletRequest, javax.servlet.http.HttpServletResponse)
              ServletRequestDispatcher.java:306
         boolean com.evermind.server.http.HttpRequestHandler.processRequest(com.evermind.server.ApplicationServerThread, com.evermind.server.http.EvermindHttpServletRequest, com.evermind.server.http.EvermindHttpServletResponse, java.io.InputStream, java.io.OutputStream, boolean)
              HttpRequestHandler.java:767
         void com.evermind.server.http.HttpRequestHandler.run(java.lang.Thread)
              HttpRequestHandler.java:259
         void com.evermind.server.http.HttpRequestHandler.run()
              HttpRequestHandler.java:106
         void EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run()
              PooledExecutor.java:803
         void java.lang.Thread.run()
              Thread.java:484
    ## Detail 0 ##
    java.lang.ClassCastException: java.sql.Date
         boolean oracle.jbo.pcoll.OraclePersistManager.holdTableName(java.lang.String, boolean)
              OraclePersistManager.java:1096
         void oracle.jbo.pcoll.PCollManager.resolveName()
              PCollManager.java:324
         void oracle.jbo.pcoll.OraclePersistManager.createControlTable()
              OraclePersistManager.java:268
         void oracle.jbo.pcoll.OraclePersistManager.createTable()
              OraclePersistManager.java:672
         void oracle.jbo.pcoll.OraclePersistManager.insert(long, long, int, oracle.jbo.pcoll.PCollKeyInfo[], byte[])
              OraclePersistManager.java:1538
         boolean oracle.jbo.pcoll.PCollNode.passivateElem(oracle.jbo.pcoll.PCollPersistable, oracle.jbo.pcoll.PCollNode, oracle.jbo.pcoll.PCollection, long)
              PCollNode.java:543
         boolean oracle.jbo.pcoll.PCollNode.passivate()
              PCollNode.java:658
         boolean oracle.jbo.pcoll.PCollection.passivateLRULeafNode()
              PCollection.java:351
         void oracle.jbo.pcoll.PCollection.checkActiveLeafLimit()
              PCollection.java:404
         void oracle.jbo.pcoll.PCollection.nodeRecentlyUsed(oracle.jbo.pcoll.PCollNode)
         PCollection.java:252
    void oracle.jbo.pcoll.PCollNode.<init>(oracle.jbo.pcoll.PCollection, oracle.jbo.pcoll.PCollNode, boolean)
              PCollNode.java:74
         oracle.jbo.pcoll.PCollNode oracle.jbo.pcoll.PCollNode.checkForSplit()
              PCollNode.java:1554
         void oracle.jbo.pcoll.PCollNode.addObject(oracle.jbo.pcoll.PCollPersistable)
         PCollNode.java:1623
         void oracle.jbo.pcoll.PCollNode.addObject(oracle.jbo.pcoll.PCollPersistable)
              PCollNode.java:1611
         void oracle.jbo.pcoll.PCollection.addElement(oracle.jbo.pcoll.PCollPersistable)
              PCollection.java:753
         boolean oracle.jbo.server.QueryCollection.fetch(int)
              QueryCollection.java:1295
         java.lang.Object oracle.jbo.server.QueryCollection.get(int)
              QueryCollection.java:831
         oracle.jbo.Row oracle.jbo.server.ViewRowSetImpl.getRow(int)
              ViewRowSetImpl.java:2619
         int oracle.jbo.server.ViewRowSetIteratorImpl.scrollRange(int)
              ViewRowSetIteratorImpl.java:945
         int oracle.jbo.server.ViewRowSetIteratorImpl.setRangeStart(int)
              ViewRowSetIteratorImpl.java:2161
         int oracle.jbo.server.ViewRowSetImpl.setRangeStart(int)
              ViewRowSetImpl.java:1726
         int oracle.jbo.server.ViewObjectImpl.setRangeStart(int)
              ViewObjectImpl.java:4718
         org.act.dcact.PageList org.act.dcact.bc.AddressModuleImpl.getAddressList(int, int, java.lang.String)
              AddressModuleImpl.java:84
         org.apache.struts.action.ActionForward org.act.dcact.SearchAction.execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
              SearchAction.java:42
         org.apache.struts.action.ActionForward org.apache.struts.action.RequestProcessor.processActionPerform(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.struts.action.Action, org.apache.struts.action.ActionForm, org.apache.struts.action.ActionMapping)
              RequestProcessor.java:446
         void org.apache.struts.action.RequestProcessor.process(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
              RequestProcessor.java:266
         void org.apache.struts.action.ActionServlet.process(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
              ActionServlet.java:1292
         void org.apache.struts.action.ActionServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
              ActionServlet.java:492
         void javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
              HttpServlet.java:740
         void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
              HttpServlet.java:853
         void com.evermind.server.http.ServletRequestDispatcher.invoke(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
              ServletRequestDispatcher.java:721
         void com.evermind.server.http.ServletRequestDispatcher.forwardInternal(javax.servlet.ServletRequest, javax.servlet.http.HttpServletResponse)
              ServletRequestDispatcher.java:306
         boolean com.evermind.server.http.HttpRequestHandler.processRequest(com.evermind.server.ApplicationServerThread, com.evermind.server.http.EvermindHttpServletRequest, com.evermind.server.http.EvermindHttpServletResponse, java.io.InputStream, java.io.OutputStream, boolean)
              HttpRequestHandler.java:767
         void com.evermind.server.http.HttpRequestHandler.run(java.lang.Thread)
              HttpRequestHandler.java:259
         void com.evermind.server.http.HttpRequestHandler.run()
              HttpRequestHandler.java:106
         void EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run()
              PooledExecutor.java:803
         void java.lang.Thread.run()
              Thread.java:484
    Any help would be appreciated. BTW-- I have repeatedly deleted all bc4j tables from my database.

    Eric,
    We're tracking this problem as Bug#2646690. Thanks for reporting it.
    The problem is related to a change in the JDBC driver when the oracle.jdbc.J2EE13Compliant Java system property is set to the value true. When this flag is set to true, JDBC returns a DATE column from the database as a java.sql.Date object. When the flag is not set or set to false, it returns the java.sql.Timestamp type that it has always returned before.
    The workaround until we are able to fix this on our side to work with either Timestamp or Date in our code, is to add the line:
    System.setProperty("oracle.jdbc.J2EE13Compliant","false");Into the constructor of your root application module's *Impl.java class.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Overloading a DATE function with TIMESTAMP to avoid "too many declarations"

    CREATE OR REPLACE PACKAGE util
    AS
      FUNCTION yn (bool IN BOOLEAN)
        RETURN CHAR;
      FUNCTION is_same(a varchar2, b varchar2)
        RETURN BOOLEAN;
      FUNCTION is_same(a date, b date)
        RETURN BOOLEAN;
      /* Oracle's documentation says that you cannot overload subprograms
       * that have the same type family for the arguments.  But,
       * apparently timestamp and date are in different type families,
       * even though Oracle's documentation says they are in the same one.
       * If we don't create a specific overloaded function for timestamp,
       * and for timestamp with time zone, we get "too many declarations
       * of is_same match" when we try to call is_same for timestamps.
      FUNCTION is_same(a timestamp, b timestamp)
        RETURN BOOLEAN;
      FUNCTION is_same(a timestamp with time zone, b timestamp with time zone)
        RETURN BOOLEAN;
      /* These two do indeed cause problems, although there are no errors when we compile the package.  Why no errors here? */
      FUNCTION is_same(a integer, b integer) return boolean;
      FUNCTION is_same(a real, b real) return boolean;
    END util;
    CREATE OR REPLACE PACKAGE BODY util
    AS
         NAME: yn
         PURPOSE: pass in a boolean, get back a Y or N
      FUNCTION yn (bool IN BOOLEAN)
        RETURN CHAR
      IS
      BEGIN
        IF bool
        THEN
          RETURN 'Y';
        END IF;
        RETURN 'N';
      END yn;
         NAME: is_same
         PURPOSE: pass in two values, get back a boolean indicating whether they are
                  the same.  Two nulls = true with this function.
      FUNCTION is_same(a in varchar2, b in varchar2)
        RETURN BOOLEAN
      IS
        bool boolean := false;
      BEGIN
        IF a IS NULL and b IS NULL THEN bool := true;
        -- explicitly set this to false if exactly one arg is null
        ELSIF a is NULL or b IS NULL then bool := false;
        ELSE bool := a = b;
        END IF;
        RETURN bool;
      END is_same;
      FUNCTION is_same(a in date, b in date)
        RETURN BOOLEAN
      IS
        bool boolean := false;
      BEGIN
        IF a IS NULL and b IS NULL THEN bool := true;
        -- explicitly set this to false if exactly one arg is null
        ELSIF a is NULL or b IS NULL then bool := false;
        ELSE bool := a = b;
        END IF;
        RETURN bool;
      END is_same;
      FUNCTION is_same(a in timestamp, b in timestamp)
        RETURN BOOLEAN
      IS
        bool boolean := false;
      BEGIN
        IF a IS NULL and b IS NULL THEN bool := true;
        -- explicitly set this to false if exactly one arg is null
        ELSIF a is NULL or b IS NULL then bool := false;
        ELSE bool := a = b;
        END IF;
        RETURN bool;
      END is_same;
      FUNCTION is_same(a in timestamp with time zone, b in timestamp with time zone)
        RETURN BOOLEAN
      IS
        bool boolean := false;
      BEGIN
        IF a IS NULL and b IS NULL THEN bool := true;
        -- explicitly set this to false if exactly one arg is null
        ELSIF a is NULL or b IS NULL then bool := false;
        ELSE bool := a = b;
        END IF;
        RETURN bool;
      END is_same;
      /* Don't bother to fully implement these two, as they'll just cause errors at run time anyway */
      FUNCTION is_same(a integer, b integer) return boolean is begin return false; end;
      FUNCTION is_same(a real, b real) return boolean is begin return false; end;
    END util;
    declare
    d1 date := timestamp '2011-02-15 13:14:15';
    d2 date;
    t timestamp := timestamp '2011-02-15 13:14:15';
    t2 timestamp;
    a varchar2(10);
    n real := 1;
    n2 real;
    begin
    dbms_output.put_line('dates');
    dbms_output.put_line(util.yn(util.is_same(d2,d2) ));
    dbms_output.put_line(util.yn(util.is_same(d1,d2) ));
    dbms_output.put_line('timestamps'); -- why don't these throw exception?
    dbms_output.put_line(util.yn(util.is_same(t2,t2) ));
    dbms_output.put_line(util.yn(util.is_same(t,t2) ));
    dbms_output.put_line('varchars');
    dbms_output.put_line(util.yn(util.is_same(a,a)));
    dbms_output.put_line(util.yn(util.is_same(a,'a')));
    dbms_output.put_line('numbers');
    -- dbms_output.put_line(util.yn(util.is_same(n,n2))); -- this would throw an exception
    end;
    /Originally, I had just the one function with VARCHAR2 arguments. This failed to work properly because when dates were passed in, the automatic conversion to VARCHAR2 was dropping the timestamp. So, I added a 2nd function with DATE arguments. Then I started getting "too many declarations of is_same exist" error when passing TIMESTAMPs. This made no sense to me, so even though Oracle's documentation says you cannot do it, I created a 3rd version of the function, to handle TIMESTAMPS explicitly. Surprisingly, it works fine. But then I noticed it didn't work with TIMESTAMP with TIME ZONEs. Hence, the fourth version of the function. Oracle's docs say that if your arguments are of the same type family, you cannot create an overloaded function, but as the example above shows, this is very wrong.
    Lastly, just for grins, I created the two number functions, one with NUMBER, the other with REAL, and even these are allowed - they compile. But then at run time, it fails. I'm really confused.
    Here is the apparently incorrect Oracle documentation on the matter: http://docs.oracle.com/cd/B12037_01/appdev.101/b10807/08_subs.htm (see overloading subprogram names), and here are the various types and their families: http://docs.oracle.com/cd/E11882_01/appdev.112/e17126/predefined.htm.
    Edited by: hotwater on Jan 9, 2013 3:38 PM
    Edited by: hotwater on Jan 9, 2013 3:46 PM

    >
    So, I added a 2nd function with DATE arguments. Then I started getting "too many declarations of is_same exist" error when passing TIMESTAMPs. This made no sense to me
    >
    That is because when you pass a TIMESTAMP Oracle cannot determine whether to implicitly convert it to VARCHAR2 and use your first function or implicitly convert it to DATE and use your second function. Hence the 'too many declarations' exist error.
    >
    , so even though Oracle's documentation says you cannot do it, I created a 3rd version of the function, to handle TIMESTAMPS explicitly. Surprisingly, it works fine. But then I noticed it didn't work with TIMESTAMP with TIME ZONEs.
    >
    Possibly because of another 'too many declarations' error? Because now there would be THREE possible implicit conversions that could be done.
    >
    Hence, the fourth version of the function. Oracle's docs say that if your arguments are of the same type family, you cannot create an overloaded function, but as the example above shows, this is very wrong.
    >
    I think the documentation, for the 'date' family, is wrong as you suggest. For INTEGER and REAL the issue is that those are ANSI data types and are really the same Oracle datatype; they are more like 'aliases' than different datatypes.
    See the SQL Language doc
    >
    ANSI, DB2, and SQL/DS Datatypes
    SQL statements that create tables and clusters can also use ANSI datatypes and datatypes from the IBM products SQL/DS and DB2. Oracle recognizes the ANSI or IBM datatype name that differs from the Oracle Database datatype name. It converts the datatype to the equivalent Oracle datatype, records the Oracle datatype as the name of the column datatype, and stores the column data in the Oracle datatype based on the conversions shown in the tables that follow.
    INTEGER
    INT
    SMALLINT
    NUMBER(38)
    FLOAT (Note b)
    DOUBLE PRECISION (Note c)
    REAL (Note d)
    FLOAT(126)
    FLOAT(126)
    FLOAT(63)

  • TFTP with timestamp

    Hi
    We got C2960 switch. May I know how to use kron autobackup by using TFTP with timestamp?
    Hugo

    How to change the timestamp format, I got error as follow?
    2960G#sh archive 
    The next archive file will be named tftp://192.168.1.1/2960G-Feb-24-10:33:34-cfg-1
     Archive #  Name
       0        
       1       :Error - Bad file number 
    Timestamp config:
    service timestamps debug datetime localtime
    service timestamps log datetime localtime

  • RE: [Adobe Reader] when i open pdf file it open all the pages but some pages give error massage (there was error processing a page,there was a problem reading this document 110) but if i open this page which give me error with google chrome it's work ? i

    HelloThank's for your helpsI hope this document is helpfulBest Regards,
    Date: Sun, 22 Jun 2014 17:10:17 -0700
    From: [email protected]
    To: [email protected]
    Subject:  when i open pdf file it open all the pages but some pages give error massage (there was error processing a page,there was a problem reading this document 110) but if i open this page which give me error with google chrome it's work ? if you can help me th
        when i open pdf file it open all the pages but some pages give error massage (there was error processing a page,there was a problem reading this document 110) but if i open this page which give me error with google chrome it's work ? if you can help m
        created by Anoop9178 in Adobe Reader - View the full discussion
    Hi,
    Would it be possible for you to share the document?
    Regards,
    Anoop
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at https://forums.adobe.com/message/6485431#6485431
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
         To unsubscribe from this thread, please visit the message page at . In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Adobe Reader by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

    thank's for reply and your help
    i did the step's that you told me but  i still have the same problem
                                     i have the latest v.11.0.7
    i
    i disable the protected mode

  • Odd Error with decode function in Order By Clause

    I am trying to compile a procedure and can't get around an error with a dynamic order by that doesn't make much sense to me. I can repoduce the error with a plain select statment in sql plus so I can rule out a declaration error. Here is an example with 2 numeric columns and a date column.
    select task_id, display_date, remark_id from task_list
    where task_id > 1000
    order by decode('Task_ID', 'Task_ID',Task_ID, 'Display_Date', Display_Date, 'Remark_ID',Remark_ID)
    returns the error:
    select task_id, display_date, remark_id from task_list
    ERROR at line 1:
    ORA-00932: inconsistent datatypes: expected NUMBER got DATE
    I'm not sure why this error is occuring, because it doesn't even hit the Display_Date field in the Decode statment. If I take the Display_date out of the statement, it runs properly. If I change Display_Date to To_Char(Display_Date) it also runs fine, but the sorting is incorrect. Also I'm running 9.2, and do not want to use dynamic sql to build my query. Any Ideas out there as to the cause of this error?

    I did find a workaround to this issue by breaking the decode statment into three separate statement, but I still think that the way it is written above should work, and may be a bug, or an error that I don't understand fully.
    The Order by was rewritten like this:
    order by decode(pSort, 'Task_ID',Task_ID), decode(pSort, 'Display_Date', Display_Date),
    decode(pSort, 'Remark_ID',Remark_ID);
    Thanks

  • XML Publisher Error with reports published in XML publisher

    Hi All,
    I am geting the following error with a report published using XML Publisher
    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    The system cannot locate the resource specified. Error processing resource 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.d...
    How can i Rectify this?

    Hi Ark,
    In order to generate a report using xml publisher. we need the following.
    1. XML Data
    2. Template file (RTF/PDF/..)
    XML data will not be created by the template file.
    We will be required to create XML data. One of the easiest way to create xml output is using the RDF. We can change the rdf output type in the concurrent program to XML.
    Once the xml and the template is available, "XML Report Publisher" will be able to generate the output in the required format.
    Thanks,
    K.Nataraja Suthan,

  • Graphic problems/errors with Mainstage 3 and MBP (15'' 2011)

    Hi,
    I bought Mainstage 3 for my MBP (15'' 2011).
    When i click con "perform" i get graphic errors.
    I have the same issue with the old Mainstage version since Mountain Lion.
    Also a fresh installation didn't help.
    I think i'm not the only one with this issue!
    I don't know how to report a bug?
    Perhaps someone can help me.
    (and  I'm probably not the only one (see feedback in Apple Store) If you also have this problem, please add a comment with your configuration (Hardware, Software))
    /forgotten ebi
    So, here an example how it looks like when i click on "perform":

    Same configuration,same problem. BUT I found a workaround.
    Mainstage has this error with the AMD video card and/or a second monitor connected.
    With a little app (http://gfx.io)  it's possible to really force the MBPro to use the Intel Graphics card.
    This will work only with the internal screen, not with a second screen connected.
    And sometimes you need to restart, to really make the Intel video card free.
    This works fine...In the meantime of a fix.

  • Error with an infoset in BI

    HI BI gurus,
    we have a problem with an infoset.
    We create an infoset in RSA1 linked to a cube and a DSO.
    We activate it in english without problems and I can create a query with no errors (with a english logon).
    If I try to create a query in italian language the query designer show mw this error: " unexpected error - RCF_SYSTEM_FAILURE. You must restart the query designer."
    Do you have any idea how to fix and solve this problem? We try to activete the infoset in Italian but the error remains.
    Thanks for any help.
    SB

    Hi,
    is italien installed as a language in your system?
    Siggi

  • I am trying to download my photos from my iphone to my mac-iphoto. It keeps trying but about halfway through it says there is an error with a photo therefore it wont download any of my pictures or videos.  It wont tell me which picture is the issue.

    I took a lot of pictures and video on my recent trip to Ireland.  Now I am trying to download the photos and videos from my iphone to my mac - iphoto.  I have tried 3 times and each time (at a different point) I get a message telling me that there was an error with one of my photos and it wont load the pictures.  Help!!

    Try using Image Capture to download to a folder on the Desktop.  If there's a damaged file on the iPhone that's preventing the download you can isolate it with Image Capture and then delete it from the iPhone.

  • Plug-in errors and dependency errors with a CAF app in DS in NW CE 7.1

    I am learining to build CAF apps in Developer Studio in NW CE 7.1.  Here are my steps and the errors I am getting:
    Open Developer Studio
    Switch to the CA perspective
    File->New->Project
    Choose Development Component under Development Infrastructure
    Press Next
    Choose Composite Application under sap.com
    Choose MyComponents[demo.sap.com] under 'Local Development'
    Vendor: demo.sap.com
    Name: carpool
    Caption: Car Pool
    Language: American English
    Domain: SAP-xApps
    Support Component: CAF-APP (typed in, not chosen)
    Press Finish
    The following error appears:
    Status ERROR
    Plugin : com.sap.ide.metamodel.core.services.eclipse
    code=0
    Internal error
       Plugin name: Metamodel Core
       Internal error  : com.sap.ide.metamodel.core.services.eclipse
       Class      : com.sap.ide.mmservices.core.eclipse.project.ArchiveVersionChecker
       Method     : computeIdeJarProperties
       Message    : C:\Program Files\SAP\IDE\CE\eclipse\E:\Program Files\SAP\IDE\CE\eclipse\plugins\com.sap.dictionary.services_10.0.0.070821165456\lib\com.sap.dictionary.services_api.jar (The filename, directory name, or volume label syntax is incorrect)
       Exception  : java.io.FileNotFoundException: C:\Program Files\SAP\IDE\CE\eclipse\E:\Program Files\SAP\IDE\CE\eclipse\plugins\com.sap.dictionary.services_10.0.0.070821165456\lib\com.sap.dictionary.services_api.jar (The filename, directory name, or volume label syntax is incorrect)
    java.io.FileNotFoundException: C:\Program Files\SAP\IDE\CE\eclipse\E:\Program Files\SAP\IDE\CE\eclipse\plugins\com.sap.dictionary.services_10.0.0.070821165456\lib\com.sap.dictionary.services_api.jar (The filename, directory name, or volume label syntax is incorrect)
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:203)
    at java.util.jar.JarFile.<init>(JarFile.java:132)
    at java.util.jar.JarFile.<init>(JarFile.java:70)
    at com.sap.ide.mmservices.core.eclipse.project.ArchiveVersionChecker.computeIdeJarProperties(ArchiveVersionChecker.java:296)
    at com.sap.ide.mmservices.core.eclipse.project.ArchiveVersionChecker.doFullCheck(ArchiveVersionChecker.java:214)
    at com.sap.ide.mmservices.core.eclipse.project.ArchiveVersionChecker.checkProject(ArchiveVersionChecker.java:125)
    at com.sap.ide.mmservices.core.eclipse.generation.GenerationServiceEclipse.checkArchiveVersions(GenerationServiceEclipse.java:110)
    at com.sap.dictionary.tools.generation.eclipse.GenerationBuilder.checkArchiveVersions(GenerationBuilder.java:335)
    at com.sap.dictionary.tools.generation.eclipse.GenerationBuilder.build(GenerationBuilder.java:85)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:624)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:166)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:197)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:246)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:249)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:302)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:334)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:137)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
    I do not think I missed anything installing NW CE 7.1, but this error makes me think that some plug-in was erroneously left out of the install. 
    Incidentally, I can continue onward and build an app (this is obviously a tutorial), but when I try to deploy I get the following error:
    The deployment of the archive failed with an exception!
    ([ERROR CODE DPL.DCAPI.1027]) DependenciesResolvingException.
    Reason:[ERROR CODE DPL.DC.3033] An unresolved dependencies error
    occurred while sorting the deployment batch items regarding the
    dependencies.;nested exception is:
    com.sap.engine.services.dc.cm.deploy.sdu_deps_resolver.UnresolvedDepen
    denciesException:[ERROR CODE DPL.DC.3437]Unresolved dependencies
    found for the following deployment items:
    1. Component: name:'carpool~ear',vendor:'my.company',location:
    'localDevelopment',version:'20080501110329',software type: 'J2EE',
    dependencies:'[name:'cafruntimeear',vendor:'sap.com',name:
    'cafcoreear',vendor:'sap.com']
    Unresolved dependency:
    name:'cafruntimeear',vendor:'sap.com'          (not found in the admitted
    batch items and the repository)
    Unresolved dependency:
    name:'cafcoreear',vendor:'sap.com'          (not found in the admitted
    batch items and the repository)
    Please check the error log for further informations.
    Again, this looks like I am missing some components.
    Any assistance is greatly appreciated.
    TB

    Further developments:  As you may note from the error message, DS is looking for com.sap.ide.metamodel.core.services.eclipse in both the C: and the E: drive at the same time.  In fact, this file exists in the E: drive subdirectory listed, so I obviously have an error with two drive designations being concatenated.  Does anyone know how I can change the lookup directory for this dependency (or any dependency)? 
    Thanks,
    TB

  • PeopleSoft XML Publisher report error with java.io.FileNotFoundException

    Hi,
    I have created two reports using XML Publisher in Peoplesoft Financials. The two reports are not related and they were submitted for processing separately. The first report completes without any issues. The second report results in error with the following message:
    09.11.17 ..(CIS_POTRPT.XML_FILE.Step03) (PeopleCode)
    [012309_091118154][oracle.apps.xdo.template.FOProcessor][EXCEPTION] IOException is occurred in FOProcessor.setData(String) with 'files/cis_potrpt.xml'.
    [012309_091118500][oracle.apps.xdo.template.FOProcessor][EXCEPTION] java.io.FileNotFoundException: files/cis_potrpt.xml (A file or directory in the path name does not exist.)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(FileInputStream.java(Compiled Code))
         at java.io.FileInputStream.<init>(FileInputStream.java:89)
         at oracle.apps.xdo.template.FOProcessor.getInputStream(FOProcessor.java:1316)
         at oracle.apps.xdo.template.FOProcessor.getXMLInput(FOProcessor.java:1100)
         at oracle.apps.xdo.template.FOProcessor.setData(FOProcessor.java:372)
         at com.peoplesoft.pt.xmlpublisher.PTFOProcessor.generateOutput(PTFOProcessor.java:53)
    2009-01-23-09.11.18.000418 AePcdExecutePeopleCode [174] Exception logged: RC=100.
    Error generating report output: (235,2309) PSXP_RPTDEFNMANAGER.ReportDefn.OnExecute Name:ProcessReport PCPC:51552 Statement:1153
    Called from:CIS_POTRPT.XML_FILE.GBL.default.1900-01-01.Step03.OnExecute Statement:8
    2009-01-23-09.11.18.000617 DoStepActions [1797] Exception logged: RC=100.
    Process 598607 ABENDED at Step CIS_POTRPT.XML_FILE.Step03 (PeopleCode) -- RC = 24 (108,524)
    In the process monitor detail > view log/trace page, the xml file is accessible so the file was generated to a valid directory.
    The weird thing is I was able to run this report without any issues few weeks ago although another user also ran into same error. The PeopleCode step that has been identified is essentially same in the two reports. I checked the app server and the directory does exist as well as the xml files for the two reports. The problem does not occur in test environment, just in production. Any help would be appreciated.

    We encounter the same problem. Did you get the answer for this issue? Thanks in advance.

Maybe you are looking for

  • Delete songs from ipod touch

    how do you delete songs from ipod touch if can help me that would be great.

  • Changes in BDC program to upload data from text/excel file

    Hi friends i have obtained the BDc program after recording : start-of-selection. perform open_group. perform bdc_dynpro      using 'SAPLCOIH' '0100'. perform bdc_field       using 'BDC_CURSOR'                               'CAUFVD-GSBER'. perform bdc

  • Can i associate more than one number to my iMessage account?

    I live in Canada at the moment and am from Seattle, and am wondering if there is a way to associate more than one phone number to iMessage?

  • Error in ECC 6.0 for DO VARYING command

    Hi , Data (all of type character) has been declared as below.OIn DO statement we get the error as "BHDGI-T1" and "BHDGI-HF" are type-incompatible data declared as below: DATA: BHDGI-HF(1)     TYPE C,       BHDGI-T1(70)    TYPE C,       BHDGI-T2(60)  

  • SRM and SRM-MDM: Error when ordering less than Price Base Quantity

    Hi! We face the following issue: We have an item without material master in the MDM-catalog. The price is scaled, and 5.00 EUR up to 100 items, and 4.80 EUR for more than 100 items If we order 90 items, the price is calculated to 5.00 EUR in MDM, BUT