Thanks for your help,

 

It was the datatype! It was set to varchar.. Actually it isn’t my database, it was written for a telecommunications PBX application and worked with SQL server but I am trying to convert it to SAP DB as I believe it is a better approach

 

Sorry for saying “it doesn’t work”, it appears the problems are with the actual database being written not as good as it could be..

 

Anyway I did a NUM(Data)+1 and everything is ok now.

 

Thanks for your help

 

Ian

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Zabach, Elke
Sent: mi�rcoles, 09 de octubre de 2002 16:05
To: 'Ian'; [EMAIL PROTECTED]
Subject: RE: Using fieldname+1 in SELECT statement

 

Ian wrote:

 

> Hi there,
>
> Just converted an SQL server DB over to SAP DB and things are looking really good now,
> I expected I would need to ensure all my querys from my program work and expected to
> have to update a few - anyway I got problems with this one which is really trivial...
>
>
> SELECT  UserID, Extension, Type, Hookstate, '<ACD CALL>0' AS ACDcall, Data + 1 AS Data
> FROM Extension WHERE Data ='3'
>
>
> It works in SQL Server and MySQL .. it seems it doesn't like the data+1.
> If I remove the +1 then it works.. I tried surrounding it with brackets but
> it still doesn't work
>
>
> Any ideas???

1. please do not just say ' it does not work'. It is really helpful

    for diagnostic needs to know, how this 'not-working' is found out:

    which error occured, the errorposition (if possible), additional

    info returned with the error.

2. If I see, that you compare Data with the string_literal '3', I assume that Data is

    a column of datatype char (n).

    And why do you want to add the value 1 to a character-value ?

3. Oracle does allow this ... behaviour, it converts implicitly character (if possible)

    to numbers and vice-versa. It does the work of users who are not willing / able

    to work correctly with the datatypes they specified for their tables.

    For this reason we are forced to do this implicit conversion, too, in SQLMODE Oracle only.

4. Depending on the value of Data (not being a character-representation of a number for example)

    an error will occur.

 

Please tell us the error which occured, check the datatypes and/or provide the table definition

of Extension to be able to check what happens.

 

Elke

SAP Labs Berlin

 

Reply via email to