Jump to content
  • Parameter issue when using "read fields" button in report query window


    nuge
    CategoryBug report
    PriorityHigh
    ReproducibilityAlways
    ResolutionOpen
    SeverityMajor
    StatusAssigned

    Here is the simplest version of this issue I could create: In iReport I have the NEW_DATE parameter set properly as a java.util.Date with default value new Date() and the NEW_INT as a java.lang.Integer with default value as new Integer().

     

    If I set up my query something like this

     

    SELECT something

    FROM table

    WHERE date = $P{NEW_DATE}

    AND index = $P{NEW_INT}

     

    When I try and read the fields with this query I get:

     

    Error: SQL problems:ERROR: invaild input syntax for integer: "Thu Feb 01 13:23:36 PST 2007"

     

    However if I change the ordering of the conditions in the query it reads the fields fine:

     

    SELECT something

    FROM table

    WHERE index= $P{NEW_INT}

    AND date = $P{NEW_DATE}

     

    I have been able to get around this in more complex queries in one of two ways either by reordering the conditionals or by commenting them out, reading the fields and then adding the conditional statements back in. I'm connecting to a PostgreSQL database.


    Attachments: Report.jrxml

    User Feedback

    Recommended Comments

    Here is the JRXML that shows an example of the problem. After further investigation I have discovered that the order of the parameters must be the same as the order they appear in the query in order to avoid the error that appears when the Read Fields button is pressed. I am running a PostgreSQL 8.0 databse as my test server.

     

    Thanks,

    Andrew

    Link to comment
    Share on other sites

    Giulio,

    Here is the clipboard contents when the report query window will not read the fields:

     

    ---------------------------------

    SELECT id,

    price_current

    FROM mls

    WHERE date_listed >= Tue Apr 10 15:50:33 PDT 2007

    AND price_current >= 0

    ---------------------------------------

     

    Here is the clipboard when it will read fields:

     

    ---------------------------------------

    SELECT id,

    price_current

    FROM mls

    WHERE price_current >= 0

    AND date_listed >= Tue Apr 10 15:57:12 PDT 2007

    ------------------------------------------

     

    Thanks,

    Andrew

    Link to comment
    Share on other sites


×
×
  • Create New...