Subject | Order by ignored |
---|---|
Author | Martin D. Berezaga |
Post date | 2003-05-16T05:16:08Z |
Hello,
I have a Select involving a join between a table and a procedure.
The procedure have 2 input parameters and 2 output parameters: CODINSUMO
and QTDE.
Here's the select:
SELECT I.CODINSUMO
, I.CODTIPOINSUMO
, I.TIPO
, I.DESCRICAO
, I.UNIDADE
, I.TOTAL
, I.ESTOQUEMIN
, I.BAIXO
, I.PRODUCAO
, PCI.QTDE AS PREV
FROM INSUMO I
JOIN PREVISAO_CONSUMO_INSUMOS (Param1, Param2) PCI
ON I.CODINSUMO = PCI.CODINSUMO
The result set it's ok. But when I try to use the Order By clause:
- Order by INSUMO.CODINSUMO
Works fine. CODINSUMO is INTEGER and defines the PK. It's used to join the
table with the procedure.
- Order by INSUMO.TIPO
Works fine. TIPO is VARCHAR.
- Order by INSUMO.DESCRICAO
It doesn't works. DESCRICAO is VARCHAR. Result set is ordered based on
CODINSUMO (PK)
- Order by INSUMO.TIPO, INSUMO.DESCRICAO
Works fine.
When I do the select based only in table INSUMO, without joining with the
procedure, the Order by clause works fine in all cases above.
What could be the problem?
Thanks.
---------------------------
Martin D. Berezaga
mdberezaga@...
ICQ : 18537142
Porto Alegre - RS - Brasil
---------------------------
----------
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.481 / Virus Database: 277 - Release Date: 13/05/03
[Non-text portions of this message have been removed]
I have a Select involving a join between a table and a procedure.
The procedure have 2 input parameters and 2 output parameters: CODINSUMO
and QTDE.
Here's the select:
SELECT I.CODINSUMO
, I.CODTIPOINSUMO
, I.TIPO
, I.DESCRICAO
, I.UNIDADE
, I.TOTAL
, I.ESTOQUEMIN
, I.BAIXO
, I.PRODUCAO
, PCI.QTDE AS PREV
FROM INSUMO I
JOIN PREVISAO_CONSUMO_INSUMOS (Param1, Param2) PCI
ON I.CODINSUMO = PCI.CODINSUMO
The result set it's ok. But when I try to use the Order By clause:
- Order by INSUMO.CODINSUMO
Works fine. CODINSUMO is INTEGER and defines the PK. It's used to join the
table with the procedure.
- Order by INSUMO.TIPO
Works fine. TIPO is VARCHAR.
- Order by INSUMO.DESCRICAO
It doesn't works. DESCRICAO is VARCHAR. Result set is ordered based on
CODINSUMO (PK)
- Order by INSUMO.TIPO, INSUMO.DESCRICAO
Works fine.
When I do the select based only in table INSUMO, without joining with the
procedure, the Order by clause works fine in all cases above.
What could be the problem?
Thanks.
---------------------------
Martin D. Berezaga
mdberezaga@...
ICQ : 18537142
Porto Alegre - RS - Brasil
---------------------------
----------
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.481 / Virus Database: 277 - Release Date: 13/05/03
[Non-text portions of this message have been removed]