on 06-24-2013 10:49 AM
Hello,
we like to convert a column which is now varchar into int or float.
because we are trying now to use the following sql:
select NUM(colum name) from TABLE....
but the problem is, that the content of this column contains seperators and chars.
is there an sql function for checking if the value is numeric (like is_numeric() in php)?
your help is much appreciated
regards
Hi,
create a function
CREATE FUNCTION is_numeric (c char(255)) RETURNS INTEGER DETERMINISTIC AS
TRY
SELECT NUM(:C) FROM SYSDBA.DUAL;
RETURN 1;
CATCH RETURN 0;
Regards,
Burkhard
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.