[Dbix-class] how to execute stored procedures in DBIx::Class

Wan wanmyome at gmail.com
Mon Dec 25 22:35:42 GMT 2006


In MySQL 5.0.x, I have created a procedure named boardslist, like this

CREATE PROCEDURE boardslist (IN uId INT)
BEGIN
SELECT boards.*, hiddenboards.userId IS NOT NULL AS hidden
FROM boards LEFT JOIN hiddenboards
ON hiddenboards.userId = uId
AND hiddenboards.boardId = boards.id
WHERE boards.active = 1
ORDER BY pos;
END

And I CALL the procedure use

mysql>CALL boardslist (1);

But in DBIx::Class, how can I execute this procedure?

I have read the documents of DBIx::Class::Manual::Cookbook
Using database functions or stored procedures
I don't think this is the true method to solve my problem!

Thanks for any help!



More information about the Dbix-class mailing list