Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Problem with executing an oracle stored procedure through VB
Hi,
I am having problems running an oracle 8i stored procedure through VB
using MSADORA as the provider. Even though I have correctly specified
the direction and the datatype of the input and the ouput parameter I
am getting the following error when trying to execute the command:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to
'PR_AUDITINGSWITCH'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
This is very bizarre as I have run lots of other oracle procedures with input and output parameters through the application with no problems at all?! Samples of the VB code calling the procedure and the PL/SQL for the stored procedure are below:
VB CODE:
Dim prmSwitch As Parameter
Dim prmAuditSetting As Parameter
Dim comDisableAuditingCommand As New Command
Dim rsDisableAuditingResults As Recordset
Set comDisableAuditingCommand.ActiveConnection = DatabaseConnection
comDisableAuditingCommand.CommandType = adCmdStoredProc
comDisableAuditingCommand.CommandText =
"ARCHIVING_UTIL_PKG.pr_AuditingSwitch"
'Set up the input parameter
Set prmSwitch = comDisableAuditingCommand.CreateParameter("iswitch",
adBoolean, adParamInput)
comDisableAuditingCommand.Parameters.Append prmSwitch
'Set up the output parameter
Set prmAuditSetting =
comDisableAuditingCommand.CreateParameter("oauditsetting", adInteger,
adParamOutput)
comDisableAuditingCommand.Parameters.Append prmAuditSetting
'Set the input parameter to turn auditing off
prmSwitch = False
Set rsDisableAuditingResults = comDisableAuditingCommand.Execute(, , adExecuteNoRecords)
/******************************************************************************/ PROCEDURE pr_auditingswitch ( iswitch IN BOOLEAN, oauditsetting OUT confauditoptions.performauditing%TYPE)
If switch is 1 then switches auditing on If switch is off then switches auding off and saves back setting. Needs a parent (controller) to save original setting Switch BOOLEAN 0=OFF 1=RESTORE
IF iswitch IS NULL THEN RAISE invalid_input_parameter; END IF; IF iswitch = FALSE THEN -- DISABLE AUDITING SELECT performauditing INTO oauditsetting FROM confauditoptions; UPDATE confauditoptions SET performauditing = 0; ELSE -- Restore Auditing IF iswitch THEN UPDATE confauditoptions SET performauditing = 1; END IF; END IF; COMMIT; EXCEPTION WHEN OTHERS THEN ROLLBACK; RAISE;
/******************************************************************************/
Any advice / help is greatly appreciated as this has been bugging me for a couple of days now!
Thanks, Received on Tue Sep 23 2003 - 06:01:51 CDT