SoFunction
Updated on 2025-04-08

Guide to using various stored procedures

<%

'---Start link to the database
Dim strConnString
strConnString = "driver={SQL Server};server=songhp;uid=sa;pwd=;database=XVZDemo"
set Conn = ("")
 strConnstring
'---End link database

'---Start assign values ​​to the input parameters
Dim SelectSql , SelectRs 
Dim SelectID , SelectName , SelectReturn
SelectSql = "Select Max(CompanyID) From Dim_Company"
Set SelectRs = (SelectSql)
SelectID = SelectRs(0)
'---End assign value to the input parameter

Dim TiggerType
TiggerType = 3

Set Cmd = ("") 
Set  = Conn
= 4  '--Declare this procedure as a stored procedure

If TiggerType = 1 then

'---Start a stored procedure call with input parameters
  = "TransCompany1"

 Set CmdParam = ("@TransID",3,1)
  CmdParam
 Cmd("@TransID") = SelectID
 
'---End a stored procedure call with input parameters

Elseif TiggerType = 2 then

'---Start a stored procedure call for an input parameter and an output parameter
  = "TransCompany2"

 Set CmdParamID = ("@TransID",3,1)
  CmdParamID
 Cmd("@TransID") = SelectID
 Set CmdParamName = ("@TransName",202,2,50)
  CmdParamName
 
 SelectName = Cmd("@TransName")
'---End a stored procedure call for an input parameter and an output parameter

Elseif TiggerType = 3 then

'---Start a stored procedure call with an input parameter, an output parameter, and a return value
  = "TransCompany3"
 Set CmdParamReturn = ("Return_Value",3,4)
  CmdParamReturn
 Set CmdParamID = ("@TransID",3,1)
  CmdParamID
 Cmd("@TransID") = SelectID
 Set CmdParamName = ("@TransName",202,2,50)
  CmdParamName

 
 SelectName = Cmd("@TransName")
 SelectReturn = Cmd("Return_Value")
'---End a stored procedure call with an input parameter, an output parameter, and a return value

End if


Set Conn = Nothing
Set Cmd = Nothing
Set CmdParamID = Nothing
Set CmdParamname = Nothing
Set CmdParamReturn = Nothing

%>