Home > database >  Call in the PB have the OUTPUT of the process does not return a value
Call in the PB have the OUTPUT of the process does not return a value

Time:09-25

Process: SQL SERVER 2000
Content:

CREATE PROCEDURE dbo. P_XS_jzgl
@ the users varchar (8000),
@ cw_zs int the OUTPUT
As
SET NOCOUNT ON
Declare @ m int, @ n int, @ user varchar (4000), @ tag1 varchar (2), @ tag2 varchar (2), @ tg1 int, @ tg2 int, @ BLS int, @ cw_bj varchar (200), @ cw_s int
The set @ tag2='"'
The set @ tag1='*'
The set @ m=charindex (@ tag1, @ users)
The set @ n=1
The set @ tg1=0
The set @ BLS=21
The set @ cw_bj='
The set @ cw_s=0
While (@ m & gt; 0)
The begin
Set @ user=the substring (@ users, @ n, @ m - @ n)
The set @ n=@ m + 1
The set @ m=charindex (@ tag1, @ users, @ n)
Int, declare @ k @ j int, @ use varchar (50)
The set @ k=charindex (@ tag2, @ user)
The set @ j=1
The set @ tg2=0
While (@ k> 0)
The begin
Declare @ p_djbh varchar (12), @ p_czrq varchar (10), @ p_splb varchar (10), @ p_spbh varchar (11), @ p_spmc varchar (40), @ p_ckmc varchar (20), @ p_jzfs varchar (10), @ p_hykh varchar (15), @ p_ygbh varchar (8), @ p_beiz varchar (50), @ p_czsj datetime
Declare @ p_sl decimal (9, 1), @ p_xsdj decimal (9, 1), @ p_xszk decimal (9, 1), @ p_xsje decimal (9, 1), @ p_xtdj decimal (9, 1), @ p_xtzk decimal (9, 1), @ p_xtje decimal (9, 1), @ p_jhdj decimal (9, 1), @ p_jhje decimal (9, 1), @ p_lrje decimal (9, 1)
Declare @ p_sfjk varchar (1)
The set @ use=the substring (@ user, @ j, @ k - @ j)
The set @ j=@ k + 1
The set @ k=charindex (@ tag2, @ user, @ j)
The set @ tg2=@ tg2 + 1
If (@ tg2=1)
The begin
The set @ p_djbh=ltrim (rtrim (@ use))
End
If (@ tg2=2)
The begin
The set @ p_czrq=ltrim (rtrim (@ use))
End
If (@ tg2=3)
The begin
The set @ p_splb=ltrim (rtrim (@ use))
End
If (@ tg2=4)
The begin
The set @ p_spbh=ltrim (rtrim (@ use))
End
If (@ tg2=5)
The begin
The set @ p_spmc=ltrim (rtrim (@ use))
End
If (@ tg2=6)
The begin
The set @ p_ckmc=ltrim (rtrim (@ use))
End
If (@ tg2=7)
The begin
The set @ p_jzfs=ltrim (rtrim (@ use))
End
If (@ tg2=8)
The begin
The set @ p_hykh=ltrim (rtrim (@ use))
End
If (@ tg2=9)
The begin
The set @ p_ygbh=ltrim (rtrim (@ use))
End
If (@ tg2=10)
The begin
The set @ p_beiz=ltrim (rtrim (@ use))
End
If (@ tg2=11)
The begin
The set @ p_sl=the CONVERT (a decimal (9, 1), ltrim (rtrim (@ use)))
End
If (@ tg2=12)
The begin
The set @ p_xsdj=the CONVERT (a decimal (9, 1), ltrim (rtrim (@ use)))
End
If (@ tg2=13)
The begin
The set @ p_xszk=the CONVERT (a decimal (9, 1), ltrim (rtrim (@ use)))
End
If (@ tg2=14)
The begin
The set @ p_xsje=the CONVERT (a decimal (9, 1), ltrim (rtrim (@ use)))
End
If (@ tg2=15)
The begin
The set @ p_xtdj=the CONVERT (a decimal (9, 1), ltrim (rtrim (@ use)))
End
If (@ tg2=16)
The begin
The set @ p_xtzk=the CONVERT (a decimal (9, 1), ltrim (rtrim (@ use)))
End
If (@ tg2=17)
The begin
The set @ p_xtje=the CONVERT (a decimal (9, 1), ltrim (rtrim (@ use)))
End
If (@ tg2=18)
The begin
The set @ p_jhdj=the CONVERT (a decimal (9, 1), ltrim (rtrim (@ use)))
End
If (@ tg2=19)
The begin
The set @ p_jhje=the CONVERT (a decimal (9, 1), ltrim (rtrim (@ use)))
End
If (@ tg2=20)
The begin
The set @ p_lrje=the CONVERT (a decimal (9, 1), ltrim (rtrim (@ use)))
End
If (@ tg2=21)
The begin
The set @ p_czsj=the CONVERT (datetime, ltrim (rtrim (@ use)), 20)
End
Print @ use
End
If (@ tg2=@ BLS)
The begin
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - begin to process the data here -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Insert t_yyhzb (document number, date, operation time, the warehouse name, product category, commodity number, name of commodity, quantity, sales price, sales discount, sales amount, replenish onr's stock price, the purchase amount, to return the unit price, return discount, return amount, profit amount, staff number, check way, membership card, note)
Values (@ p_djbh @ p_czrq, @ p_czsj, @ p_ckmc, @ p_splb, @ p_spbh, @ p_spmc, @ p_sl, @ p_xsdj, @ p_xszk, @ p_xsje, @ p_jhdj, @ p_jhje, @ p_xtdj, @ p_xtzk, @ p_xtje, @ p_lrje, @ p_ygbh, @ p_jzfs, @ p_hykh, @ p_beiz)
COMMIT
SELECT @ p_sfjk=whether into library from t_splb where goods category number=@ p_splb
If (@ p_sfjk='1')
The begin
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- inventory quantity and the unit price cursor -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - end -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
If (left (@ p_djbh, 2)='XS')
The begin
INSERT INTO t_cangkumx (warehouse, goods number, name of commodity, specifications, units, operation date, operation time, document number, in this paper, the number of income, income unit price, amount of income, a quantity, unit price, amount, balance amount, balance, sale price, sale amount, commodity price, discounts, note)
Values (@ p_ckmc @ p_spbh, @ p_spmc, ' ', ' ', @ p_czrq, @ p_czsj, @ p_djbh, 'sales', 0, 0, @ p_sl, @ p_jhdj, @ p_jhje, 0, 0, @ p_xsdj, @ p_xsje, @ p_xsdj, 10, @ p_beiz)
COMMIT
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- should add a deadlock or timeout judgment -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- print 'sales warehouse handling'
End
The else
The begin
INSERT INTO t_cangkumx (warehouse, goods number, name of commodity, specifications, units, operation date, operation time, document number, in this paper, the number of income, income unit price, amount of income, a quantity, unit price, amount, balance amount, balance, sale price, sale amount, commodity price, discounts, note)
Values (@ p_ckmc @ p_spbh, @ p_spmc, ' ', ' ', @ p_czrq, @ p_czsj, @ p_djbh, 'sales' @ p_sl, @ p_jhdj, @ p_jhje, 0,0,0,0,0, @ p_xsdj, @ p_xsje, @ p_xsdj, 10, @ p_beiz)
COMMIT
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- should add a deadlock or timeout judgment -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
End
End
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - end of processing data -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
End
The else
The begin
The set @ cw_bj='first' + cast (@ tg2 as varchar (20)) + 'error fields! '
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related