Subject | Re: [firebird-support] check if content string is integer |
---|---|
Author | Martijn Tonies |
Post date | 2010-01-22T11:41:34Z |
>I need to check the content of a varchar if it is possible to cast asIn the trigger, CAST to Integer, if this fails, use exception handling
>integer.
> cast raises an exception, if it the varchar is not compatuble with
> integer.
>
> In a trigger I want to store the numeric value of a varchar field into an
> integer field, if the varchar contents anything that is possible to
> convert. If it is not possible I want the integer field to be set to 0.
>
> Is there a way to do so, without using an udf?
and store 0.
With regards,
Martijn Tonies
Upscene Productions
http://www.upscene.com
Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!
Database questions? Check the forum:
http://www.databasedevelopmentforum.com