Here's my code:
Expand|Select|Wrap|Line Numbers
- DELIMITER $$
- DROP PROCEDURE IF EXISTS `p`.`getNames`$$
- CREATE PROCEDURE `p`.`getNames`(q varchar)
- /*LANGUAGE SQL
- | [NOT] DETERMINISTIC
- | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
- | SQL SECURITY { DEFINER | INVOKER }
- | COMMENT 'string'*/
- BEGIN
- exec q;
- END$$
- DELIMITER ;
for ex: (from the java class)
Expand|Select|Wrap|Line Numbers
- q = "select * from user where username = '"+u+"' AND name = '"+n+"';";
Error Code : 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
/*LANGUAGE SQL
| [NOT] DETERMINISTIC
| { CONTAINS SQL | NO SQL | R' at line 1
there are certain conditions in the java class so q varies depending on the user inputs.
please help me.
Please enclose any code within the proper code tags. See the Posting Guidelines on how to do that. - moderator