I already have this SP in a DB (compiled, and using it a lot):

> create or alter procedure SP_INGRESOS_PEDIDOS_POR_FECHAS (
>     SUCURSAL smallint,
>     CODIGO_PRODUCTO integer,
>     FECHA_DESDE date)
> returns (
>     INGRESOS_PEDIDOS integer,
>     INGRESOS_PEDIDOS_FRACCIONES integer)
> as
> declare variable CODIGO_PRODUCTO_PADRE integer;
> declare variable TOTAL_INGRESOS_UNIDADES_COMPLETAS integer;
> declare variable TOTAL_INGRESOS_FRACCIONES integer;
> declare variable CANTIDAD_FRACCIONES integer;
> begin
>   /* SP usado por sp_stock_a_fecha */
>   select productos.codigo_padre_fraccionable from productos where
> productos.codigo = :codigo_producto into :codigo_producto_padre;
>   if (codigo_producto_padre > 0) then /* es una fraccion */
>      begin
>         ingresos_pedidos = 0;
>         ingresos_pedidos_fracciones = 0;
>      end
>   else /* no es una fraccion */
>      begin
>        select sum(items_pedidos.cantidad_recibida)
>        from pedidos inner join items_pedidos on pedidos.numero_pedido =
> items_pedidos.numero_pedido and pedidos.sucursal = items_pedidos.sucursal
>        where pedidos.sucursal = :sucursal and
> items_pedidos.codigo_producto = :codigo_producto and
> pedidos.fecha_recepcion_pedido > :fecha_desde
>        into :total_ingresos_unidades_completas;
>        total_ingresos_unidades_completas =
> coalesce(total_ingresos_unidades_completas,0);
>
>        select sum(items_pedidos.cantidad_recibida)
>        from (pedidos inner join items_pedidos on pedidos.sucursal =
> items_pedidos.sucursal and pedidos.numero_pedido =
> items_pedidos.numero_pedido) inner join productos on
> items_pedidos.codigo_producto = productos.codigo
>        where pedidos.sucursal = :sucursal and
> productos.codigo_padre_fraccionable = :codigo_producto and
> pedidos.fecha_recepcion_pedido > :fecha_desde
>        into :total_ingresos_fracciones;
>        total_ingresos_fracciones = coalesce(total_ingresos_fracciones,0);
>
>        select coalesce(productos.cantidad_fracciones, 0) from productos
> where codigo = :codigo_producto into :cantidad_fracciones;
>        if (cantidad_fracciones > 0) then
>          begin
>            ingresos_pedidos =  total_ingresos_unidades_completas +
> div(total_ingresos_fracciones,cantidad_fracciones);
>            ingresos_pedidos_fracciones =
> mod(total_ingresos_fracciones,cantidad_fracciones);
>          end
>        else
>          begin
>            ingresos_pedidos =  total_ingresos_unidades_completas;
>            ingresos_pedidos_fracciones = 0;
>          end
>      end
> end


Now I want to change a bit the body, and I get "Name longer than database
column size.". Tried recompiling without changing anything and again I get
"Name longer than database column size.
". Tried to make the name shorter, same behavior.
What's wrong with it?
FB 3.0.2
Thanks

Reply via email to