使用VBSript写入Oracle的精度值无效

时间:2016-06-22 15:31:26

标签: oracle vbscript oracle11g asp-classic

因为昨天你们都把我引向了正确的方向,所以我回来了。我正在从Windows 2003迁移到Windows 2012.一些小而重要的应用程序是用asp(VBScript)和Oracle 11g DB编写的。许多数据库调用都失败了。最新的是程序调用。我不写VBScript,所以我在这里挣扎。驱动程序是OraClient11g_home2中的Oracle

提前致谢。

字段:

 'P_PAX_ID                       NUMBER(5)               IN
 'P_YEAR                         VARCHAR2(4)             IN
 'P_CARDNUMBER                   VARCHAR2(16)            IN
 'P_EXPDATE                      VARCHAR2(4)             IN
 'P_PREFIX                       VARCHAR2(5)             IN
 'P_FIRST_NAME                   VARCHAR2(20)            IN
 'P_LAST_NAME                    VARCHAR2(20)            IN
 'P_SUFFIX                       VARCHAR2(5)             IN
 'P_ADDRESS                      VARCHAR2(100)           IN
 'P_CITY                         VARCHAR2(30)            IN
 'P_STATE                        VARCHAR2(2)             IN
 'P_ZIP                          VARCHAR2(9)             IN
 'P_AMT                          NUMBER(10,2)            IN
 'P_STATUS                       VARCHAR2(10)            IN
 'P_SOURCE                       VARCHAR2(1)             IN
 'P_CC_ID                        NUMBER(10)              OUT
 'P_ERR_CD                       VARCHAR2                OUT
 'P_ERR_MSG                      VARCHAR2                OUT
 'P_ACCT_ID                      VARCHAR2(4)             IN     DEFAULT
 'P_BATCH_ID                     NUMBER(5)               IN     DEFAULT
 'P_BATCH_ITEM                   NUMBER(3)               IN     DEFAULT
 'P_BATCH_DT                     DATE                    IN     DEFAULT
 'P_VERISIGN_RESULT              NUMBER(10)              IN     DEFAULT
 'P_VERISIGN_PNREF               VARCHAR2(12)            IN     DEFAULT
 'P_VERISIGN_RESPMSG             VARCHAR2(2000)          IN     DEFAULT
 'P_VERISIGN_CARDSECURE          VARCHAR2(1)             IN     DEFAULT

代码:

With cmdCCpayment
    .CommandText = "{call package.procedure( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? )}"
    .CommandType = 1 'adCmdText
    .ActiveConnection= objConnSessionAuth
    'P_PAX_ID
    .Parameters(0).Type = 131  'adNumeric
    .Parameters(0).Direction = 1  'adParamInput
    .Parameters(0).Value = session("pax_id")
    'P_YEAR
    .Parameters(1).Type = 200  'adVarChar
    .Parameters(1).Direction = 1  'adParamInput
    .Parameters(1).Value = session("user_year")         'session("user_year")
    'P_CARDNUMBER
    .Parameters(2).Type = 200  'adVarChar
    .Parameters(2).Direction = 1  'adParamInput
    .Parameters(2).Value = Session("cc_number")
    'P_EXPDATE
    .Parameters(3).Type = 200  'adVarChar
    .Parameters(3).Direction = 1  'adParamInput
    .Parameters(3).Value = Session("cc_exp_month") & Session("cc_exp_year")
    'P_PREFIX
    .Parameters(4).Type = 200  'adVarChar
    .Parameters(4).Direction = 1  'adParamInput
    .Parameters(4).Value = Session("cc_prefix")
    'P_FIRST_NAME
    .Parameters(5).Type = 200  'adVarChar
    .Parameters(5).Direction = 1  'adParamInput
    .Parameters(5).Value = Session("cc_f_name")
    'P_LAST_NAME
    .Parameters(6).Type = 200  'adVarChar
    .Parameters(6).Direction = 1  'adParamInput
    .Parameters(6).Value = Session("cc_l_name")
    'P_SUFFIX
    .Parameters(7).Type = 200  'adVarChar
    .Parameters(7).Direction = 1  'adParamInput
    .Parameters(7).Value = Session("cc_suffix")
    'P_ADDRESS
    .Parameters(8).Type = 200  'adVarChar
    .Parameters(8).Direction = 1  'adParamInput
    .Parameters(8).Value = Session("cc_address")
    'P_CITY
    .Parameters(9).Type = 200  'adVarChar
    .Parameters(9).Direction = 1  'adParamInput
    .Parameters(9).Value = Session("cc_city")
    'P_STATE
    .Parameters(10).Type = 200  'adVarChar
    .Parameters(10).Direction = 1  'adParamInput
    .Parameters(10).Value = Session("cc_state")
    'P_ZIP
    .Parameters(11).Type = 200  'adVarChar
    .Parameters(11).Direction = 1  'adParamInput
    .Parameters(11).Value = Session("cc_zip")
    'P_AMT
    .Parameters(12).Type = 131  'adNumeric
    .Parameters(12).Direction = 1  'adParamInput
    .Parameters(12).Value = Session("cc_amt")
    'P_STATUS
    .Parameters(13).Type = 200  'adVarChar
    .Parameters(13).Direction = 1  'adParamInput
    .Parameters(13).Value = "PENDING"
    'P_SOURCE
    .Parameters(14).Type = 200  'adVarChar
    .Parameters(14).Direction = 1  'adParamInput
    .Parameters(14).Value = P_SOURCE
    'P_CC_ID
    .Parameters(15).Type =  131  'adNumeric
    .Parameters(15).Direction = 2  'adParamOutput
    'P_ERR_CD
    .Parameters(16).Type =  200  'adVarChar
    .Parameters(16).Direction = 2  'adParamOutput
    'P_ERR_MSG
    .Parameters(17).Type =  200  'adVarChar
    .Parameters(17).Direction = 2  'adParamOutput
