SQL语句:exec newresv 'S184306','小海',2,0,'2011-08-17','2011-08-18','','','','',1,'BK','13691196986','','','','','','','','男','','','','','13691196986','kenshin'
这个语句是执行的插入功能的。
其他的SQL存储过程都运行成功。都是一些查询的功能。而且PHP的mssql_query执行这个语句都没有报错~~这个怎么改呀
这个语句是执行的插入功能的。
其他的SQL存储过程都运行成功。都是一些查询的功能。而且PHP的mssql_query执行这个语句都没有报错~~这个怎么改呀
,是存储过程?
存储过程mysql需要call的
其次就是这个语句放到SQL SERVER里的查询分析器里运行是可以的
@resv_num char(9),
@acct_nm char(60),
@gst_nums int,
@chld_nums int,
@arr_dt smalldatetime,
@dpt_dt smalldatetime,
@rm_num char(6),
@geo1 char(3),
@geo2 char(4),
@notice char(254),
@rm_nums int,
@rm_typ char(5),
@phone char(24),
@fax char(12),
@email char(40),
@resv_typ char(2),
@crtf_typ char(3),
@crtf_num char(20),
@ic_num char(12),
@gh_num char(9),
@sex_cd char(2),
@crdt_cd char(3),
@addr char(50),
@postal char(6),
@lang_cd char(2),
@mobile char(16),
@orgsale_nm char(20)
AS
DECLARE @tempnum int,
@shr_num char(9),
@acct_num char(9),
@gh_flg char(1),
@rt_cd char(6),
@rt_amt decimal(9,2) /*取得合住号*/
Select @tempnum=acct_num+1,@shr_num=prefix from acctnum where num_typ='4'
update acctnum set acct_num=@tempnum where num_typ='4'
Select @shr_num=RTrim(@shr_num)+convert(char,@tempnum) /*取得宾客帐号*/
Select @tempnum=acct_num+1,@acct_num=prefix from acctnum where num_typ='1'
Update acctnum set acct_num=@tempnum where num_typ='1'
Select @acct_num=rtrim(@acct_num)+convert(char,@tempnum) /*取得房价代码*/
if RTrim(@ic_num)<>''
select @rt_cd=rt_cd from htlfavor where favor_typ='2' and rec_typ='1' and rm_nums=1
and rm_typ=@rm_typ and favor_cd in (select favortmpl_cd from icacct where ic_num=@ic_num)
else
set @rt_cd='*RR' if @rt_cd is null
set @rt_cd='*RR'
/*取得房价*/
select @rt_amt=sgl_rt from sysconf where para_typ='02' and subcd_flg='1' and rt_typ='1'
and from_dt<=@arr_dt and rm_typ=@rm_typ and para_cd=@rt_cd
order by from_dt desc if @rt_amt is null
set @rt_amt=0 If @gh_num<>''
Set @gh_flg='2' /*插入帐户文件*/
insert into account
(acct_stus,definite_flg,
resv_num,shr_num,acct_num,
acct_nm,gst_nums,chld_nums,arr_dt,dpt_dt,rm_num,geo1,geo2,geo3,
arr_tm,arr_crr,arr_flt,phone,org_oper,notice,org_dt,org_cd,et_cd,acct_typ,comp_flg,
acct_flg,ta_flg,rmtax_cd,tele_typ,rm_nums,pay_flg,bld_cd,rm_typ,rt_cd,rt_amt,resv_typ,crtf_typ,crtf_num,ic_num,fax,email,partner_flg,gh_num,gh_flg,sex_cd,crdt_cd,addr,postal,
valid_nums,rs_cd,visa_typ,lang_cd,wherefrom,whereto,stay_rs,no_post,no_prt,no_tax,recpt_num,
internet_typ,vod_typ,ar_num,contract_num,contact_num,vip,vip_flg,
entryport,entry_dt,company_num,dpt_flt,dpt_tm,gstarr_tm,gstdpt_tm,usernm,mobile,book_nm)
values
('1','0',
@resv_num,@shr_num,@acct_num,
@acct_nm,@gst_nums,@chld_nums,@arr_dt,@dpt_dt,@rm_num,@geo1,@geo2,'',
'','','',@phone,'web',@notice,GETDATE(),'','','','0',
'3','0','','5',@rm_nums,'1','',@rm_typ,@rt_cd,@rt_amt,@resv_typ,@crtf_typ,@crtf_num,@ic_num,@fax,@email,0,@gh_num,@gh_flg,@sex_cd,@crdt_cd,@addr,@postal,
0,'','',@lang_cd,'','','','0','0','0','',
'','','','','','','0',
'','1900-01-01','','','','','','1',@mobile,@orgsale_nm) /*插入锁房文件*/
insert into houseblock
(resv_num,shr_num,definite_flg,acct_stus,rm_typ,orgrm_nums,rm_nums,
arr_dt,dpt_dt,rm_num,acct_typ,acct_flg,et_cd,org_cd,orgdpt_dt,bld_cd)
values
(@resv_num,@shr_num,'0','1', @rm_typ,0,@rm_nums,
@arr_dt,@dpt_dt,@rm_num,'','3','','',@dpt_dt,'') select @acct_num as acct_numGO这个是提供给的存储过程