Home > Archive > SQL Anywhere database > May 2005 > Store Procedure









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Store Procedure
Andi Ihsan

2005-05-21, 8:23 pm

I Face the problem in ASA 8.03
I Create procedure in transact-sql mode

Create procedure hms. tax_dokter(@day_name
varchar(20),@DOCTID =

varchar(20),@prov_id
varchar(20))
as
begin
declare @tax_Jm decimal(4,2)
set @tax_Jm=3Dcase upper(@day_name) when 'SUNDAY' then
(select top 1 hms.jm_doctor.tax from
hms.jm_doctor where
hms.jm_doctor.doct_id =3D @DOCTID and upper(jm_hari) =3D 'MINGG=
U' and =

hms.jm_doctor.prov_id =3D @prov_id)
when 'MONDAY' then(select top 1 hms.jm_doctor.tax from
hms.jm_doctor where
hms.jm_doctor.doct_id =3D @DOCTID and upper(jm_hari) =3D 'SENIN=
' and =

hms.jm_doctor.prov_id =3D @prov_id)
when 'TUESDAY' then(select top 1 hms.jm_doctor.tax from
hms.jm_doctor where
hms.jm_doctor.doct_id =3D @DOCTID and upper(jm_hari) =3D 'SELAS=
A' and =

hms.jm_doctor.prov_id =3D @prov_id)
when 'WEDNESDAY' then(select top 1 hms.jm_doctor.tax from
hms.jm_doctor where
hms.jm_doctor.doct_id =3D @DOCTID and upper(jm_hari) =3D 'RABU'=
and =

hms.jm_doctor.prov_id =3D @prov_id)
when 'THURSDAY' then(select top 1 hms.jm_doctor.tax from
hms.jm_doctor where
hms.jm_doctor.doct_id =3D @DOCTID and upper(jm_hari) =3D 'KAMIS=
' and =

hms.jm_doctor.prov_id =3D @prov_id)
when 'FRIDAY' then(select top 1 hms.jm_doctor.tax from
hms.jm_doctor where
hms.jm_doctor.doct_id =3D @DOCTID and upper(jm_hari) =3D 'JUMAT=
' and =

hms.jm_doctor.prov_id =3D @prov_id)
when 'SATURDAY' then(select top 1 hms.jm_doctor.tax from
hms.jm_doctor where
hms.jm_doctor.doct_id =3D @DOCTID and upper(jm_hari) =3D 'SABTU=
' and =

hms.jm_doctor.prov_id =3D @prov_id)
end
return(@tax_Jm)
end

When i execute in ISQL Session
select hms. tax_dokter('MONDAY',
'DR2101- 0000040','PROV021000
1');
return value is 7 (wrong) -> should be 7.5

hms.jm_doctor.tax is decimal(4,2) and value is 7.50

Anyone know this problem ?

I use ASA 8.03.5223

TIA,


Ichank
-- =

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com