Subject Re: Record not found message...
Author Tom
--- In IBObjects@yahoogroups.com, "Hans" <hhoogstraat@...> wrote:
>
> Can you show us your procedure ?

CREATE OR ALTER PROCEDURE SP_GET_CASHBOOK (STARTDATE Date,
ENDDATE Date)
returns (TRNS_ID BIGINT,
TRNS_DATE Date,
TRNS_COMPANY Varchar(50),
TRNS_REFERENCE Varchar(25),
TRNS_INFO Varchar(50),
TRNS_CREDIT Decimal(4,2),
TRNS_DEBIT Decimal(4,2),
TRNS_BALANCE Decimal(4,2))
AS

begin
for select 0,:STARTDATE-1 as trns_date,'','','auto-calculated',sum(c.trns_credit) as trns_credit,sum(c.trns_debit) as trns_debit,sum(c.trns_balance) as trns_balance
from V_CASHBOOK c
where c.trns_date < :StartDate
union
select c.trns_id,c.trns_date,c.trns_company,c.trns_reference,c.trns_info,c.trns_credit,c.trns_debit,c.trns_balance
from V_CASHBOOK c
where c.trns_date between :StartDate and :EndDate+1
into :trns_id, :trns_date,:trns_company,:trns_reference,:trns_info,:trns_credit,:trns_debit,:trns_balance do
begin
if (trns_balance is null) then trns_balance=0.0;
if (trns_credit is null) then trns_credit=0.0;
if (trns_debit is null) then trns_debit=0.0;
suspend;
end
end

and

CREATE OR ALTER PROCEDURE SP_GET_CASHBOOK_RB (STARTDATE Date,
ENDDATE Date)
returns (TRNS_ID BIGINT,
TRNS_DATE Date,
TRNS_COMPANY Varchar(50),
TRNS_REFERENCE Varchar(25),
TRNS_INFO Varchar(50),
TRNS_CREDIT Decimal(4,2),
TRNS_DEBIT Decimal(4,2),
TRNS_BALANCE Decimal(4,2),
TRNS_RUNNINGBALANCE Decimal(4,2))
AS

begin
trns_runningbalance=0.0;
for select c.trns_id,c.trns_date,c.trns_company,c.trns_reference,c.trns_info,c.trns_credit,c.trns_debit,c.trns_balance
from SP_GET_CASHBOOK(:STARTDATE,:ENDDATE) c
order by c.trns_date
into :trns_id, :trns_date,:trns_company,:trns_reference,:trns_info,:trns_credit,:trns_debit,:trns_balance
do
begin
trns_runningbalance = trns_runningbalance + trns_balance;
if (trns_runningbalance is null) then trns_runningbalance=0.0;
if (trns_credit is null) then trns_credit=0.0;
if (trns_debit is null) then trns_debit=0.0;
suspend;
end
end

>
> ----- Original Message -----
> From: "Tom" <zifnabbe@...>
> To: <IBObjects@yahoogroups.com>
> Sent: Sunday, July 05, 2009 5:30 PM
> Subject: [IBO] Record not found message...
>
>
> > When I try to open an IBOQuery with a selectable stored procedure, I get
> > an 'Record not found' message (when calling open), but the grid shows the
> > correct records... any idea why I get this message? PS. Using a normal
> > select query in IBOQuery does not gives me this message.
> >
> >
> >
> > ------------------------------------
> >
> > ___________________________________________________________________________
> > 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
> >
> >
> >
>