sql >> Base de Datos >  >> RDS >> Oracle

ASP clásico llamando al procedimiento almacenado de Oracle con el controlador OraOleadb

Según esta página , tipo de parámetro adVariant (es decir, 12) no es compatible con ADO.

Debe usar constantes para que su código sea más legible, p.

Const adUseClient = 3
Const adOpenStatic = 3
Const adCmdText = 1
Const adCmdStoredProc = 4

Const adVarChar = 200 
Const adNumeric = 131 
Const adChar = 129
Const adBigInt = 20 
Const adInteger = 3

Const adParamInput = 1
Const adParamOutput = 2
Const adParamInputOutput = 3
Const adParamReturnValue = 4

cmd.Parameters.Append cmd.CreateParameter("theAccountId", adVarChar, adParamInput, , Request.Form ("aid"))
cmd.Parameters.Append cmd.CreateParameter("theAwardId", adNumeric, adParamInput, , award_id)
cmd.Parameters.Append cmd.CreateParameter("theDueDate", adVarChar, adParamInput, 100, theDueDt)
cmd.Parameters.Append cmd.CreateParameter("theSubmittedDate", adVarChar, adParamInput, 100, theSubmittedDt)
cmd.Parameters.Append cmd.CreateParameter("theReportDescription", adVarChar, adParamInput, 100, theReportDesc)
cmd.Parameters.Append cmd.CreateParameter("theFormId", adVarChar, adParamInput, 100, theFrmId)
cmd.Parameters.Append cmd.CreateParameter("theReturnCode", adNumeric, adParamOutput)

Quizás pruebe con este:

cmd.CommandType = adCmdText
cmd.CommandText = "{CALL deadlines_summary.PR_SUMMARY_IN(?,?,?,?,?,?,?)}"

Los parámetros numéricos no requieren un valor de tamaño.

También debe intentar usar el tipo de parámetro adDate en lugar de convertir las fechas en valores de cadena.

Debe eliminar las comillas cuando use el parámetro de vinculación, es decir, use simplemente theSubmittedDt = submitted_date en lugar de theSubmittedDt = "'" & submitted_date & "'" .