Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Buongiorno

4 posts in General Discussion Last posting was on 2005-05-23 03:20:39.0Z
Paperino Posted on 2005-05-09 15:10:36.0Z
From: "Paperino" <paperino@libero.it>
Newsgroups: ianywhere.public.general
Subject: Buongiorno
Lines: 3
Organization: .
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: host253-193.pool21345.interbusiness.it
X-Original-NNTP-Posting-Host: host253-193.pool21345.interbusiness.it
Message-ID: <427f7d6c$1@forums-1-dub>
Date: 9 May 2005 08:10:36 -0700
X-Trace: forums-1-dub 1115651436 213.45.193.253 (9 May 2005 08:10:36 -0700)
X-Original-Trace: 9 May 2005 08:10:36 -0700, host253-193.pool21345.interbusiness.it
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4454
Article PK: 8262

Hei


Chris Keating (iAnywhere Solutions) Posted on 2005-05-09 15:25:39.0Z
From: "Chris Keating \(iAnywhere Solutions\)" <Spam_NoThanks_keating@iAnywhere.com>
Newsgroups: ianywhere.public.general
References: <427f7d6c$1@forums-1-dub>
Subject: Re: Buongiorno
Lines: 11
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-Original-NNTP-Posting-Host: keating-xp2.sybase.com
Message-ID: <427f80ef$1@forums-2-dub>
X-Original-Trace: 9 May 2005 08:25:35 -0700, keating-xp2.sybase.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 9 May 2005 08:25:36 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 9 May 2005 08:25:39 -0700
X-Trace: forums-1-dub 1115652339 10.22.108.75 (9 May 2005 08:25:39 -0700)
X-Original-Trace: 9 May 2005 08:25:39 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4455
Article PK: 8263

Try NEWS.TEST_MESSAGES newsgroup on this server for these sort of test
messages .

"Paperino" <paperino@libero.it> wrote in message
news:427f7d6c$1@forums-1-dub...
> Hei
>
>


Andi Ihsan Posted on 2005-05-23 01:51:11.0Z
From: "Andi Ihsan" <ichank@spymac.com>
Subject: Stored Procrdure
Newsgroups: ianywhere.public.general
References: <427f7d6c$1@forums-1-dub> <427f80ef$1@forums-2-dub>
Organization: AMI
Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Message-ID: <opsq7nncfxhlpfxy@green-soft>
User-Agent: Opera M2/7.54 (Win32, build 3929)
NNTP-Posting-Host: 202.152.162.197
X-Original-NNTP-Posting-Host: 202.152.162.197
Date: 22 May 2005 18:51:11 -0700
X-Trace: forums-1-dub 1116813071 202.152.162.197 (22 May 2005 18:51:11 -0700)
X-Original-Trace: 22 May 2005 18:51:11 -0700, 202.152.162.197
Lines: 93
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4484
Article PK: 8292

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=case upper(@day_name) when 'SUNDAY' then
(select top 1 hms.jm_doctor.tax from
hms.jm_doctor where
hms.jm_doctor.doct_id = @DOCTID and upper(jm_hari) = 'MINGGU' and
hms.jm_doctor.prov_id =
@prov_id)
when 'MONDAY' then(select top 1 hms.jm_doctor.tax from
hms.jm_doctor where
hms.jm_doctor.doct_id = @DOCTID and upper(jm_hari) = 'SENIN' and
hms.jm_doctor.prov_id =
@prov_id)
when 'TUESDAY' then(select top 1 hms.jm_doctor.tax from
hms.jm_doctor where
hms.jm_doctor.doct_id = @DOCTID and upper(jm_hari) = 'SELASA' and
hms.jm_doctor.prov_id =
@prov_id)
when 'WEDNESDAY' then(select top 1 hms.jm_doctor.tax from
hms.jm_doctor where
hms.jm_doctor.doct_id = @DOCTID and upper(jm_hari) = 'RABU' and
hms.jm_doctor.prov_id = @prov_id)
when 'THURSDAY' then(select top 1 hms.jm_doctor.tax from
hms.jm_doctor where
hms.jm_doctor.doct_id = @DOCTID and upper(jm_hari) = 'KAMIS' and
hms.jm_doctor.prov_id =
@prov_id)
when 'FRIDAY' then(select top 1 hms.jm_doctor.tax from
hms.jm_doctor where
hms.jm_doctor.doct_id = @DOCTID and upper(jm_hari) = 'JUMAT' and
hms.jm_doctor.prov_id =
@prov_id)
when 'SATURDAY' then(select top 1 hms.jm_doctor.tax from
hms.jm_doctor where
hms.jm_doctor.doct_id = @DOCTID and upper(jm_hari) = 'SABTU' and
hms.jm_doctor.prov_id =
@prov_id)
end
return(@tax_Jm)
end

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

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

