1
Views
3
Comments
Query strange behaviour
Question
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"
2017-01-10 15-48-58
Hélio Dolores
Staff
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
2011-09-27 11-03-56
Francisco Coutinho
I had some "strange behaviour" on a query as well.
Have a look to this thread, might be usefull to you.

https://www.outsystems.com/NetworkForums/ViewTopic.aspx?Topic=Advanced-SQL-Query-(-And-condition-)
2017-01-10 15-48-58
Hélio Dolores
Staff
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

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.