Type conversion from TEXT to DOUBLE PRECISION
От | Daniel Lau |
---|---|
Тема | Type conversion from TEXT to DOUBLE PRECISION |
Дата | |
Msg-id | Pine.WNT.3.96L2.1040109152354.256D-100000@iey118.ust.hk обсуждение исходный текст |
Ответ на | Re: Calendar Scripts - Quite a complex one ("Chris Travers" <chris@travelamericas.com>) |
Ответы |
Re: Type conversion from TEXT to DOUBLE PRECISION
Re: Type conversion from TEXT to DOUBLE PRECISION |
Список | pgsql-sql |
Hi all, Thank you for reading this mail. I am trying to do the following: Extract the first half of _aaa and put it in column _bbb Here is the table, named: _table: Varchar[10] | Double Precision _aaa _bbb _________________________________ 1234567890 I used two functions to do it: substring() and to_number(). The SQL is like this: UPDATE _table SET _bbb = to_number(substring(_aaa from 1 for 5), '99999'); The machine fails me and said ERROR: invalid input syntac for type numeric: " " I guess the machine can not treat TEXT as CHAR[5]. I tries to CAST TEXT as CHAR[5]. It also doesnt allow me to do so. Can anyone give me some hints on this? regards, Daniel
В списке pgsql-sql по дате отправления: