MySQL Cursor with Procedure problem...Error code: 1064

I am new to mysql. I am developing a procedure by using cursor inside. But i got 1064 error. I tried my level best to figure it out. But i failed.
Please let me know i did the mistake in the code.
Code
-----
DELIMITER$$
CREATE PROCEDURE GetLoginUserDetails(IN uname VARCHAR(45),IN pwd VARCHAR(45),OUT retsts INTEGER,OUT uid INTEGER,OUT username VARCHAR(45),OUT unum INT)
BEGIN
SET retsts=0;
DECLARE loginCur CURSOR FOR SELECT user_id,user_name,user_num FROM user_tbl WHERE user_name=uname AND password=pwd;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET retsts=1;
DECLARE CONTINUE HANDLER FOR SQLSTATE '23000' SET retsts=1;

OPEN loginCur;
IF NOT retsts=1 THEN
FETCH logincur INTO uid,username,unum;
END IF;
CLOSE loginCur;
END$$
DELIMITER;

ERROR:
---------
Script line: 2 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 'DECLARE loginCur CURSOR FOR SELECT user_id,user_name,user_num FROM user_tbl WHER' at line 4

Table
-----
user_tbl
=========
user_id(pk)
user_name
password
user_num
user_status
role_id

MySQL Strange query problem. Error 1064,

