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.

请教一个游标的问题???

2 posts in General Discussion (Chinese) Last posting was on 2008-04-08 02:37:10.0Z
sunfor Posted on 2007-08-29 08:25:32.0Z
Sender: 9f9.46d52a22.1804289383@sybase.com
From: sunfor
Newsgroups: sybase.public.chinese.powerbuilder.general
Subject: 请教一个游标的问题???
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <46d52d7c.a3a.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 29 Aug 2007 01:25:32 -0700
X-Trace: forums-1-dub 1188375932 10.22.241.41 (29 Aug 2007 01:25:32 -0700)
X-Original-Trace: 29 Aug 2007 01:25:32 -0700, 10.22.241.41
Lines: 33
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.chinese.powerbuilder.general:289
Article PK: 104316

&#25105;&#29992;&#65328;&#65314;&#65304;&#36816;&#34892;&#19979;
&#26426;&#31243;&#24207;&#27491;&#24120;&#65281;
&#20294;&#25105;&#29992;&#65328;&#65314;&#65297;&#65296;&#36816;
&#34892;&#26102;&#26377;&#38382;&#39064;&#65292;&#35831;&#25945;
&#65294;&#65294;&#65294;
declare cur_1 cursor for select cus_code from customer ;
open cur_1;
fetch cur_1 into :cuscode1;
do while sqlca.sqlcode=0
select sum(total) into :tot_total1 from invoice where
cus_code=:cuscode1 using sqlca ;
...
fetch cur_1 into :cuscode1;
loop
close cur_1;

&#24403;&#25105;&#30340;&#34920;customer&#37324;&#25968;&#25454;
&#35760;&#24405;&#23567;&#20110;200&#20010;&#65292;&#29992;&#65328;
&#65314;&#65297;&#65296;&#36816;&#34892;&#23601;&#27491;&#24120;
&#65294;
&#20294;&#24403;&#25105;&#30340;&#34920;customer&#37324;&#25968;
&#25454;&#35760;&#24405;&#22823;&#20110;200&#21040;260&#20010;
&#24038;&#21491;&#26102;&#65292;&#29992;&#65328;&#65314;&#65297;
&#65296;&#36816;&#34892;&#23601;&#19981;&#27491;&#24120;&#65294;
&#25191;&#34892;&#21040;select sum(total) into :tot_total1
from invoice where cus_code=:cuscode1 using sqlca
;&#36825;&#21517;&#26102;&#65292;&#26412;&#26469;sum(total)&#32467;
&#26524;&#26159;&#22823;&#20110;0&#30340;&#65292;&#20294;&#23427;
&#25191;&#34892;&#30340;&#32467;&#26524;&#26159;&#65296;&#65292;
&#22909;&#35937;&#19981;&#25191;&#34892;&#36825;&#34892;&#30340;
&#35821;&#21477;&#65281;&#65281;
&#35831;&#39640;&#25163;&#25351;&#25945;&#65294;&#65294;&#65332;
&#65320;&#65313;&#65326;&#65323;&#65331;&#65281;


hgong Posted on 2008-04-08 02:37:10.0Z
Sender: feb.47face88.1804289383@sybase.com
From: hgong@sybase.com
Newsgroups: sybase.public.chinese.powerbuilder.general
Subject: Re: &#35831;&#25945;&#19968;&#20010;&#28216;&#26631;&#30340;&#38382;&#39064;&#65311;&#65311;&#65311;
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <47fada56.10d1.1681692777@sybase.com>
References: <46d52d7c.a3a.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 7 Apr 2008 19:37:10 -0700
X-Trace: forums-1-dub 1207622230 10.22.241.41 (7 Apr 2008 19:37:10 -0700)
X-Original-Trace: 7 Apr 2008 19:37:10 -0700, 10.22.241.41
Lines: 46
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.chinese.powerbuilder.general:331
Article PK: 104355


> &#25105;&#29992;&#65328;&#65314;&#65304;&#36816;&#34892;
> ;&#19979; &#26426;&#31243;&#24207;&#27491;&#24120;&#65281;
> &#20294;&#25105;&#29992;&#65328;&#65314;&#65297;&#65296;
> ;&#36816; &#34892;&#26102;&#26377;&#38382;&#39064;&#65292;
> ;&#35831;&#25945; &#65294;&#65294;&#65294;
> declare cur_1 cursor for select cus_code from customer ;
> open cur_1;
> fetch cur_1 into :cuscode1;
> do while sqlca.sqlcode=0
> select sum(total) into :tot_total1 from invoice where
> cus_code=:cuscode1 using sqlca ;
> ...
> fetch cur_1 into :cuscode1;
> loop
> close cur_1;
>
> &#24403;&#25105;&#30340;&#34920;customer&#37324;&#25968;
> ;&#25454; &#35760;&#24405;&#23567;&#20110;200&#20010;
> ;&#65292;&#29992;&#65328; &#65314;&#65297;&#65296;&#36816;
> ;&#34892;&#23601;&#27491;&#24120; &#65294;
> &#20294;&#24403;&#25105;&#30340;&#34920;customer&#37324;
> ;&#25968; &#25454;&#35760;&#24405;&#22823;&#20110;
> ;200&#21040;260&#20010; &#24038;&#21491;&#26102;&#65292;
> ;&#29992;&#65328;&#65314;&#65297; &#65296;&#36816;&#34892;
> ;&#23601;&#19981;&#27491;&#24120;&#65294; &#25191;&#34892;
> ;&#21040;select sum(total) into :tot_total1 from invoice
> where cus_code=:cuscode1 using sqlca ;&#36825;&#21517;
> ;&#26102;&#65292;&#26412;&#26469;sum(total)&#32467;
> &#26524;&#26159;&#22823;&#20110;0&#30340;&#65292;&#20294;
> ;&#23427; &#25191;&#34892;&#30340;&#32467;&#26524;&#26159;
> ;&#65296;&#65292; &#22909;&#35937;&#19981;&#25191;&#34892;
> ;&#36825;&#34892;&#30340; &#35821;&#21477;&#65281;&#65281;
> &#35831;&#39640;&#25163;&#25351;&#25945;&#65294;&#65294;
> ;&#65332; &#65320;&#65313;&#65326;&#65323;&#65331;&#65281;

&#20320;&#22909;&#65292;&#19981;&#30693;&#36947;&#20320;&#30340;
&#38382;&#39064;&#35299;&#20915;&#20102;&#27809;&#26377;&#12290;
&#25105;&#22312;pb10.5 Build
4523&#19979;&#35797;&#20102;&#19968;&#19979;&#65292;&#27809;&#26377;
&#21457;&#29616;&#20320;&#25152;&#35828;&#30340;&#38382;&#39064;
&#12290;&#19981;&#30693;&#36947;&#20320;&#29992;&#30340;&#26159;
&#20160;&#20040;&#29256;&#26412;&#12290;&#22914;&#26524;&#26159;
10.5&#20197;&#21518;&#30340;&#29256;&#26412;&#65292;&#33021;&#21542;
&#35831;&#20320;&#25552;&#20379;&#19968;&#20010;test
case&#65292;&#25105;&#20204;&#21487;&#20197;&#24110;&#20320;&#35843;
&#26597;&#19968;&#19979;&#12290;