Subject Re: [firebird-support] Simple SELECT statement not working Firebird-2.5.0.26083-0_Win32
Author LtColRDSChauhan
1. Downloaded Firebird-2.5.0.26084-0_Win32 today[16 Sep 2010] .
2. The above select statement worked fine.
3. I was checking the select statement as my under mentioned stored proc
was not working as expected ie it failed to delete the intended existing
record.
SET TERM ^ ;
ALTER PROCEDURE DELETE_PATIENTCHGS_SRVCID (
SRVCID integer default 0,
AMOUNT decimal(18,4) default 0,
AMOUNT_BEFORE_DISCOUNT decimal(18,4) default 0,
HOSPSRVCDESC varchar(100) default 0,
REMARKS varchar(80) default '',
DATEOFEXPENSE timestamp default 'Now',
ENTEREDBY varchar(80) default '',
ENTRYPC varchar(80) default '',
ENTRYTIME timestamp default 'Now',
REGDID bigint default 0,
RECEIPTANTID integer default -1 )
RETURNS (
MSG varchar(80) )
AS
BEGIN
MSG='FAILED DELETE CHARGE ENTRY';

delete from PATIENTCHARGESDUES p where
p.SERVICEID=:SRVCID and
p.AMOUNT=:AMOUNT and
p.AMOUNT_BEFORE_DISCOUNT = :AMOUNT_BEFORE_DISCOUNT and
p.HOSPSRVCDESC=:HOSPSRVCDESC and
p.REMARKS=:REMARKS and
p.DATEOFEXPENSE = :DATEOFEXPENSE and
p.ENTEREDBY = :ENTEREDBY and
upper(p.ENTRYPC) = upper(:ENTRYPC) and
p.ENTRYTIME=:ENTRYTIME and
p.REGDID=:REGDID and
p.RECEIPTANTID=:RECEIPTANTID;

if(ROW_COUNT = 1) then
begin
MSG='SUCCESS DELETE CHARGE ENTRY';
end
else if(row_count = 0) then
begin
MSG='ROWS DELETED 0';
end
else
begin
MSG='FAILED DELETED CHARGE ENTRY';
end

suspend;
END^
SET TERM ; ^

GRANT EXECUTE
ON PROCEDURE DELETE_PATIENTCHGS_SRVCID TO SYSDBA;


On Thu, Sep 16, 2010 at 2:32 PM, Kjell Rilbe <kjell.rilbe@...> wrote:

>
>
> LtColRDSChauhan skriver:
>
> > On Thu, Sep 16, 2010 at 1:55 AM, Ivan Prenosil<Ivan.Prenosil@...<Ivan.Prenosil%40seznam.cz>
> >wrote:
> >> Are you sure the .674 is correct ? Timestamp's precision is 4 decimal
> >> places after seconds.
> >> Can you try
> >> p.ENTRYTIME BETWEEN '15.9.2010, 20:40:06.6740' AND '15.9.2010,
> >> 20:40:06.6749'
> >> ?
> >>
> >> I did try '15.09.2010, 20:40:06.6740' , '15.9.2010, 20:40:06.674',
> > '15.9.2010, 20:40:06.6740'. Thanks a lot.
> >
> But Ivan asked you to try BETWEEN. Read his text again, carefully and
> try EXACTLY what he wrote.
>
> It may not help to try various exact fractions. His point was for you to
> try an interval, using between.
>
> Kjell
> --
> --------------------------------------
> Kjell Rilbe
> DataDIA AB
> E-post: kjell@... <kjell%40datadia.se>
> Telefon: 08-761 06 55
> Mobil: 0733-44 24 64
>
>
>



--
Regards,
Lt Col (Retd) Rajiv Dular Singh Chauhan
09601704890
0265-2637655
_____________________________


[Non-text portions of this message have been removed]