I have this query: SELECT fldid AS transid FROM tbltrans WHERE ( flduser LIKE '' OR fldip LIKE '127.0.0.1' ) AND NOT ( EXISTS ( SELECT fldid FROM tbldataint WHERE fldtrans = transid AND ( flduser NOT LIKE '' OR fldip NOT LIKE '127.0.0.1' ) ) and it returns error 1064 - at the last line ... says .. c ...

MySQL Help about Trigger + user defined variables + Error Code : 1064

I am newbe about databases and I am starting with mysql. I have a trouble with trigger: I wrote a working trigger which II would like to make more general using user defined variables in the trigger. The working trigger is: DELIMITER $$; CREATE TRIGGER `db_LabELT`.`ins_synch_status_prefix ` AFTER IN ...

MySQL Error Code : 1064 You have an error in your SQL syntax

I am not a newbie to SQL but this error is baffling me! I just downloaded the latest version of MySql for Windows 5.0. I've tried setting the delimitor but it makes no difference! DELIMITER ; create procedure abc() begin declare myvar INT; end; /*Error Code : 1064 You have an error in your SQL synta ...

MySQL Please Help Error Code: 1064

...

Java MySQL Error Code: 1064:You have an error in your SQL syntax

I am currently develop a program using MySQL and Java. I'm creating database in MySQL with this script: create table xxx (seq_no int(11) auto_increment primary key, ip varchar(20) character set utf8, desc varchar(100) character set utf8, time timestamp(8)) engine="ARCHIVE"; But when I want ...

MySQL Error Code : 1064

Getting the following error: 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 'END' at line 5 With the following trigger: CREATE TRIGGER `polymer`.`Avail_Weight` BEFORE INSERT ON `polymer`.`invento ...

MySQL syntax error code #1064 (newbie)

all i get a error trying to get my script online here is the eror #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 '`soort` int(3) NOT NULL default '0', `schade` int(3) NOT NULL default '', ' at line 3 and h ...

MySQL Error Code : 1064.check the manual ... to use near 'DELIMITER $$

Hy, Im doing the next: DELIMITER $$ CREATE DEFINER=`root`@`%` PROCEDURE `EpisodiosProcedure`(IN EPIS_ID INTEGER) BEGIN DECLARE txn_error INTEGER DEFAULT 0 ; DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN SET txn_error = 1; END; SAVEPOINT EPISAVEPOINT; INSERT INTO sene3_visitas_ant (AVISI_ID, AVISI_ ...

MySQL cursor not open error (error code :1326)

Im trying to run the follwing procedure : delimiter // Create procedure cur1() begin DECLARE custid int; Declare no_rows boolean default false; DECLARE c1 cursor for select customerID from master; declare continue handler for not found set no_rows := TRUE; OPEN c1; read_loop: LOOP fetch c1 into cust ...

Error Code: 1064 in mysql when calling stored procdure

I created a procedure that is supposed to do some operation but every time I call it, mysql comes out with an error, which I have not clue what it means. I have tried to understand it in vain, here 's the table structure which the stored procedure where made to do an operation on it: CREATE TABLE `r ...

MySQL Help with Error Code: 1064.

I'm getting an Error code: 1064 when I try to create the following table: It says it is at or near line 6 which is the email field. Any ideas? CREATE TABLE IF NOT EXISTS `users` ( `id` int(11) NOT NULL auto_increment, `username` varchar(32) NOT NULL, `password` varchar(32) NOT NULL, `online` int(20) ...

MySQL Stored Procedure problem

I an a newbie in MYSQL and I have to write a stored prcedure. Below is my code. It is not working and am getting an error 1064 in the all these lines. Would appreciate ur help. CREATE PROCEDURE add_purchases ( IN P_buyer_id INT, IN P_item_id INT, IN P_num_items INT ) DECLARE v_num INT DEFAULT 0, DEC ...

MySQL Stored Procedure Problem

I'm baffled as to why this stored procedure is acting this way. See the below sample table and examples. mysql> select * from Rates; +------+------+-------+-------------+---------------+ | rtID | bdID | empID | rtStartDate | rtBillingRate | +------+------+-------+-------------+---------------+ | ...

MySQL Stored Procedure Problem

I am using my hosts control panel to run a mysql sql statement to create a stored procedure. CREATE PROCEDURE usp_testerproc1() BEGIN SELECT * FROM tbl_users; END It returns the following error. #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server vers ...

Mysql stored procedure problem?

Mysql stored procedure problem? delimiter // create procedure proc4(in Uname varchar(200),in Upassword varchar(200)) begin grant select on mysql.* to Uname@localhost identified by Upassword; end // delimiter ; I am getting error: ERROR 1064 (42000): You have an error in your SQL syntax; check the ma ...

MySQL Create procedure -> syntax error

I try to create the stored procedure as follows. CREATE PROCEDURE backup.writeData(IN key_id varchar(32)) BEGIN insert into backup.tmp_deletetable( select ism_id from backup.in_stu_masterdata_hist where concat(biscountry,bisid) = key_id order by ism_id desc limit 10,9999); END; But everytime I get t ...

MySQL Stored Procedure problem

I have created a stored procedure calc_salary(mon varchar(45), yr decimal(7,2)) as follows:- CREATE PROCEDURE calc_salary(mon varchar(45), yr decimal(4,0)) begin DECLARE done INT DEFAULT 0; declare vemp_id varchar(45); declare vemp_name varchar(100); declare vattd_present integer; declare vattd_adju ...

MySQL newbie procedure problem

Hello, I am new to using procedures and I have been stuck on this simple procedure for quite a while now and don't know what else to do to try and solve it. I have tried each of the statements individually, outside of the procedure and they work fine, but when both of them are in the procedure toget ...

MySQL Stored Procedure Creation error

Had a good look in the forum and can seem to find the answer to the following: When I try to create the following produce I get the following error: CREATE DEFINER = CURRENT_USER PROCEDURE `NewProc` ( ) BEGIN SELECT interest.Name, interest.County, interest.Locality, interest.Period, interest.Number, ...

MySQL "/tmp"+"#" (pound) problem -> ERROR 126 (HY000): Incorrect key file for table '/tmp/#sql_9cd_0.MYI'; try to repair it

I got the following message while running a command: mysql> create table snp_mart_58_2.TEMP468 as select distinct size_2019,name_2019,variation_id_2025_key,sample_id_2023,description_2019,display_2019,allele from snp_mart_58_2.TEMP467; ERROR 126 (HY000): Incorrect key file for table '/tmp/#sql_9c ...

MySQL & external drive - problem (error 1045) with 2nd computer

I am a newbie with MySQL. I have a problem when I try to run MySQL from my second laptop. The MySQL database is located on an external harddrive. MySQL Error Number 1045. Access denied for user 'Peter_S'@localhost' (unsing password: NO)" (I do not use a passwort on the primary computer for that ...

C# transact Error Code 1064

HelloI want to send this string but I got this error message.string cmdString = @"IF (5 > 0) SELECT dbIndex FROM VerCommonHeader WHERE productNumber = 'XyX' AND internalSerialNumber = 'A1B2C3' AND rtsStatus = 2"; MySqlCommand command = new MySqlCommand(cmdString, m_connection); Activate ...

VB.NET to mySQL stored procedure problem

I have got a new laptop and trying to move my assignment onto it. I am using VS Dev Edition Express and MySQL 5 with SQLyog. I have downloaded the connector 5.0.3 and everything works fine when I don't have any parameters to pass into the store procedure. If i have a paramter to pass in I am getting ...

CInternetSession problem error code 12007

we have developed an activex control for one of our client. this will download some html file from a specified url. The problem is when we call the asp page with the domain name we are getting the error as unable to resolve the URL with error code 12007. but when we give the Ip address we were able ...

MySQL Call procedure showing error

I created a simple stored procedure create procedure proc() SELECT * FROM sampletable Then i tried to call the procedure using "call proc()" It returns an error PROCEDURE lottery1.proc can't return a result set in the given context here lottery1 is my database name Can any one help me how ...

MySQL Stored Procedure problem

there, im noob to store procedures but i still think they should be a neccisty in the future so i decided to build my own one which is supposed to query my blog, yet it doesnt! Could someone tell me what im doing wrong please? CREATE PROCEDURE Build_Blog_Post ( inid INT(20), OUT keywords Varchar(255 ...

MySQL Stored Procedure problem

I'm wondering if anyone can help me with this problem. I am using Connector/NET, in Visual Studio using VB.Net. I'm trying to return an output value from a stored procedure. Whenever I run the program, the program seems to crash when it reaches the cmd.NonExecuteQuery line. In MySQL Query Browser, t ...

mysql stored procedure problem

I have writeen this stored procedure in my one php program DELIMITER $$ DROP PROCEDURE IF EXISTS `test` $$ CREATE PROCEDURE `test` () BEGIN DECLARE var varchar(50) DEFAULT 'name_first'; SELECT var FROM care_person WHERE var = 'aaaaa'; END $$ DELIMITER ; as i declare varibale var as name_first and i ...

PHP call MySQL Stored Procedure problem.

I use MySQL-Front tool create and call Stored Procedure successfully, but in my PHP code and phpMyAdmin it fails. How can i figure out this problem when i run on phpMyAdmin the error show #1305 - PROCEDURE joomla1.5.9.save_orders does not exist this is my code of procedure DROP PROCEDURE `save_order ...