am 25.04.2006, um 2:01:49 -0700 mailte SunWuKung folgendes:
> I tried this but couldn't find out what would be the WHEN condition for
>
> Select Cast('asdf' as numeric)
> ERROR: invalid input syntax for type numeric
create or replace function check_numeric(varchar) returns bool as $$
declare
I tried this but couldn't find out what would be the WHEN condition for
Select Cast('asdf' as numeric)
ERROR: invalid input syntax for type numeric
regards,
Balázs
---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an
On 24 Apr 2006 12:49:51 -0700, SunWuKung <[EMAIL PROTECTED]> wrote:
> I was trying to actually do a cast and trap the error but (beside not
> having succeeded in doing so) this is a much nicer way.
>
> Thanks.
> Balázs
>
>
in 8.1 you can use exception blocks
BEGIN
statements
EXCEPTION
WHE
I was trying to actually do a cast and trap the error but (beside not
having succeeded in doing so) this is a much nicer way.
Thanks.
Balázs
---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
subscr
On Mon, Apr 24, 2006 at 05:31:46AM -0700, SunWuKung wrote:
> I am writing a pgsql function and I would need to create a condition
> based on the value of a text variable. I would need to check if
> text_var is convertable to numeric type and if yes do the conversion,
> if no do something else. I co
I am writing a pgsql function and I would need to create a condition
based on the value of a text variable. I would need to check if
text_var is convertable to numeric type and if yes do the conversion,
if no do something else. I couldn't find out how to do that.
Something like:
IF isnumeric(text_