Subject Re: Odp: [firebird-support] Invalid request BLR at offset 230 context already in use (BLR error)
Author Gugui
is it should be a Firebird bug ?

if I delete
WHEN 'V' then 'S'
it runs !

CREATE VIEW temp (idformapgto, simnao )
AS
select a.idformapgto,
CASE (SELECT FIRST 1 P.TIPO FROM PEDIDO P WHERE P.IDPEDIDO = a.IDPEDIDO)
WHEN 'P' THEN
case when exists(select 1 from CLIENTE_FORMAPGTO cf
inner join pedido p on p.idcliente = cf.IDCLIENTE
where p.idpedido = a.idpedido and cf.IDFORMAPGTO = a.idformapgto)
then 'S' ELSE 'N' END
WHEN 'V' then
'S'
ELSE
NULL
END
FROM PRESTACAO_PEDIDO a;




Em 09-05-2013 12:05, liviuslivius@... escreveu:
>
> Hi,
>
> You have "f" context but you ommit "a" context
>
> I look for this on smartphone may be i miss somethink
>
> Regards,
> Karol Bieniaszewski
>
> ----- Reply message -----
> Od: "Gugui" <gugui_sarubi_macchi@...
> <mailto:gugui_sarubi_macchi%40yahoo.com.br>>
> Do: <firebird-support@yahoogroups.com
> <mailto:firebird-support%40yahoogroups.com>>
> Temat: [firebird-support] Invalid request BLR at offset 238 context
> already in use (BLR error)
> Data: czw., maj 9, 2013 16:20
> Hi all, someone could help me with this View ?
>
> if I delete
>
> WHEN 'V' then
>
> case when exists(select 1 from FORMAPGTO f WHERE F.CKB1 = 'T'
>
> and f.IDFORMAPGTO = a.idformapgto)
>
> then '<YES>' ELSE '<NO>' END
>
> the View is created
>
> CREATE VIEW temp ( yesno )
>
> AS
>
> select
>
> CASE (SELECT FIRST 1 P.TIPO FROM PEDIDO P WHERE P.IDPEDIDO = A.IDPEDIDO)
>
> WHEN 'P' THEN
>
> case when exists(select 1 from CLIENTE_FORMAPGTO cf
>
> inner join pedido p on p.idcliente = cf.IDCLIENTE
>
> where p.idpedido = a.idpedido and cf.IDFORMAPGTO = a.idformapgto)
>
> then '<YES>' ELSE '<NO>' END
>
> WHEN 'V' then
>
> case when exists(select 1 from FORMAPGTO f WHERE F.CKB1 = 'T'
>
> and f.IDFORMAPGTO = a.idformapgto)
>
> then '<YES>' ELSE '<NO>' END
>
> ELSE
>
> NULL
>
> END
>
> FROM PRESTACAO_PEDIDO a;
>
> thanks any help
>
> [Non-text portions of this message have been removed]
>
>