[firebase-br] campo a.N_LOTE

Paulo Sérgo Feix paulinhofeix em gmail.com
Qua Mar 12 17:26:50 -03 2008


Sim Eu ja tentei passar o parametro TODOS, so que não funciona, e para usar
o link junto como deveria fazer, tipo eu fiz assim mais esta dando erro
componente IBO eu uso
Da erro nesta opção (a.N_LOTE LIKE :N_Lote01%)

Select a.* From Lanzamiento_Cargas a
Where
(a.N_LOTE LIKE :N_Lote01%) and
a.anula = :Anula01 and (a.Empresa = :Empresa01) and
(a.Trasgenico = :Trasgenico01) and
(a.Tipo_Carga = :Tipo_Carga01) and (a.Grano = :Grano01) and
(a.Fecha Between :FECHA01 and :FECHA02)and
((a.Entidad = :Entidad01)or (:Entidad01 = 0)) and
((a.Filial = :Filial01) or (:Filial01 = 0)) and
((a.Situacion = :Situacion01)or (:Situacion01 = 0)) and
((a.Silo = :Silo01)or(:Silo01 = 0)) and
((a.Parcela = :Parcela01)or(:Parcela01 = 0)) and
((a.Localidade = :Localidade01)or(:Localidade01 = 0)) and
((a.Variedade = :Variedade01)or(:Variedade01 = 0)) and
((a.Entrege_Por = :Entrege_Por01)or(:Entrege_Por01 = 0)) and
((a.Trasportadora = :Trasportadora01)or(:Trasportadora01 = 0)) and
((a.Cod_Motorista = :Motorista01)or(:Motorista01 = 0)) and
((a.Categoria = :Categoria01)or(:Categoria01 = 0))
Order by a.Fecha, a.Rec_Lanzamiento asc

para mandar as informação eu faço assim:
IBOCargas.Close;
IBOCargas.ParamByName('Empresa01').AsInteger:=Menu_Principal.Empresa_Cod;
IBOCargas.ParamByName('Filial01').AsInteger:=RxMCuenta_CLienteFilial.Value;
IBOCargas.ParamByName('Anula01').AsInteger:=RxMCuenta_CLienteAnulado.Value;
IBOCargas.ParamByName
('Trasgenico01').AsInteger:=RxMCuenta_CLienteTragenico.Value;
IBOCargas.ParamByName('Tipo_Carga01').AsInteger:=ComboBox2.ItemIndex;
IBOCargas.ParamByName('Situacion01').AsInteger:=ComboBox1.ItemIndex;
IBOCargas.ParamByName('Grano01').AsInteger:=RxMCuenta_CLienteGrano.Value;
IBOCargas.ParamByName
('Entidad01').AsInteger:=RxMCuenta_CLienteEntidad.Value;
IBOCargas.ParamByName('Silo01').AsInteger:=RxMCuenta_CLienteSilo.Value;
IBOCargas.ParamByName
('Parcela01').AsInteger:=RxMCuenta_CLienteParcela_Area.Value;
IBOCargas.ParamByName
('Localidade01').AsInteger:=RxMCuenta_CLienteLocalidade.Value;
IBOCargas.ParamByName
('Variedade01').AsInteger:=RxMCuenta_CLienteVariedade.Value;
IBOCargas.ParamByName
('Entrege_Por01').AsInteger:=RxMCuenta_CLienteEntregue_Por.Value;
IBOCargas.ParamByName
('Trasportadora01').AsInteger:=RxMCuenta_CLienteTrasportadora.Value;
IBOCargas.ParamByName('FECHA01').AsDate:=RxMCuenta_CLienteFecha01.Value;
IBOCargas.ParamByName('FECHA02').AsDate:=RxMCuenta_CLienteFecha02.Value;
IBOCargas.ParamByName
('Motorista01').AsInteger:=RxMCuenta_CLienteMotorista.Value;
IBOCargas.ParamByName
('Categoria01').AsInteger:=RxMCuenta_CLienteCategoria.Value;
IBOCargas.ParamByName('N_Lote01').AsString:=DBEdit12.Text;
IBOCargas.Open;



