Article View: cn.bbs.comp.lang.java
Article #19004java����ε���sqlserver�Ĵ洢���
From: hbc
Date: Tue, 13 Jan 2004 10:36
Date: Tue, 13 Jan 2004 10:36
120 lines
3660 bytes
3660 bytes
����� con = DriverManager.getConnection(strUrl, dbUser,dbPasswd);
CallableStatement call = con.prepareCall("exec weight");
call.execute();
�ڲ�ѯ��������ֱ�����д洢���û������ģ��洢�������Ҫ�ǰ����ű�Ĺ������load����д����һ�ű�ȥ��������java���������ϵ���֮��Ŀ�������ֻЩ����һ������ݡ�������������������û���κ��쳣���������������Ǵ洢��̡�����
.ALTER procedure Weight as
Declare
@StockName varchar(10),
@StockCode Varchar(6),
@Date smalldatetime,
@SG float,
@PG float,
@PGJ float,
@HL float,
@ZF float
DELETE view_stk_right
DECLARE MyCursor CURSOR
for select gpdm, gpmc from gszl where zqlb like '%A��' or zqlb like'%B��'
OPEN MyCursor
FETCH NEXT FROM MyCursor INTO @StockCode, @StockName
while @@FETCH_STATUS = 0
BEGIN
/*
print @stockcode
print len(@stockcode)
print @stockname
print len(@stockname)
*/
if (@stockcode = '000777' or @stockcode='600390' or len(@stockcode) !=6 or len(@stockname) > 4)
begin
FETCH NEXT FROM MyCursor INTO @StockCode, @StockName
continue
end
/*
print @stockcode
print 'eeeeeeeeeeeeeeeeeeeeeeee'
*/
/* �ֺ���� */
DECLARE FH_Cursor CURSOR
for select
cqrq,
sg,
px,
zzg
from fh
where fh.gpdm=@stockcode and cqrq > 0
OPEN FH_Cursor
FETCH NEXT FROM FH_Cursor INTO @Date, @SG, @HL, @ZF
while @@FETCH_STATUS = 0
BEGIN
if (@sg is null or @sg='') select @sg=0.0
if (@hl is null or @hl='') select @hl=0.0
if (@zf is null or @zf='') select @zf=0.0
if (@date is null or @date='') select @date=0
if (@Date > 0 and (@sg > 0 or @hl > 0 or @zf > 0))
INSERT INTO view_stk_right (stockcode, stock_name, VALID_DATE, SG, HL, ZF)
values(@StockCode,@StockName, @Date, @SG, @HL, @ZF)
FETCH NEXT FROM FH_Cursor INTO @Date, @SG, @HL, @ZF
END
CLOSE FH_Cursor
DEALLOCATE FH_Cursor
/* ������ */
/*
DECLARE PG_Cursor CURSOR
for select
cqrq,
pgbl,
zgpgj
from pg
where pg.gpdm=@stockcode and cqrq > 0
OPEN PG_Cursor
FETCH NEXT FROM PG_Cursor INTO @Date, @PG, @PGJ
while @@FETCH_STATUS = 0
BEGIN
if (@pg is null or @pg='') select @pg=0.0
if (@pgj is null or @pgj='') select @pgj=0.0
if (@Date > 0 and @pgj > 0)
INSERT INTO view_stk_right (stockcode, stock_name, valid_date, pg, pgj)
values(@Stockcode, @Stockname, @Date, @PG, @PGJ)
FETCH NEXT FROM PG_Cursor INTO @Date, @PG, @PGJ
END
CLOSE PG_Cursor
DEALLOCATE PG_Cursor
*/
FETCH NEXT FROM MyCursor INTO @StockCode, @StockName
END
CLOSE MyCursor
DEALLOCATE MyCursor
�
--
[m[1;31m�� ��Դ:��Ʈ��ˮ�Ƽ� freecity.cnzju.net��[FROM: hbc][m
Technical Details
Message-ID:
<4AFDOR$9uS@freecity.cnzju.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!c03.atl99!sjc70.webusenet.com!news.webusenet.com!maily.cic.tsinghua.edu.cn!news.ccie.net.cn!FreecityShow Full Headers
Complete Article Headers
X-Google-Language: Chinese,GB X-Google-Thread: f6cb0,e217f134167a7015,start X-Google-Attributes: gidf6cb0,public X-Google-ArrivalTime: 2004-01-13 02:39:43 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!c03.atl99!sjc70.webusenet.com!news.webusenet.com!maily.cic.tsinghua.edu.cn!news.ccie.net.cn!Freecity From: hbc.bbs@freecity.cnzju.net (hbc) Newsgroups: cn.bbs.comp.lang.java Subject: java����ε���sqlserver�Ĵ洢��� Date: 13 Jan 2004 10:36:51 GMT Organization: Ʈ��ˮ�Ƽ� Message-ID: <4AFDOR$9uS@freecity.cnzju.net> Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 8bit X-Filename: Java/M.1073990043.A