What is the use of & gt and the & lt in a native query?

0

I have the following native query but I do not know what it means or what it does & gt, & lt

<query>
SELECT ID, ID_BASE, NOMBRE, RFC, NOMBRE_CLAVE, FEC_REGISTRO, FECH_PRINCIPAL
FROM FACTURA F
WHERE F.ID_BASE=?1
AND F.FEC_REGISTRO &gt;=TO_DATE(?2, 'DD/MM/YYYY hh24:mi:ss')
AND F.FEC_REGISTRO &lt;=TO_DATE(?3, 'DD/MM/YYYY hh24:mi:ss')
</query>

Could someone tell me why he is busy? or what does it mean in this query?

    
asked by Root93 12.07.2018 в 05:35
source

1 answer

2

&gt; is > (greater than) greater than

&lt; is < (less than) less than

AND F.FEC_REGISTRO &gt;=TO_DATE(?2, 'DD/MM/YYYY hh24:mi:ss')

is translated to

AND F.FEC_REGISTRO >=TO_DATE(?2, 'DD/MM/YYYY hh24:mi:ss')

I mean greater than or equal to ...

the same for the &lt;

they are encoded in that way because they must be within an xml / xhtml and if you put the < or the > directly it breaks the scheme.

Another way would be to put it like that

<query>
<![CDATA[

SELECT ID, ID_BASE, NOMBRE, RFC, NOMBRE_CLAVE, FEC_REGISTRO, FECH_PRINCIPAL
FROM FACTURA F
WHERE F.ID_BASE=?1
AND F.FEC_REGISTRO >=TO_DATE(?2, 'DD/MM/YYYY hh24:mi:ss')
AND F.FEC_REGISTRO <=TO_DATE(?3, 'DD/MM/YYYY hh24:mi:ss')

]]>
</query>
    
answered by 12.07.2018 / 05:45
source