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!

PREPARE statement for DROP PROCEDURE

Status
Not open for further replies.

JJ26

Programmer
Oct 22, 2002
85
ID
Hi there,
is there someone could help me out ? urgent!!!!
is it really a bug or ???
Mysql is in version 5.0.21

i create a procedure which is dynamically dropping existing procedure .
the syntax :
Code:
create procedure checkSP (nmSP varchar(200) )
begin
declare ada int;
set ada = 0;
select count(*) into ada from information_schema.ROUTINES where ROUTINE_NAME = nmSP;

if ada>0 then
  SET @S := concat('Drop procedure `', nmSP , '`;' );
  PREPARE stmt FROM @S;
  EXECUTE stmt;
  DEALLOCATE PREPARE stmt;
  select @S as state;
else
  select 'Error';
end if;

end;

when i set the input parameter to 1 of the existing procedures : CALL checkSP('abc')

it punches an error message
"this command is not supported in the prepared statement protocol yet" errorNo. 1295

but i got read a news of what have been updated in ver 5.0.13 is that the error 1295 already fixed. forget the URL link. and i haven't ask this prob in Mysql official forum.

many thanks from me *JJ*
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top