Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: error in javascript: For Input String: "oracle.sql.TIMESTAMP@7cf54"

  1. #1

    Default error in javascript: For Input String: "oracle.sql.TIMESTAMP@7cf54"

    Getting the error

    For Input String: "oracle.sql.TIMESTAMP@7cf54"
    when using fireToDB. Here is the script:

    Code:
    var lkp_conn = "conn_dw";
    
    
    var lkp_sql = "select min(max_date) from  (select max(logintime_local) as max_date from t_logons WHERE SRC =  '" + src + "' union select max(logintime_local) as max_date from s_logons WHERE SRC = '" + src + "'  ) ";
    
    // get lkp array
    
    Alert(lkp_sql);
    
    var lkp_array = fireToDB(lkp_conn, lkp_sql);
    What is up? Also, is there an easy way to paste the sql generated by concatenations/variable substitution in a query tool? Can't copy and paste from an Alert box....

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Quote Originally Posted by urbanmojo View Post
    What is up?
    Try to cast timestamp to a supported datatype.

    Quote Originally Posted by urbanmojo View Post
    Can't copy and paste from an Alert box....
    No problem over here
    So long, and thanks for all the fish.

  3. #3

    Default

    OK, made some progress, but now get this error:

    2013/06/23 20:34:42 - js get interval lookup.0 - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : Javascript error:
    2013/06/23 20:34:42 - js get interval lookup.0 - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : For input string: "2013-06-03 09:30:00.0"
    I CAST everything as date, and later on in the code I do this:

    Code:
    var interval_count = 0;
    var interval_max_date = new java.util.Date();
    
    
    // check sql result
    
    if ((lkp_array.length == null)  || (lkp_array.length == 'undefined') || (lkp_array.length == 0))
    {
        interval_count = 0;
    }
    else
    {
        interval_count = lkp_array [0][0];
        interval_max_date = lkp_array [0][1];
    }
    In the "fields" section below I list interval_max_date as a date.

    So it is a date all the way through, why the error? I could try casting it as a string I suppose and then back to a date--is that necessary?

  4. #4
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    The first thing I would do is to locate the precise location where in the code the error is produced.
    Without an Oracle installation it's a blind flight for me.
    So long, and thanks for all the fish.

  5. #5

    Default

    My stupid. Forgot to add the "count" to the query. So I was querying for one date value when the array expected two values--an integer first and date second. Since it only got the date the integer variable said "WTF" and gave an error. Case closed, working fine now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.