Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Sql Server Programming

SQL Mobile TSQL Error, Please explain.


hi All

I am new to SQL Mobile and i am not sure about the different rulez relating
to SQL.

i have tried the following query in 2 different ways and i get the same
error. What i am trying to do is fill a Data Set on the a Windows Mobile 5
PDA using CF2.0

SELECT Orders.OrderID, (Customers.CompanyName + ' - ' + cast(Orders.OrderID
as varchar(5))) as OrderName FROM Orders INNER JOIN Customers ON
Orders.CustomerID = Customers.CustomerID Order By Customers.CompanyName

There was an error parsing the query. [ Token line number = 1,Token line
offset = 77,Token in error = as ]

SELECT Orders.OrderID, OrderName=(Customers.CompanyName + ' - ' +
cast(Orders.OrderID as varchar(5))) FROM Orders INNER JOIN Customers ON
Orders.CustomerID = Customers.CustomerID Order By Customers.CompanyName

There was an error parsing the query. [ Token line number = 1,Token line
offset = 33,Token in error = = ]

I can see that the problem seems to be the Aliesing of the field OrderName.
But how would i write this query so it works on windows mobile.

if there is a resorce that will tell me what SQL i can yous on SQL mobile i
would appriciat a link.

Kind regards.
ink.

I have Checked BOL for SQL Compact edition and according to it this Query
should work.
I have also tested this from The Query Analiser on the PDA and i get the sam
error so it can't be a code issue.

Can anyony tell me why this would be erroring.

Thanks,
ink

"iKiLL" <i@NotMyEmail.com> wrote in message

news:eAEB9bNVHHA.4844@TK2MSFTNGP03.phx.gbl...

I figgered it out.

The AS error is missleading.

The problem is the CAST function does not exist.

i have had to change the Query to use the CONVERt function and nvarchar.
Like this.

SELECT Orders.OrderID, (Customers.CompanyName + ' - ' +
CONVERT(nvarchar(5),Orders.OrderID)) as OrderName FROM Orders INNER JOIN
Customers ON Orders.CustomerID = Customers.CustomerID Order By
Customers.CompanyName

Thanks
ink

"iKiLL" <i@NotMyEmail.com> wrote in message

news:OiIQrrNVHHA.4828@TK2MSFTNGP05.phx.gbl...

I'm glad you got it working. SQL Mobile only supported the unicode versions
of strings, as you found.

--
Ginny

"iKiLL" <i@NotMyEmail.com> wrote in message

news:ejMSJzNVHHA.4404@TK2MSFTNGP03.phx.gbl...

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc