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.

retrieve problem

2 posts in Objects Last posting was on 2002-07-25 19:00:06.0Z
irene Posted on 2002-07-25 16:32:20.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "irene" <kirene@aol.com>
Organization: 12.35.132.10
X-Newsreader: AspNNTP 1.50 (C I Host)
Subject: retrieve problem
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Date: Thu, 25 Jul 2002 12:32:20 -0400
Lines: 53
NNTP-Posting-Host: 66.221.40.1
Message-ID: <364_y9MIZj$MCHA.582@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:1075
Article PK: 713642

Hi to all:
I have a questions and i really need help on that. Please help me....
I have to export the checkin days from the database days of the week..
i have store in the database 7 days
Sunday id 1
monday id 2
tuesday id 3
wednsday id 4
thursday id 5
friday id 6
saturday id 7
it is like week start from sunday.... when i retrieve the data from the database
i'm using the cursor for that... it is retrieve like if the checkin days is
Monday,Saturday,Sunday instead that order it is retrieve for me like
Saturday,Sunday,Monday and if i'm trying to do any order it is not right.
I think it is should be retrieve in array to get right but i do not know how...
i never did this brfore please if someone know how i have to do this please tell
me

This is a code what i'm using for that....
Long ll_comid
Long ll_lang_id
Long ll_len
String ls_rtn
String sz_chkin
String ls_delimeter



ll_lang_id = inv_lang_id

ll_comid = dw_com_id.Getitemnumber(1,'com_id')

ls_delimeter = char(9)



DECLARE checkin_cur CURSOR FOR



SELECT trim(CHEDES2_TEXT)
FROM CHECKIN_DESC2,
CHECKIN
WHERE CHEDES2_ID = CHE_ID and che_com_id = :ll_comid
and chedes2_lang_id = :ll_lang_id

USING sqlca;




OPEN checkin_cur;

FETCH checkin_cur

INTO :sz_chkin;

ls_rtn = ''


do While sqlca.SQLCode = 0

if (sz_chkin <> '') and len(sz_Chkin) > 1 then

ls_rtn = ls_rtn + trim(sz_chkin) + ', '
end if

FETCH checkin_cur INTO :sz_chkin;
Loop

Close checkin_cur;



ls_rtn = trim(ls_rtn)

ll_len = len(ls_rtn)

if (ll_len > 0) then


IF Right (ls_rtn, 1) = ',' THEN
ls_rtn = Left (ls_rtn, Len (ls_rtn) - 1)
END IF
END IF




return ls_rtn
Thank you.














---== Posted via the PFCGuide Web Newsreader ==---
http://www.pfcguide.com/_newsgroups/group_list.asp


---== Posted via the PFCGuide Web Newsreader ==---
http://www.pfcguide.com/_newsgroups/group_list.asp


Millard F. Brown III [TeamSybase] Posted on 2002-07-25 19:00:06.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Millard F. Brown III [TeamSybase]" <millard.brown@teamsybase.com>
Subject: Re: retrieve problem
Date: Thu, 25 Jul 2002 15:00:06 -0400
Lines: 142
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
NNTP-Posting-Host: pcp01389185pcs.walngs01.pa.comcast.net 68.80.176.223
Message-ID: <364_jIokKEBNCHA.195@forums.sybase.com>
References: <364_y9MIZj$MCHA.582@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:1074
Article PK: 713636

Irene,

Is there any reason you can't retrieve these values into a datawindow or
datastore and loop through the retrieved rows? If so, you can set the sort
and joins up very easily to get exactly the data you want, in the sort order
you want. Otherwise, you can put an ORDER BY clause in your SQL to get the
data sorted by the id.

--
Regards,
Millard[TeamSybase]
Power3, LLC
http://www.power3.com

Useful links:
NEW PB9 Book Information: http://www.pb9book.com
My Sybase: http://my.sybase.com
SDN: http://www.sybase.com/developer
Google search: http://groups.google.com

"irene" <kirene@aol.com> wrote in message
news:y9MIZj$MCHA.582@forums.sybase.com...
> Hi to all:
> I have a questions and i really need help on that. Please help me....
> I have to export the checkin days from the database days of the week..
> i have store in the database 7 days
> Sunday id 1
> monday id 2
> tuesday id 3
> wednsday id 4
> thursday id 5
> friday id 6
> saturday id 7
> it is like week start from sunday.... when i retrieve the data from the
database
> i'm using the cursor for that... it is retrieve like if the checkin days
is
> Monday,Saturday,Sunday instead that order it is retrieve for me like
> Saturday,Sunday,Monday and if i'm trying to do any order it is not right.
> I think it is should be retrieve in array to get right but i do not know
how...
> i never did this brfore please if someone know how i have to do this
please tell
> me
>
> This is a code what i'm using for that....
> Long ll_comid
> Long ll_lang_id
> Long ll_len
> String ls_rtn
> String sz_chkin
> String ls_delimeter
>
>
>
> ll_lang_id = inv_lang_id
>
> ll_comid = dw_com_id.Getitemnumber(1,'com_id')
>
> ls_delimeter = char(9)
>
>
>
> DECLARE checkin_cur CURSOR FOR
>
>
>
> SELECT trim(CHEDES2_TEXT)
> FROM CHECKIN_DESC2,
> CHECKIN
> WHERE CHEDES2_ID = CHE_ID and che_com_id = :ll_comid
> and chedes2_lang_id = :ll_lang_id
>
> USING sqlca;
>
>
>
>
> OPEN checkin_cur;
>
> FETCH checkin_cur
>
> INTO :sz_chkin;
>
> ls_rtn = ''
>
>
> do While sqlca.SQLCode = 0
>
> if (sz_chkin <> '') and len(sz_Chkin) > 1 then
>
> ls_rtn = ls_rtn + trim(sz_chkin) + ', '
> end if
>
> FETCH checkin_cur INTO :sz_chkin;
> Loop
>
> Close checkin_cur;
>
>
>
> ls_rtn = trim(ls_rtn)
>
> ll_len = len(ls_rtn)
>
> if (ll_len > 0) then
>
>
> IF Right (ls_rtn, 1) = ',' THEN
> ls_rtn = Left (ls_rtn, Len (ls_rtn) - 1)
> END IF
> END IF
>
>
>
>
> return ls_rtn
> Thank you.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> ---== Posted via the PFCGuide Web Newsreader ==---
> http://www.pfcguide.com/_newsgroups/group_list.asp
>
>
> ---== Posted via the PFCGuide Web Newsreader ==---
> http://www.pfcguide.com/_newsgroups/group_list.asp