I'm trying to call a package/procedure in oracle (from an ASP page) which
requires a number of parameters. I have got this working using OO40 but
unfortunately the transaction rollback function doesnt seem to do much.
So I'm now trying to use ADO instead (in the hope that ADO transactions will
work), however I'm getting the above error. My initial searches havent
turned up any suitable suggestions - there appear to be many reasons why
this error might occur - none of which I have found so far fit my situation.
Can anyone suggest where I am going wrong? Better still, can anyone post a
working code snippet that I can use as a model? I already have another [very
similar] function which calls a different package/procedure which works
fine.
Thanks in advance...
CJM
Code Snippets:
PROCEDURE AddSerialToHist ory2(sSerialNo in varchar2, sPartNo in varchar2,
sSequenceNo in number,
sShopOrderNo in varchar2, sLineNo in varchar2, sRelNo in varchar2,
sSuperiorSerial No in varchar2,
sSuperiorPartNo in varchar2, sOrderType in varchar2, sHistoryPurpose in
varchar2, sCurrentPositio n in varchar2,
iResult Out number)
IS
sDesc Varchar2(100) := 'Received into stock against Shop Order ' ||
sShopOrderNo || ', ' || sLineNo || ', ' || sRelNo;
dtDate Date := CURRENT_DATE;
Begin
Insert Into IFSAPP.PART_SER IAL_HISTORY_TAB
(Part_No, Serial_No, Sequence_No, Order_No, Line_No, Release_No,
Transaction_Dat e,
RowVersion, Transaction_Des cription, Order_Type, History_Purpose ,
Current_Positio n, User_Created,
Part_Ownership)
Values
(sPartNo, sSerialNo, sSequenceNo, sShopOrderNo, sLineNo, sRelNo,
dtDate, dtDate, sDesc,
sOrderType, sHistoryPurpose , sCurrentPositio n, 'IFSAPP', 'COMPANY
OWNED');
If SQL%ROWCOUNT = 1 Then
iResult := 0;
--Commit;
Else
iResult := 1;
--Rollback;
End If;
END AddSerialToHist ory2;
Function AddHistory (sSerialNo, sPartNo, sShopOrderNo, sLineNo, sRelNo,
sSuperiorSerial No, sSuperiorPartNo )
Dim iResult2
Dim oParam
With oCmd
.CommandType=ad CmdText
Set oParam = .CreateParamete r("sSerialNo" , adVarchar, adParamInput, 50,
sSerialNo)
.Parameters.App end oParam
Set oParam = .CreateParamete r("sPartNo", adVarchar, adParamInput, 50,
sPartNo)
.Parameters.App end oParam
'Set oParam = .CreateParamete r("sSequenceNo" , adSmallInt, adParamInput,
50, 1)
'.Parameters.Ap pend oParam
Set oParam = .CreateParamete r("sShopOrderNo ", adVarchar, adParamInput,
50, sShopOrderNo)
.Parameters.App end oParam
Set oParam = .CreateParamete r("sLineNo", adVarchar, adParamInput, 50,
sLineNo)
.Parameters.App end oParam
Set oParam = .CreateParamete r("sRelNo", adVarchar, adParamInput, 50,
sRelNo)
.Parameters.App end oParam
Set oParam = .CreateParamete r("sSuperiorSer ialNo", adVarchar,
adParamInput, 50, sSuperiorSerial No)
.Parameters.App end oParam
Set oParam = .CreateParamete r("sSuperiorPar tNo", adVarchar, adParamInput,
50, sSuperiorPartNo )
.Parameters.App end oParam
'Set oParam = .CreateParamete r("sHistoryPurp ose", adVarchar,
adParamInput, 50, "INFO")
'.Parameters.Ap pend oParam
'Set oParam = .CreateParamete r("sCurrentPosi tion", adVarchar,
adParamInput, 50, "InInventor y")
'.Parameters.Ap pend oParam
Set oParam = .CreateParamete r("iResult", adDecimal, adParamReturnVa lue)
.Parameters.App end oParam
'Insert row into SNE (Shop Order)
.CommandText="{ Call ADDROWS.AddSeri alToCatalog(?, ?, 1, ?, ?, ?, ?, ?,
'INFO', 'InInventory', ?)}"
.Execute() '<======= this is where
the error occurs
AddHistory = .Parameters("iR esult").Value
.Parameters.Del ete "sSerialNo"
.Parameters.Del ete "sPartNo"
.Parameters.Del ete "sSequenceN o"
.Parameters.Del ete "sShopOrder No"
.Parameters.Del ete "sLineNo"
.Parameters.Del ete "sRelNo"
.Parameters.Del ete "sSuperiorSeria lNo"
.Parameters.Del ete "sSuperiorPartN o"
.Parameters.Del ete "sHistoryPurpos e"
.Parameters.Del ete "sCurrentPositi on"
.Parameters.Del ete "iResult"
End With
End Function
requires a number of parameters. I have got this working using OO40 but
unfortunately the transaction rollback function doesnt seem to do much.
So I'm now trying to use ADO instead (in the hope that ADO transactions will
work), however I'm getting the above error. My initial searches havent
turned up any suitable suggestions - there appear to be many reasons why
this error might occur - none of which I have found so far fit my situation.
Can anyone suggest where I am going wrong? Better still, can anyone post a
working code snippet that I can use as a model? I already have another [very
similar] function which calls a different package/procedure which works
fine.
Thanks in advance...
CJM
Code Snippets:
PROCEDURE AddSerialToHist ory2(sSerialNo in varchar2, sPartNo in varchar2,
sSequenceNo in number,
sShopOrderNo in varchar2, sLineNo in varchar2, sRelNo in varchar2,
sSuperiorSerial No in varchar2,
sSuperiorPartNo in varchar2, sOrderType in varchar2, sHistoryPurpose in
varchar2, sCurrentPositio n in varchar2,
iResult Out number)
IS
sDesc Varchar2(100) := 'Received into stock against Shop Order ' ||
sShopOrderNo || ', ' || sLineNo || ', ' || sRelNo;
dtDate Date := CURRENT_DATE;
Begin
Insert Into IFSAPP.PART_SER IAL_HISTORY_TAB
(Part_No, Serial_No, Sequence_No, Order_No, Line_No, Release_No,
Transaction_Dat e,
RowVersion, Transaction_Des cription, Order_Type, History_Purpose ,
Current_Positio n, User_Created,
Part_Ownership)
Values
(sPartNo, sSerialNo, sSequenceNo, sShopOrderNo, sLineNo, sRelNo,
dtDate, dtDate, sDesc,
sOrderType, sHistoryPurpose , sCurrentPositio n, 'IFSAPP', 'COMPANY
OWNED');
If SQL%ROWCOUNT = 1 Then
iResult := 0;
--Commit;
Else
iResult := 1;
--Rollback;
End If;
END AddSerialToHist ory2;
Function AddHistory (sSerialNo, sPartNo, sShopOrderNo, sLineNo, sRelNo,
sSuperiorSerial No, sSuperiorPartNo )
Dim iResult2
Dim oParam
With oCmd
.CommandType=ad CmdText
Set oParam = .CreateParamete r("sSerialNo" , adVarchar, adParamInput, 50,
sSerialNo)
.Parameters.App end oParam
Set oParam = .CreateParamete r("sPartNo", adVarchar, adParamInput, 50,
sPartNo)
.Parameters.App end oParam
'Set oParam = .CreateParamete r("sSequenceNo" , adSmallInt, adParamInput,
50, 1)
'.Parameters.Ap pend oParam
Set oParam = .CreateParamete r("sShopOrderNo ", adVarchar, adParamInput,
50, sShopOrderNo)
.Parameters.App end oParam
Set oParam = .CreateParamete r("sLineNo", adVarchar, adParamInput, 50,
sLineNo)
.Parameters.App end oParam
Set oParam = .CreateParamete r("sRelNo", adVarchar, adParamInput, 50,
sRelNo)
.Parameters.App end oParam
Set oParam = .CreateParamete r("sSuperiorSer ialNo", adVarchar,
adParamInput, 50, sSuperiorSerial No)
.Parameters.App end oParam
Set oParam = .CreateParamete r("sSuperiorPar tNo", adVarchar, adParamInput,
50, sSuperiorPartNo )
.Parameters.App end oParam
'Set oParam = .CreateParamete r("sHistoryPurp ose", adVarchar,
adParamInput, 50, "INFO")
'.Parameters.Ap pend oParam
'Set oParam = .CreateParamete r("sCurrentPosi tion", adVarchar,
adParamInput, 50, "InInventor y")
'.Parameters.Ap pend oParam
Set oParam = .CreateParamete r("iResult", adDecimal, adParamReturnVa lue)
.Parameters.App end oParam
'Insert row into SNE (Shop Order)
.CommandText="{ Call ADDROWS.AddSeri alToCatalog(?, ?, 1, ?, ?, ?, ?, ?,
'INFO', 'InInventory', ?)}"
.Execute() '<======= this is where
the error occurs
AddHistory = .Parameters("iR esult").Value
.Parameters.Del ete "sSerialNo"
.Parameters.Del ete "sPartNo"
.Parameters.Del ete "sSequenceN o"
.Parameters.Del ete "sShopOrder No"
.Parameters.Del ete "sLineNo"
.Parameters.Del ete "sRelNo"
.Parameters.Del ete "sSuperiorSeria lNo"
.Parameters.Del ete "sSuperiorPartN o"
.Parameters.Del ete "sHistoryPurpos e"
.Parameters.Del ete "sCurrentPositi on"
.Parameters.Del ete "iResult"
End With
End Function
Comment