Subject Re: [firebird-support] I need to replace a varchar(2000) field with itself after removing the first ___ characters.
Author Martijn Tonies
Hi,

> I have tried both SUBSTR() and F_RIGHT() both of which return an error:
> arithmetic exception, numeric overflow, or string truncation
>
> For example if I try this simple select in Database Workbench I receive
> the
> error.
>
> SELECT F_RIGHT(SYSTEM_NOTE, 1000)
> FROM ACCT_TRAN_DETAIL_TASK
> WHERE ACCT_TRAN_ID = :V_ACCT_TRAN_ID
> AND ACCT_TRAN_DETAIL_ID = :V_ACCT_TRAN_DETAIL_ID
> AND ACCT_TASK_ID = :V_ACCT_TASK_ID
>
> The field is a varchar(2000) field and contains carriage returns and line
> feeds.
>
> Any help appreciated...

How is F_RIGHT defined? If it uses a smaller number than 2000 (the max
length of your field) for it's string parameters, you'll get an error.

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