Hi,
Guys! Stange!!!
I am replying to my own post just to tell you that after posting the
previously message, I restarted my system and ran my VB6 program. To
my surprise, MySQL __IS__ executing the same stored procedure,
that it was previously complaining about, again and not complaining
about the absence of the Group By clause any more.
This is __very__ strange behavior. Can anyone tell what's wrong?
This is driving me nuts now!
--
Thanks in advance,
Asif
On 8/18/06, Asif Lodhi <[EMAIL PROTECTED]> wrote:
I posted the following code in one or two of my earlier posts and
_then_ it WAS working! I know there is no GROUP BY clause but IT WAS
WORKING somehow - the procedure ran fine and inserted quite a good few
records. However, NOW, after I have dropped and re-created the
database/tables/all the stuff, MySQL is complaining that I should put
a GROUP BY in the following procedure:
create procedure PersonAdd ( Ttl_ char(15),
frstNm_ varchar(15),
midNm_ varchar(15),
lstNm_ varchar(15),
Gender_ char(1),
dob_ char(8), /* yyyymmdd
*/
nicNo_ varchar(13),
mrtlStts_ char(1),
cellNo_ varchar(15),
website_ varchar(80),
machine_no_ int)
begin
insert into Person (PersonID, Ttl, frstNm, midNm, lstNm, Gender, dob,
nicNo, mrtlStts, cellNo, website)
select (machine_no_ * 1000000) + (CASE WHEN ((max(PersonID)) -
((max(PersonID) div 1000000) * 1000000)) is null Then
0
ELSE
((max(PersonID)) - ((max(PersonID) div 1000000)
* 1000000))
END) + 1 as PersonID, Ttl_, frstNm_, midNm_, lstNm_,
Gender_, dob_, nicNo_,
mrtlStts_, cellNo_, website_
from Person;
end;
When I put all of the fields (except the first expression containing
the aggregage functions) in the group by clause, MySQL complains that
I didn't put PersonID in the GroupBY clause and when I do put PersonID
in the GROUP BY clause MySQL still complains.
I didn't change anything in the code or anything - just re-created the
database, tables, etc.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]