dbTalk Databases Forums  

Extrange Problem

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss Extrange Problem in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Lmcm
 
Posts: n/a

Default Extrange Problem - 08-07-2009 , 05:55 PM






Hi I have a problem with SQL anywhere 9.

I have installed the same DB in to computers one in the Server and a copy
in a Pc.
the one in the Pc I use it for testing before updating the program to users.
an is a simple copy of the Principal DB

I have this Script

SELECT ( select top 1 pip_precio
from prepintura
where id_pintura = comptarimap.id_pintura
order by id_fecha desc )
FROM comptarimap
WHERE ( ( comptarimap.id_empresa = 1 ) AND
( comptarimap.id_cliente = 382 ) AND
( comptarimap.id_sucursal = 1 ) AND
( comptarimap.id_cod_art = 'A186' ) ) ;

If I execute it on the server it will not work, because a syntax error

but if I change the connection to the one in pc I works just fine..
I have noticed that the problem is the order by line "order by id_fecha
desc" , but why It works on the PC DB and not on Server DB if it is exaclty
The same and same version ?


FirmaIng. Luis M. Cavazos

Reply With Quote
  #2  
Old   
R. Pods
 
Posts: n/a

Default Re: Extrange Problem - 08-10-2009 , 02:57 AM






To me it looks like on the server you're using an older version of SQLA.
ORDER BY in a sub-select was introduced with v9 (so it runs on the
local engine).

HTH
Reimer

Lmcm wrote:
Quote:
Hi I have a problem with SQL anywhere 9.

I have installed the same DB in to computers one in the Server and a
copy in a Pc.
the one in the Pc I use it for testing before updating the program to
users. an is a simple copy of the Principal DB

I have this Script

SELECT ( select top 1 pip_precio
from prepintura
where id_pintura = comptarimap.id_pintura
order by id_fecha desc )
FROM comptarimap
WHERE ( ( comptarimap.id_empresa = 1 ) AND
( comptarimap.id_cliente = 382 ) AND
( comptarimap.id_sucursal = 1 ) AND
( comptarimap.id_cod_art = 'A186' ) ) ;

If I execute it on the server it will not work, because a syntax error

but if I change the connection to the one in pc I works just fine..
I have noticed that the problem is the order by line "order by id_fecha
desc" , but why It works on the PC DB and not on Server DB if it is
exaclty The same and same version ?


FirmaIng. Luis M. Cavazos

Reply With Quote
  #3  
Old   
LMCM
 
Posts: n/a

Default Re: Extrange Problem - 08-10-2009 , 12:23 PM



Thanks for your answer,
but no, it is the same version even installed from the same
cd..


Quote:
To me it looks like on the server you're using an older
version of SQLA.
ORDER BY in a sub-select was introduced with v9 (so it
runs on the local engine).

HTH
Reimer

Lmcm wrote:
Hi I have a problem with SQL anywhere 9.

I have installed the same DB in to computers one in the
Server and a copy in a Pc.
the one in the Pc I use it for testing before updating
the program to users. an is a simple copy of the
Principal DB
I have this Script

SELECT ( select top 1 pip_precio
from prepintura
where id_pintura = comptarimap.id_pintura
order by id_fecha desc )
FROM comptarimap
WHERE ( ( comptarimap.id_empresa = 1 ) AND
( comptarimap.id_cliente = 382 ) AND
( comptarimap.id_sucursal = 1 ) AND
( comptarimap.id_cod_art = 'A186' ) ) ;

If I execute it on the server it will not work,
because a syntax error
but if I change the connection to the one in pc I works
just fine.. I have noticed that the problem is the order
by line "order by id_fecha desc" , but why It works
on the PC DB and not on Server DB if it is exaclty The
same and same version ?

FirmaIng. Luis M. Cavazos

Reply With Quote
  #4  
Old   
LMCM
 
Posts: n/a

Default Re: Extrange Problem - 08-10-2009 , 05:23 PM



Correction, yes that was the problem server is 8.01 TestPc
is 9.0.
Thanks thoy change it in TestPC without notice.

Quote:
Thanks for your answer,
but no, it is the same version even installed from the
same cd..


To me it looks like on the server you're using an older
version of SQLA.
ORDER BY in a sub-select was introduced with v9 (so it
runs on the local engine).

HTH
Reimer

Lmcm wrote:
Hi I have a problem with SQL anywhere 9.

I have installed the same DB in to computers one in
the Server and a copy in a Pc.
the one in the Pc I use it for testing before updating
the program to users. an is a simple copy of the
Principal DB
I have this Script

SELECT ( select top 1 pip_precio
from prepintura
where id_pintura = comptarimap.id_pintura
order by id_fecha desc )
FROM comptarimap
WHERE ( ( comptarimap.id_empresa = 1 ) AND
( comptarimap.id_cliente = 382 ) AND
( comptarimap.id_sucursal = 1 ) AND
( comptarimap.id_cod_art = 'A186' ) ) ;

If I execute it on the server it will not work,
because a syntax error
but if I change the connection to the one in pc I
works just fine.. I have noticed that the problem is
the order by line "order by id_fecha desc" , but why
It works on the PC DB and not on Server DB if it is
exaclty The same and same version ?

FirmaIng. Luis M. Cavazos

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.