Em 12/03/08, Marco Antonio Abreu <mabreu em itquality.com.br> escreveu:
>
> Neste caso, quando não houver parametro de pesquisa especificado, tente
> passar 'TODOS' para N_Lote01 em vez de vazio.
>
> Deve funcionar.
>
> []'s,
>
> Marco Antonio Abreu
> IT Quality Systems
> mabreu em itquality.com.br
> http://www.itquality.com.br
>
>
>
> Paulo Sérgo Feix wrote:
> > Desta forma esta montado a minha consulta
> >
> > Select a.* From Lanzamiento_Cargas a
> > Where a.anula = :Anula01 and (a.Empresa = :Empresa01) and
> > (a.Trasgenico = :Trasgenico01) and
> > (a.Tipo_Carga = :Tipo_Carga01) and (a.Grano = :Grano01) and
> > (a.Fecha Between :FECHA01 and :FECHA02)and
> > ((a.Entidad = :Entidad01)or (:Entidad01 = 0)) and
> > ((a.Filial = :Filial01) or (:Filial01 = 0)) and
> > ((a.Situacion = :Situacion01)or (:Situacion01 = 0)) and
> > ((a.Silo = :Silo01)or(:Silo01 = 0)) and
> > ((a.Parcela = :Parcela01)or(:Parcela01 = 0)) and
> > ((a.Localidade = :Localidade01)or(:Localidade01 = 0)) and
> > ((a.Variedade = :Variedade01)or(:Variedade01 = 0)) and
> > ((a.Entrege_Por = :Entrege_Por01)or(:Entrege_Por01 = 0)) and
> > ((a.Trasportadora = :Trasportadora01)or(:Trasportadora01 = 0)) and
> > ((a.Cod_Motorista = :Motorista01)or(:Motorista01 = 0)) and
> > ((a.Categoria = :Categoria01)or(:Categoria01 = 0))
> > ((a.N_LOTE = :N_Lote01)or('TODOS' = :N_Lote01))
> > Order by a.Fecha, a.Rec_Lanzamiento asc
> >
> > So precisso saber como faço nesta parte ((a.N_LOTE =
> :N_Lote01)or('TODOS' =
> > :N_Lote01)) ja que é uma sting
> >
> >
> >
> > Em 11/03/08, Marco Antonio Abreu <mabreu em itquality.com.br> escreveu:
> >
> >> Olá Paulinho,
> >>
> >> por que você não tenta montar o select dinamicamente, acrescentando as
> >> clausulas no WHERE conforme os campos são preenchidos?
> >>
> >> []'s,
> >>
> >> Marco Antonio Abreu
> >> IT Quality Systems
> >> mabreu em itquality.com.br
> >> http://www.itquality.com.br
> >>
> >>
> >>
> >> Paulo Sérgo Feix wrote:
> >>
> >>> Bom dia
> >>> Tive que fazer uma implementação nesta consulta Componente IBO na
> parte
> >>>
> >> do
> >>
> >>> campo a.N_LOTE é uma string nas demais parte funciona tudo o problema
> é
> >>> neste campo tipo quando a.N_LOTE tiver uma informação deve trazer
> >>>
> >> somente
> >>
> >>> deste Lote, e quando tiver em branco deve trazer todos, só que a
> >>>
> >> consulta
> >>
> >>> não ta trazendo nem uma informação, algum pode me ajudar
> >>>
> >>> Select a.* From Lanzamiento_Cargas a
> >>> ((a.Cod_Motorista = :Motorista01)or(:Motorista01 = 0)) and
> >>> ((a.Categoria = :Categoria01)or(:Categoria01 = 0))
> >>> ((a.N_LOTE = :N_Lote01)or('TODOS' = :N_Lote01))
> >>> Order by a.Fecha, a.Rec_Lanzamiento asc
> >>>
> >>>
> >>>
> >> ______________________________________________
> >> FireBase-BR (www.firebase.com.br) - Hospedado em www.locador.com.br
> >> Para saber como gerenciar/excluir seu cadastro na lista, use:
> >> http://www.firebase.com.br/fb/artigo.php?id=1107
> >> Para consultar mensagens antigas: http://firebase.com.br/pesquisa
> >>
> >>
> >
> >
> >
> >
>
> ______________________________________________
> FireBase-BR (www.firebase.com.br) - Hospedado em www.locador.com.br
> Para saber como gerenciar/excluir seu cadastro na lista, use:
> http://www.firebase.com.br/fb/artigo.php?id=1107
> Para consultar mensagens antigas: http://firebase.com.br/pesquisa
>



-- 
Paulinho Sérgio Feix



Mais detalhes sobre a lista de discussão lista