LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-27-2011, 02:46 PM   #1
Eppo
Member
 
Registered: Feb 2007
Location: NY
Distribution: Arch, Ubuntu
Posts: 77

Rep: Reputation: 27
simple mysql procedure, not working correctly


so i'm trying to create this procedure:
DELIMITER |
CREATE PROCEDURE test(IN start_date INT(8), IN end_date INT(8), IN test_code INT(4))
BEGIN
SELECT COUNT(*) FROM TABLE WHERE TEST_CODE = test_code AND DATE(`RELEASE`) BETWEEN start_date AND end_date;
END |

for some reason i'm having issues with the test_code variable part.
no matter what i put in there i get the same result. if i change the start_date or end_date my count changes.
what am i doing wrong?
thanks
Joe


edit: turns out that the veriable and column name can not be the same, i thought they were case sensitive, but i guess not.

Last edited by Eppo; 09-27-2011 at 03:08 PM.
 
Old 09-27-2011, 04:07 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Thanks for posting your solution.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How come I cannot find a simple procedure for installing and configuring net-snmp mikemillion Linux - Newbie 6 07-22-2008 10:25 PM
PHP MySQL Support not working (Hopefully simple question) icarusfall Linux - Software 5 11-08-2005 10:30 AM
MySQL Replication not working correctly? Ratclaws Linux - Software 0 06-20-2005 03:34 PM
MySQL Stored Procedure Question?? sehgals Linux - Software 5 01-31-2005 01:54 PM
stored procedure in mysql suchi_s Programming 2 10-01-2004 06:14 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration