MySQL Forums
Forum List  »  Knowledge Base

Problem with data view - values of calculated field are too long
Posted by: Do Trung
Date: August 20, 2009 03:22AM

Hi all,

I create a view which contains a calculated column [actions] using GROUP_CONCAT() function:
--------------------
CREATE VIEW actions_roles(role_id, controller_name, actions)
AS
SELECT roles.id, action_group_items.controller_name, GROUP_CONCAT(action_group_items.actions SEPARATOR '')
FROM roles
INNER JOIN permissions on roles.id = permissions.role_id
INNER JOIN action_groups on permissions.action_group_id = action_groups.id
INNER JOIN action_group_items on action_group_items.action_group_id = action_groups.id
WHERE permissions.allowed = true
GROUP BY roles.id, action_group_items.controller_name
--------------------
The problem is that, after the view is created, some string values in the calculated column [actions] are cut off because they are too long to the column's type length(which I don't know how to determine).

My question is that is there any way to define the length for the calculated column in a view?

Thank you very much.

Options: ReplyQuote


Subject
Views
Written By
Posted
Problem with data view - values of calculated field are too long
3819
August 20, 2009 03:22AM


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.