Subject Re: [firebird-support] exception on case
Author Helen Borrie
At 01:34 AM 24/03/2006, you wrote:
>Bases:
>SQL Dialect : 1
>ODS Version : 10.1
>Firebird-1.5.2.4731 win32
>Page Size : 8192
>
>CREATE PROCEDURE NEW_PROCEDURE (
> P DOUBLE PRECISION)
>RETURNS (
> VV VARCHAR(20) CHARACTER SET WIN1251)
>AS
>begin
> VV = cast(P as varchar(6));
> suspend;
>end
>
>1.
>Input:
>P1 = 0.011
>
>Output:
>P1 = 0.011
>
>2.
>
>Input:
>P1 = 0.001
>
>Output:
>Error Message:
>----------------------------------------
>Arithmetic overflow or division by zero has occurred.
>arithmetic exception, numeric overflow, or string truncation.
>
>Help me. Im in exception.

(P DOUBLE PRECISION)
RETURNS (VV VARCHAR(20)

VV = cast(P as varchar(6));

Use your varchar(20). A double precision number is a floating point
number, potentially 20 characters (19 digits + sign).

VV = cast(P as varchar(20));

./heLen