Table Structure :
create table hms.JM_DOCTOR
(
JM_ID varchar(20) not null,
JM_HARI varchar(15) not null,
jm_pagi numeric(5,2) not null,
jm_siang numeric(5,2) not null,
jm_malam numeric(5,2) not null,
DOCT_ID varchar(20) not null,
LAST_USER varchar(25) not null,
LAST_UPDATE timestamp not null,
prov_id varchar(20) not null,
jmtd_pagi numeric(5,2),
jmtd_siang numeric(5,2),
jmtd_malam numeric(5,2),
jm_paramedik numeric(5,2),
TAX decimal(4,2),
primary key (JM_ID)
);

Data :

INSERT INTO hms.JM_DOCTOR (
JM_ID,JM_HARI,jm_pagi,jm_siang,jm_malam,DOCT_ID,LAST_USER,LAST_UPDATE,prov_i
d,jmtd_pagi,jmtd_siang,jmtd_malam,jm_paramedik,TAX ) VALUES (
'JM2101-0000680','Minggu',65,80,80,'DR2101-0000040','ZAINAL','14/05/2005
3:35:00 PM','PROV0210001',85,85,85,13.5,7.5 );

I use ASA 8.03.5223

Problem why return value is integer ... not a decimal

TIA,


Ichank
--
Ichank
Amarta Media Internusa
ASO Health Consulting


Greg Fenton Posted on 2005-05-23 03:20:39.0Z
From: Greg Fenton <greg.fenton_NOSPAM_@ianywhere.com>
Organization: iAnywhere Solutions Inc.
User-Agent: Mozilla Thunderbird 1.6.3.2f (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: Stored Procrdure
References: <427f7d6c$1@forums-1-dub> <427f80ef$1@forums-2-dub> <opsq7nncfxhlpfxy@green-soft>
In-Reply-To: <opsq7nncfxhlpfxy@green-soft>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vpn-concord-085.sybase.com
X-Original-NNTP-Posting-Host: vpn-concord-085.sybase.com
Message-ID: <42914c07@forums-1-dub>
Date: 22 May 2005 20:20:39 -0700
X-Trace: forums-1-dub 1116818439 158.159.8.85 (22 May 2005 20:20:39 -0700)
X-Original-Trace: 22 May 2005 20:20:39 -0700, vpn-concord-085.sybase.com
Lines: 42
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4485
Article PK: 8290


Andi Ihsan wrote:
>
> Create procedure hms.tax_dokter(@day_name varchar(20),@DOCTID
> varchar(20),@prov_id varchar(20))
> as
> begin
> declare @tax_Jm decimal(4,2)
> [...]
> return(@tax_Jm)

From the ASA 8.x online docs:

Adaptive Server Anywhere SQL Reference Manual
4. SQL Statements
- RETURN statement

"Within a procedure, RETURN is used for Transact-SQL-compatibility,
and is used to return an integer error code."

So that is why the value is returned as an integer. RETURN in a
procedure is only used to return an ERROR CODE.

To return a value, you must specify an OUTPUT parameter in your stored
procedure parameter list. See:

Adaptive Server Anywhere SQL Reference Manual
4. SQL Statements
- CREATE PROCEDURE statement [T-SQL]

So add an OUTPUT parameter to your CREATE PROCEDURE statement and SELECT
INTO that parameter instead of using RETURN.

Hope this helps,
greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/