End With



I HOPE THIS HELPS. I'm not and asp guy. I'm at my wits end.

Dim objConnSessionAuth
Set objConnSessionAuth = CreateObject("ADODB.Connection")
strConn2 = "DSN=*****;"
strConn2 = strConn2 & "PWD=" & userpassword & ";" 
strConn2 = strConn2 & "UID=" & userid & ";" 
'strConn2 = strConn2 & "SERVER=" & varEnvironment & ";" 'this is set to dev or prod
'objConnSessionAuth.Provider="MSDASQL.1"

objConnSessionAuth.ConnectionString=strConn2
'objConnSessionAuth.ConnectionString=strConn2
objConnSessionAuth.CursorLocation=3 'adUseClient
'to open this connection call this line
objConnSessionAuth.Open


Dim cmdCCpayment
Set cmdCCpayment = Server.CreateObject("ADODB.Command")

With cmdCCpayment
    .CommandText = "{call package.procedure( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? )}"
    .CommandType = 1 'adCmdText
    .ActiveConnection= objConnSessionAuth
    'P_PAX_ID
    .Parameters(0).Type = 131  'adNumeric
    .Parameters(0).Direction = 1  'adParamInput
    .Parameters(0).Value = session("pax_id")
    'P_YEAR
    .Parameters(1).Type = 200  'adVarChar
    .Parameters(1).Direction = 1  'adParamInput
    .Parameters(1).Value = session("user_year")         'session("user_year")
    'P_CARDNUMBER
    .Parameters(2).Type = 200  'adVarChar
    .Parameters(2).Direction = 1  'adParamInput
    .Parameters(2).Value = Session("cc_number")
    'P_EXPDATE
    .Parameters(3).Type = 200  'adVarChar
    .Parameters(3).Direction = 1  'adParamInput
    .Parameters(3).Value = Session("cc_exp_month") & Session("cc_exp_year")
    'P_PREFIX
    .Parameters(4).Type = 200  'adVarChar
    .Parameters(4).Direction = 1  'adParamInput
    .Parameters(4).Value = Session("cc_prefix")
    'P_FIRST_NAME
    .Parameters(5).Type = 200  'adVarChar
    .Parameters(5).Direction = 1  'adParamInput
    .Parameters(5).Value = Session("cc_f_name")
    'P_LAST_NAME
    .Parameters(6).Type = 200  'adVarChar
    .Parameters(6).Direction = 1  'adParamInput
    .Parameters(6).Value = Session("cc_l_name")
    'P_SUFFIX
    .Parameters(7).Type = 200  'adVarChar
    .Parameters(7).Direction = 1  'adParamInput
    .Parameters(7).Value = Session("cc_suffix")
    'P_ADDRESS
    .Parameters(8).Type = 200  'adVarChar
    .Parameters(8).Direction = 1  'adParamInput
    .Parameters(8).Value = Session("cc_address")
    'P_CITY
    .Parameters(9).Type = 200  'adVarChar
    .Parameters(9).Direction = 1  'adParamInput
    .Parameters(9).Value = Session("cc_city")
    'P_STATE
    .Parameters(10).Type = 200  'adVarChar
    .Parameters(10).Direction = 1  'adParamInput
    .Parameters(10).Value = Session("cc_state")
    'P_ZIP
    .Parameters(11).Type = 200  'adVarChar
    .Parameters(11).Direction = 1  'adParamInput
    .Parameters(11).Value = Session("cc_zip")
    'P_AMT
    .Parameters(12).Type = 131  'adNumeric
    .Parameters(12).Direction = 1  'adParamInput
    .Parameters(12).Value = Session("cc_amt")
    'P_STATUS
    .Parameters(13).Type = 200  'adVarChar
    .Parameters(13).Direction = 1  'adParamInput
    .Parameters(13).Value = "PENDING"
    'P_SOURCE
    .Parameters(14).Type = 200  'adVarChar
    .Parameters(14).Direction = 1  'adParamInput
    .Parameters(14).Value = P_SOURCE
    'P_CC_ID
    .Parameters(15).Type =  131  'adNumeric
    .Parameters(15).Direction = 2  'adParamOutput
    'P_ERR_CD
    .Parameters(16).Type =  200  'adVarChar
    .Parameters(16).Direction = 2  'adParamOutput
    'P_ERR_MSG
    .Parameters(17).Type =  200  'adVarChar
    .Parameters(17).Direction = 2  'adParamOutput
End With

objConnSessionAuth.BeginTrans
cmdCCpayment.Execute
objConnSessionAuth.CommitTrans

1 个答案:

答案 0 :(得分:0)

"字段"显示IN或OUT表示它们是作为程序的参数。 PL / SQL过程参数必须具有数据类型,但不允许具有大小或精度和比例。