Bug #25403 unknown column SEQ_NO in field list
Submitted: 4 Jan 2007 2:31 Modified: 4 Jan 2007 11:23
Reporter: Mohamed Hassan Sulaiman Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S3 (Non-critical)
Version:5.0.26 OS:Windows (windows)
Assigned to: CPU Architecture:Any

[4 Jan 2007 2:31] Mohamed Hassan Sulaiman
Description:
hi,
am getting error as "unknown column SEQ_NO in field list" in my stored procedure while executing...

my table schema given below

CREATE TABLE T_SEQ (
	SEQ_TYP			VARCHAR(20) NOT NULL
	, SEQ_NO		INTEGER NOT NULL
	, SEQ_DESC		VARCHAR(60) NULL
	, CRE_BY		VARCHAR(10) NOT NULL
	, CRE_DTTM		DATETIME NULL
	, MOD_BY		VARCHAR(10) NULL
	, MOD_DTTM		DATETIME NULL
);

using stored procedure am incrementing the SEQ_NO each time...

BELOW IS STORED PROCEDURE CODE

DELIMITER $$

CREATE DEFINER=`root`@`localhost` PROCEDURE `P_NEXT_SEQ`(IN _SEQ_TYP VARCHAR(20),OUT _SEQ_NO INT(10))
BEGIN
      	UPDATE T_SEQ SET SEQ_NO = SEQ_NO + 1 WHERE SEQ_TYP = _SEQ_TYP;
	      SELECT SEQ_NO FROM T_SEQ WHERE SEQ_TYP = _SEQ_TYP;
        SET @_SEQ_NO = SEQ_NO;
END $$

DELIMITER ;

hope this information wil be enough to help me out...

reply ASAP.... thank you very much...

How to repeat:
help me to rectify the bug!!!!!!!!!!!!!
[4 Jan 2007 6:45] Valeriy Kravchuk
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ (http://dev.mysql.com/doc/refman/5.0/en/select-into-statement.html will be most useful in your case) and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php.

You have a bug in your code. What is that SEQ_NO are you referring to?

SET @_SEQ_NO = SEQ_NO;

Think about it. And use SELECT ... INTO.
[4 Jan 2007 8:44] Mohamed Hassan Sulaiman
Thanks for reply...

previously i tried by the way you suggested now, SELECT...INTO..

that also gave the same error...

again i change n still error persists..
[4 Jan 2007 11:23] Valeriy Kravchuk
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. Your problem is not the result of a bug.

Support on using our products is available both free in our forums at http://forums.mysql.com/ and for a reasonable fee direct from our skilled support engineers at http://www.mysql.com/support/

Thank you for your interest in MySQL.