Subject | RE: [IBO] How to use Query.Filter with Alias column |
---|---|
Author | IBO Support List |
Post date | 2013-08-27T05:11:08Z |
You will also likely need to preface it with the flag to tell IBO to not
parse the filter clause but to stick it directly into the WHERE clause
as-is.
Query.Filter := '::SQL::(select coalesce(sum(deve), 0) from pedidosven ped
where ped.vendedor = vend.codigo and ped.acfinanceiro = 'S');
Jason
-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
Of Felipe Aron
Sent: Monday, August 26, 2013 11:23 AM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] How to use Query.Filter with Alias column
You said, catch the subquery and use on filter?
My original SQL (example):
*select vend.nome,*
* ( select coalesce(sum(deve), 0)*
* from pedidosven ped*
* where ped.vendedor = vend.codigo*
* and ped.acfinanceiro = 'S'*
* ) DIVIDA*
* from vendedores vend*
*where vend.status = 'Ativa'*
* and vend.representante = 347*
The Query.Filter would look like this?
*Query.Filter := '(select coalesce(sum(deve), 0) from pedidosven ped where
ped.vendedor = vend.codigo and ped.acfinanceiro = 'S');*
2013/8/26 IBO Support List <supportlist@...>
Analista-Programador
#FollowMe: @felipearon <http://twitter.com/felipearon> (
http://felipearon.net)
[Non-text portions of this message have been removed]
------------------------------------
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Yahoo! Groups Links
parse the filter clause but to stick it directly into the WHERE clause
as-is.
Query.Filter := '::SQL::(select coalesce(sum(deve), 0) from pedidosven ped
where ped.vendedor = vend.codigo and ped.acfinanceiro = 'S');
Jason
-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
Of Felipe Aron
Sent: Monday, August 26, 2013 11:23 AM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] How to use Query.Filter with Alias column
You said, catch the subquery and use on filter?
My original SQL (example):
*select vend.nome,*
* ( select coalesce(sum(deve), 0)*
* from pedidosven ped*
* where ped.vendedor = vend.codigo*
* and ped.acfinanceiro = 'S'*
* ) DIVIDA*
* from vendedores vend*
*where vend.status = 'Ativa'*
* and vend.representante = 347*
The Query.Filter would look like this?
*Query.Filter := '(select coalesce(sum(deve), 0) from pedidosven ped where
ped.vendedor = vend.codigo and ped.acfinanceiro = 'S');*
2013/8/26 IBO Support List <supportlist@...>
> **--
>
>
> Substitute the actual SQL that gives you that column in the place of
> the alias name.
>
> Alternatively, in the next release due soon, as soon as I pin down a
> couple bugs I am working on, you can assign that filter into the new
> FilterInMem property. What this does is it fetches in the records and
> then filters them in the client buffers. You might find this
> acceptable, in which case, you can include the alias name in the filter.
>
> Jason
>
>
> -----Original Message-----
> From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On
> Behalf Of Felipe Aron
> Sent: Monday, August 26, 2013 10:25 AM
> To: IBObjects@yahoogroups.com
> Subject: [IBO] How to use Query.Filter with Alias column
>
> I have a SQL with one Alias column.
>
> When run the Filter (with this alias column) has one exception --
> "Column unknown"
>
> How to use a Query.Filter in this case?
>
> --
> Analista-Programador
> #FollowMe: @felipearon <http://twitter.com/felipearon> (
> http://felipearon.net)
>
> [Non-text portions of this message have been removed]
>
> ------------------------------------
>
> __________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or
> InterBase without the need for BDE, ODBC or any other layer.
> __________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info
> papers, keyword-searchable FAQ, community code contributions and more
> !
> Yahoo! Groups Links
>
>
>
Analista-Programador
#FollowMe: @felipearon <http://twitter.com/felipearon> (
http://felipearon.net)
[Non-text portions of this message have been removed]
------------------------------------
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Yahoo! Groups Links