Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error message for stored procedure...

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
when i try to execute this procedure in ASP, i got this error messsage... i don't know what's wrong.. please, help...
-----------------------------------------------------------
[Microsoft][ODBC driver for Oracle][Oracle]ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'SP_BADWORD' ORA-06550: line 1, column 7: PL/SQL: Statement ignored
-----------------------------------------------------------
create or replace procedure sp_badword( bad_word in varchar2, status out numeric )
is
CURSOR BADWORD_CUR( type_badword sy_badwords.badword%type ) is
select badword from sy_badwords where badword = type_badword;
BADWORD_REC BADWORD_CUR%ROWTYPE;
begin
OPEN BADWORD_CUR( bad_word );
FETCH BADWORD_CUR INTO BADWORD_REC;
IF( BADWORD_CUR%ROWCOUNT > 0 ) THEN
status := 1;
else
status := 0;
end if;
CLOSE BADWORD_CUR;
end;
-----------------------------------------------------------
var oCmd = Server.CreateObject("ADODB.Command");
oCmd.ActiveConnection = Conn;
oCmd.CommandText = "{call sp_badword(?)}";
oCmd.Parameters(0).Value = 'badword';
oRs = oCmd.Execute();
Response.Write( "status = " + oCmd.Parameters(1).Value );
 
I know nothing about those ASP commands you are using to call your procedure, but your error arises because of the parameters you are passing (or failing to pass) to the sp_badword procedure. This procedure, as currently written, takes two parameters, and both must be supplied with the procedure call.

If you were calling your proc from PL/SQL the code would look something like this

declare
badword_status numeric;
begin
sp_badword('XYZ', badword_status);
end;
/

If I'm interpreting your ASP commands correctly, you never pass a variable to sp_badword to hold your return status. It looks as if you're only passing one parameter to the procedure.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top