Page 1 of 1

TOraQuery Component ...

Posted: Thu 30 Jun 2005 17:21
by nacovolo
Hi!!!
I use a TOraQuery component in my delphi 7 project, and I have a problem/doubt about order of data.

The SQL's of TOraQuery component is:

SELECT CLIENTE_FORNECEDOR.COD_CLIENTE_FORNEC
, CLIENTE_FORNECEDOR.COD_PESSOA
, PESSOA.NOME
FROM MENUGERAL.CLIENTE_FORNECEDOR
, MENUGERAL.PESSOA
WHERE CLIENTE_FORNECEDOR.COD_PESSOA = PESSOA.COD_PESSOA
ORDER BY PESSOA.NOME

Data of SQL are:
COD_CLIENTE_FORNEC COD_PESSOA NOME
26 168 WILSON
27 169 ANTONIO
24 154 NELSON
29 154 NELSON
22 154 NELSON
25 156 LÍGIA
23 156 LÍGIA
20 167 ÓLEOS

The result of my SQL is using ORDER BY clause:
COD_CLIENTE_FORNEC COD_PESSOA NOME
27 169 ANTONIO
25 156 LÍGIA
23 156 LÍGIA
24 154 NELSON
29 154 NELSON
22 154 NELSON
26 168 WILSON
20 167 ÓLEOS

But, I´d like to have in this order:
COD_CLIENTE_FORNEC COD_PESSOA NOME
27 169 ANTONIO
25 156 LÍGIA
23 156 LÍGIA
24 154 NELSON
29 154 NELSON
22 154 NELSON
20 167 ÓLEOS
26 168 WILSON

What´s could happening with the order of the two lasts registers?

It´s all for this moment, and I´ll be waiting for a help.

Thank´s in advice.

Sincerely,


Nelson Antonio da Cruz Covolo

Posted: Thu 30 Jun 2005 18:00
by nacovolo
I use ODAC 5.00.0.2

Posted: Thu 30 Jun 2005 19:35
by brekhof
Use something like 'alter session set nls_sort=latin' to set the sort options for your program (once for each session).

I'm not sure wether or not the 'Latin' is the best option for your particular situation but it works for me (Dutch).

hth,
Martin

Posted: Thu 30 Jun 2005 20:11
by nacovolo
Hi brekhof ...
Thank´s for your tip ...
But I use "SQL Navigator" (Quest Software) to develp my sql´s ... and it´s bring-me the result of my SQL in the order that i wanna.

So, should I use "alter session set nls_sort=..." in my DB or in my TOraSession?

Posted: Thu 30 Jun 2005 20:59
by brekhof
nacovolo wrote:
So, should I use "alter session set nls_sort=..." in my DB or in my TOraSession?
I always put it in a OraScript component and execute that scripts right after connecting with a TOraSession.

hth,
Martin