![]() character varying) btree, for table public.tstbl. PostgreSQL resultSet. Now with the USING syntax, we can solve this annoying issue with this command. Convert a character string of CHAR, VARCHAR2, NCHAR, or NVARCHAR2. CAST conversions among SQL-92 data types. SELECT CASE WHEN trim ($ 1 ) SIMILAR TO ' + ' THEN CAST ( trim ($ 1 ) AS integer ) ELSE NULL END The data type of the expression from which you are casting is the source type. ![]() To resolve this issue - lets suppose we write a simple function like this which takes a string value and if it looks like a number, it converts it to a number otherwise it just returns NULL:ĬREATE OR REPLACE FUNCTION pc_chartoint (chartoconvert character varying ) RETURNS integer AS
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |