MySQL Forums
Forum List  »  Stored Procedures

Re: Help with 1064 error
Posted by: Peter Brawley
Date: September 21, 2016 04:21PM

< I am not sure on how to right that correctly.

set @id = (select ifnull( max(id), 1 ) from ao_1991c6_page_view ;
insert into ao_1991c6_page_view ( id, page_id, viewer_id, view_date )
  select @id := @id+1, c.contentid, u.lower_username, now()
  from content      as c
  join user_mapping as u on c.lastmodifier = u.user_key
  where contenttype = "page" and content_status = "current";

Much simpler, much faster, much more efficient use of your time.

> why you change the delimiter.

Most mysql clients require it for parsing of stored routines.

Options: ReplyQuote


Subject
Views
Written By
Posted
4816
September 21, 2016 07:58AM
1036
September 21, 2016 11:06AM
930
September 21, 2016 02:50PM
Re: Help with 1064 error
874
September 21, 2016 04:21PM
737
September 21, 2016 07:31PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.