Superman
Superman

Reputation: 3

How to set global level group_concat_max_len in Flask-Sqlalchemy?

We are using group_concat in one of our query which returns string greater than default length of group_concat(1024). I need to set the max value for group_concat_max_len at the global level, but I am not able to find a way to achieve that in Flask_Sqlalchemy.

Request.query
    .with_entities(func.group_concat(func.CONCAT_WS(';', Sample.xyz,Analysis.zy, Analysis.pqr).distinct()))
    .outerjoin(Sample)
    .outerjoin(Analysis)
    .group_by(Request.id).all()

Let me know if anyone can help me with this.

Upvotes: 0

Views: 565

Answers (1)

p.ganesh
p.ganesh

Reputation: 120

set global group_concat_max_len=10000000;

run this

Upvotes: -1

Related Questions