Clarity

Expand all | Collapse all

Materialized query error

  • 1.  Materialized query error

    Posted Apr 22, 2015 03:35 AM

    Hi all,

     

    Could you plase explain me how can we write "materialize" statement in XBL file in different way?

     

    This satatement (part of a SQL code in xbl file) doesn't work:

     

    WITH TASKMS AS (SELECT /*+ materialize */ T1.PRID ....

     

    we also've tried this

     

    WITH TASKMS AS (SELECT /*+ materialize */ T1.PRID,

     

    but wihtou success.

     

    Could you plase help me asap if possible? Many thanks

     

     

    Note:

    Errors from logs:

    com.niku.xql2.XQLInvalidFileException: Error parsing xbl: /home/clarity/niku/clarity/META-INF/timeadmin/xbl/timesheets/timesheetData.xbl

     

    org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.

     

     

     

    Matej



  • 2.  Re: Materialized query error

    Posted Apr 22, 2015 04:00 AM

    That "content is not allowed in prolog" error has been seen when the editor that you are using to write your script in is using an odd charcter-set - perhaps try making sure that your file is clean plain text?  (search for "prolog" on the boards for a couple of cases where this has popped up).

     

    Alternatively, can you wrap your SQL in CDATA blocks in your XML?

     

    (juts GUESSing here)



  • 3.  Re: Materialized query error

    Posted Apr 22, 2015 08:28 AM

    Thanks Dave for response,

     

    We are pretty sure that this error is due to this /* materialize */ function but would like to know something more how can it be written in xbl to translate in Clarity will work...

    CDATA we didn't try.

     

    Matej



  • 4.  Re: Materialized query error

    Posted Apr 22, 2015 04:11 PM


  • 5.  Re: Materialized query error

    Posted Apr 23, 2015 03:00 AM

    Hi Urmas,

     

    Yes of course. Your topic is saying that it's quite nice hint for improvement of performance...

     

    One sentence is saying it can be deprecated, but as I said, in SQL developer it's working. Or may I missed something? Thanks



  • 6.  Re: Materialized query error

    Posted Apr 23, 2015 05:02 AM

    Does it not also say that it may be dropped any time.

    How do you know it is supposed to work in your version?



  • 7.  Re: Materialized query error

    Posted Apr 23, 2015 05:30 AM

    urmas wrote:

     

    How do you know it is supposed to work in your version?

    because it works in SQL*Developer I would assume?

     

    --

     

    Any luck with the CDATA option?



  • 8.  Re: Materialized query error

    Posted Apr 23, 2015 06:57 AM

    This satatement (part of a SQL code in xbl file) doesn't work:

     

    certainly fooled me.



  • 9.  Re: Materialized query error

    Posted Apr 23, 2015 09:55 AM

    @Dave,

     

    I think the same

    CDATA we didn't try because we've taken back our changes and put OOTB version as curren. But will see because we have just identified the root cause which completely the slow performance of Timesheet edit query when so many users trying to edit TS in the same time. So we will consider this.

     

    @Urmas,

     

    Yes we know it and would like to accompluish the way how can we do it

     

    Thanks to both

     

    Matej



  • 10.  Re: Materialized query error

    Posted Apr 27, 2015 01:03 AM

    Hi,

     

    I think that Dave suggestion still is the most plausible.

     

    When you say that you are pretty sure that the error is due to /* materialize */, what did you do to verify that? A good test would be to change the xbl file making some dummy modification (adding some extra spaces on the SQL, for example) and trying to running Clarity with this 'modified' xbl.

     

    I did some search on xbl and xml from Clarity META-INF and I found some xbl files with comments inside SQL statements (comments like: /* this is a comment */) and some pmd xml that has SQL statements with optimzer hints. That's why I'm asking you to double check on the XML charset that is being used (make sure it's UTF-8 without BOM).

     

    Regards,

    Roberto Barra



  • 11.  Re: Materialized query error

    Posted May 27, 2015 03:10 AM

    Hi Roberto,

     

    I could also find some files where Oracle hints were used (e.g /* ORDERED */, /* ROLE */ etc.), you are right, but only in XML files.

    In XBL files I ddin't find it. I'm sure it is due to this /* +materialize */ hint because withou this "comment command", our xbl is working fine.

     

    Thanks

     

    Matej