Hi all
Anyone know if this can be done? Here's the scenario.
We have a group of members on our joomla site. Existing members already have simple 4 digit member numbers from an external database. We want to merge the two databases and end up with just the one online database that we can manage through Joomla.
For new members we have written a stored procedure and put it into the MySQL database for the site. Essentially when it's called it returns a number 1 greater than the last number it provided, and then that number is then put into the membership number. Here's the code to create the table and the sp
Code:
-- Create the table
create table mbr_MemberCode (
MemberId smallint not null auto_increment,
InsertDateTime datetime not null,
primary key (MemberId)
);
-- Set the value to at least the last currently used number + 1
-- or whereever we want to start from
alter table mbr_MemberCode auto_increment = 7200;
-- Create stored procedure to insert record and return the next number
delimiter $$
CREATE PROCEDURE `GetNextMemberCode`(OUT MemberId smallint)
BEGIN
insert into mbr_MemberCode(InsertDateTime)
values(now());
select last_insert_id() into MemberId;
END$$
delimiter ;
However when I run the code to do that through the CB Query field plugin:
Code:
call GetNextMemberCode(@MemberId);
select @MemberId;
Nothing is output to the field.
I'm assuming the plugin does not support stored procedure calls. Can anyone confirm.
Also if it doesn't, any suggestions on how we could achieve this?
Thanks in advance