3

I have a table with a string column. I convert this column to a number using the function TO_INTEGER(). Ist work fine. But If I Aggregate the converted column with the function SUM I got this error:

SAP DBTech JDBC: [339]: invalid number: not a valid number string ' ' at function to_int()

This is my sample SQL query:

select SUM(PARTICIPANT)
from (
select TO_INTEGER(STUDENT) as PARTICIPANT
from MyTable)

Column STUDENT is a varchar(50) in MyTable

What did I do wrong?

Thanks in advance

4

2 に答える 2

1

列の値が表示されない場合、値リストの末尾にある数値シーケンスを数値に変換しようとしているように見え、それを区切るスペースがこのエラーをスローしています。しかし、あなたが私たちに提供した情報に基づいて、それはどの分野でも起こっている可能性があります.

例えば:

Create table Table1 (tel_number number);
Insert into Table1 Values ('0419 853 694');

上記はあなたに

無効な番号

于 2016-06-21T10:54:34.163 に答える