Query strange behaviour

Query strange behaviour

  
I have this advanced query in platform 5.0 with oracle and java:

SELECT {LOCAL_PRESCRICAO}.*,0
FROM
    {LOCAL_PRESCRICAO}
INNER JOIN
    {ESTABELECIMENTO_LOCAL_PRESCRICAO} on ({LOCAL_PRESCRICAO}.[Id]={ESTABELECIMENTO_LOCAL_PRESCRICAO}.[LocalPrescricaoId])
WHERE
    {ESTABELECIMENTO_LOCAL_PRESCRICAO}.[EntidadeId]=@EstabelecimentoId
AND
    {LOCAL_PRESCRICAO}.[Id] not in (select {ENCOMENDA_LINHA}.[LocalPrescricaoId]
                                        from {ENCOMENDA_LINHA}
                                    where {ENCOMENDA_LINHA}.[EncomendaId]=@EncomendaId )

Now if i test the query in service studio i have results and in runtime not,why this behaviour?This happens just if i add the last "and"
The values for @EncomendaId are equal in Runtime and Test? 
Try debugging in service studio and break after the query and then (you don't need to stop the debugger) test with the value for the same inputs.

Hélio
I had some "strange behaviour" on a query as well.
Have a look to this thread, might be usefull to you.

http://www.outsystems.com/NetworkForums/ViewTopic.aspx?Topic=Advanced-SQL-Query-(-And-condition-)
Just let me remind you guys,
if you find an issue please submit feedback from Service Studio or contact OutSystems' support so that we can fix it.

HD