HI
where am I going wrong ?
Here is my code from the asp page to execute the strored proc:
session("db").execute("exe
c bp_createcall '" & callid & "','Addition','" & request("mid") & "','" & session("cscloggeduser") & "','" & request("custid" & cstr(i)) & "','" & request("desc") & "','" + request("add1") & "','" + request("add2") & "','" + request("add3") & "','" & request("refrenceno") & "'")
I am passing 10 arguments.
Here is my strored proc:
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
ALTER procedure [dbo].[BP_createcall]
@callid varchar(8),
@calltype varchar(100),
@custid varchar(100),
@technician varchar(100),
@edc varchar(100),
@desc varchar(1000),
@add1 varchar(100),
@add2 varchar(100),
@add3 varchar(100),
@refrenceno varchar (25)
as
declare @hs int
declare @nowdate varchar(10)
declare @nowtime varchar(8)
declare @pa1 varchar(100)
declare @pa2 varchar(100)
declare @pa3 varchar(100)
declare @pc varchar(10)
declare @a1 varchar(100)
declare @a2 varchar(100)
declare @a3 varchar(100)
declare @country varchar(100)
declare @province varchar(100)
declare @name varchar(100)
declare @trading varchar(100)
declare @status varchar(100)
declare @slazone varchar(100)
declare @city varchar(100)
declare @tel varchar(100)
declare @fax varchar(100)
declare @contact varchar(100)
declare @contactcell varchar(100)
declare @contactemail varchar(100)
declare @bank varchar(100)
declare @application varchar(10)
declare @amex varchar(10)
declare @diners varchar(10)
declare @visa varchar(10)
declare @master varchar(10)
declare @fleet varchar(10)
declare @fastnet varchar(10)
declare @cashback varchar(10)
declare @cashlimit varchar(10)
declare @other varchar(10)
declare @privatelabel varchar(10)
declare @chequeveri varchar(10)
declare @bonus varchar(10)
declare @debitcard varchar(10)
declare @keycard varchar(10)
declare @manualauth varchar(10)
declare @apptype varchar(100)
Declare @userid varchar (10)
declare @termtype varchar(100)
declare @modemtype varchar(100)
declare @merchid varchar(100)
Select @refrenceno=subset.refrenc
eno from inserted
select @a1 = physical_address1,@a2 = physical_address2,@a3 = physical_address3, @pa1 = postal_address1,
@pa2 = postal_address2, @pa3 = postal_address3,@pc = postal_addresscode,@countr
y = country,@province = province,
@name = name,@trading = tradingname,@status = status,@slazone = slazone,@city = city,@tel = telephone,@fax = fax,
@contact = contact,@contactcell = contactcell,@contactemail = contactemail,@bank = bank,@application = application,
@apptype = applicationtype
from profile where custid = @custid
set @hs = datediff(ss,'1970-01-01',g
etutcdate(
))
set @nowdate = convert(varchar(10),getdat
e(),120)
set @nowtime = convert(varchar(8),getdate
(),108)
set @callid = left('00000000',8-len(@cal
lid)) + @callid
if len(@add1) > 0 or len(@add2) > 0 or len(@add3) > 0
begin
set @pa1 = @add1
set @pa2 = @add2
set @pa3 = @add3
end
insert into subset
(custid,
callid,
custtype,
refrenceno,
physical_address1,
physical_address2,
physical_address3,
postal_address1,
postal_address2,
postal_address3,
postal_addresscode,
country,
province,
name,
tradingname,
status,
slazone,
city,
telephone,
fax,
contact,
contactcell,
contactemail,
bank,
application,
applicationtype,
technician)
values
(@custid,
@callid,
'BP',
@refrenceno,
@a1,
@a2,
@a3,
@pa1,
@pa2,
@pa3,
@pc,
@country,
@province,
@name,
@trading,
@status,
@slazone,
@city,
@tel,
@fax,
@contact,
@contactcell,
@contactemail,
@bank,
@application,
@apptype,
@technician)
insert into calllog
(callid,
custid,
custtype,
calltype,
callstatus,
priority,
cduration,
callcount,
stopwatch,
recvddate,
recvdtime,
recvdby,
moddate,
modtime,
modby,
dtlastmod,
callsource,
category,
calldesc,
tracker)
values
(@callid,
@custid,
'BP',
@calltype,
'Open',
'1',
0,
0,
0,
@nowdate,
@nowtime,
@technician,
@nowdate,
@nowtime,
@technician,
@hs,
'Web',
'',
@desc,
@technician)
if not exists(select * from detail where callid = @callid)
begin
if @calltype = 'Addition' or @calltype = 'Installation'
begin
insert into detail (callid,proposed_new_useri
d)
values (@callid,@edc)
end
else
begin
select @termtype = terminaltype, @modemtype = modemtype, @apptype = applicationtype, @merchid = merchantnumber, @userid = userid
from profile where custtype = 'Equipment' and custid = @edc
insert into detail (callid,terminalsn,termina
ltype,mode
mtype,appl
icationtyp
e,merchant
number,use
rid)
values (@callid,@edc,@termtype,@m
odemtype,@
apptype,@m
erchid,@us
erid)
end
end
return @callid
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
Start Free Trial