Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    literal does not match format string - basetype for field declared type is Date

    Hi guys,

    Your help was precious on my previous posts, thanks again.

    I am trying to update an Oracle Date column from a listgridb that is using datasource ds.xml descriptor :

    Requesting the table with date columns works well, adding new data as well, but fetching/filtering on date column and removing rows doesn't work.

    The error I have is :

    Code:
    === 2017-01-05 14:25:47,713 [1-46] WARN  SQLWhereClause - [builtinApplication.exclude_position_remove] Unable to find simple basetype for field COMPUTE_DATE (declared type is Date)
    === 2017-01-05 14:25:47,721 [1-46] WARN  RequestContext - dsRequest.execute() failed:
    java.sql.SQLDataException: ORA-01861: literal does not match format string
    Code:
    ISC_Core.js:1158 *15:08:36.062:XRP6:WARN:RPCManager:ORA-01861: literal does not match format string
     - response: {operationId: "exclude_position_remove",
    clientContext: undef,
    internalClientContext: undef,
    context: Obj,
    transactionNum: 2,
    httpResponseCode: 200,
    httpResponseText: "//isc_RPCResponseStart-->[{affectedRows:..."[185],
    xmlHttpRequest: [object XMLHttpRequest],
    transport: "xmlHttpRequest",
    status: -1,
    clientOnly: undef,
    httpHeaders: Obj,
    isStructured: true,
    callbackArgs: null,
    results: Obj,
    affectedRows: 0,
    data: "ORA-01861: literal does not match format..."[48],
    invalidateCache: false,
    isDSResponse: true,
    queueStatus: -1}
    The ds.xml file is :

    Code:
     <[B]DataSource [/B][B]ID[/B][B]="exclude_position" [/B][B]tableName[/B][B]="exclude_position" [/B][B]serverType[/B][B]="sql"[/B]>
    <[B]fields[/B]>        
    <[B]field [/B][B]name[/B][B]="EXCLUDED_AT" [/B][B]type[/B][B]="Date" [/B][B]dateFormatter[/B][B]="toEuropeanShortDate" [/B][B]canEdit[/B][B]="true"[/B]/>        
    <[B]field [/B][B]name[/B][B]="ENV_ID" [/B][B]primaryKey[/B][B]="true" [/B][B]type[/B][B]="text" [/B][B]canEdit[/B][B]="true"[/B]/>        
    <[B]field [/B][B]name[/B][B]="CONFIG_ID" [/B][B]primaryKey[/B][B]="true" [/B][B]type[/B][B]="text" [/B][B]canEdit[/B][B]="true"[/B]/>        
    <[B]field [/B][B]name[/B][B]="COMPUTE_DATE" [/B][B]primaryKey[/B][B]="true" [/B][B]type[/B][B]="Date" [/B][B]dateFormatter[/B][B]="toEuropeanShortDatetime" [/B][B]canEdit[/B][B]="true"[/B]/>        
    <[B]field [/B][B]name[/B][B]="APPLICATION" [/B][B]primaryKey[/B][B]="true" [/B][B]type[/B][B]="text" [/B][B]canEdit[/B][B]="true"[/B]/>        
    <[B]field [/B][B]name[/B][B]="USERNAME" [/B][B]type[/B][B]="text" [/B][B]canEdit[/B][B]="true"[/B]/>        
    <[B]field [/B][B]name[/B][B]="POSITION" [/B][B]primaryKey[/B][B]="true" [/B][B]type[/B][B]="text" [/B][B]canEdit[/B][B]="true"[/B]/>        
    <[B]field [/B][B]name[/B][B]="NODE_NAME" [/B][B]type[/B][B]="text" [/B][B]canEdit[/B][B]="true"[/B]/>        
    <[B]field [/B][B]name[/B][B]="DESCRIPTION" [/B][B]type[/B][B]="text" [/B][B]canEdit[/B][B]="true"[/B]/>    
    </[B]fields[/B]>
    </[B]DataSource[/B]>
    The date format in the database is :

    Code:
    "COMPUTE_DATE" DATE,
    Am I missing something ?

    What is the best way to deal with dates ?

    thank you !

    Click image for larger version

Name:	2017-01-05_151613.png
Views:	168
Size:	24.8 KB
ID:	242097

    #2
    Hi Amben,

    the correct "date"-datatype is "date", not "Date", see these docs.

    Best regards
    Blama

    Comment


      #3
      it worked, thank you so much.

      It is surprising how it showed the date filters in the listgrid when I used Date instead of date... I thought it was correct

      thanks again ! great

      Comment


        #4
        Hi,

        glad it is working now.
        I suppose the display-effect you were seeing is related to your dateFormatter="toEuropeanShortDatetime" even though the type was not date.
        Perhaps this is not 100% correct, but the server warning pointed in the correct direction.

        Best regards
        Blama

        Comment

        Working...
        X