How do I change the delimiter for a group checkbox field?

A place for users and developers of the Xataface to discuss and receive support.

How do I change the delimiter for a group checkbox field?

Postby rlevin » Tue Sep 13, 2011 7:31 am

One of my fields is a group checkbox. When storing the values of the items checked, it looks like the values in MySQL are being stored with a carriage return as the delimiter. How do I change the delimiter to a comma? The reason why I want to change the delimiter is because I want to query that field using FIND_IN_SET('value2','value1,value2,value3'). I am open to other suggestions too.
rlevin
 
Posts: 32
Joined: Thu Mar 10, 2011 11:40 am

Re: How do I change the delimiter for a group checkbox field?

Postby shannah » Tue Sep 13, 2011 6:51 pm

The delimiter is hard coded I believe. It is also used in other parts of the system to allow performing OR and AND searches on those columns so it isn't advisable to just change it where it is saved.

Why not just do your query like this:
Code: Select all
FIND_IN_SET('str', REPLACE(`col`, '\n', ','))


I suppose it would be optimal for Xataface to just support the SET field type for this sort of thing.... but priorities as they are - and the fact that I've never needed to use the SET type mean that it probably won't happen soon.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: How do I change the delimiter for a group checkbox field?

Postby rlevin » Thu Sep 15, 2011 11:00 am

Thanks!
rlevin
 
Posts: 32
Joined: Thu Mar 10, 2011 11:40 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 18 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved