Re: Storing Arrays or Structures in a database

2011-04-07 Thread Raymond Camden
Not if any value has a comma in it. You can use other delimiters, but then you just have a different problem. On Wed, Apr 6, 2011 at 4:38 PM, Bobby Hartsfield bo...@acoderslife.com wrote: Assuming you are dealing with one dimensional arrays, sure, converting it to a list could work.

RE: Storing Arrays or Structures in a database

2011-04-07 Thread Bobby Hartsfield
...@gmail.com] Sent: Thursday, April 07, 2011 9:43 AM To: cf-talk Subject: Re: Storing Arrays or Structures in a database Not if any value has a comma in it. You can use other delimiters, but then you just have a different problem. On Wed, Apr 6, 2011 at 4:38 PM, Bobby Hartsfield bo

Re: Storing Arrays or Structures in a database

2011-04-06 Thread Michael Grant
Serialize them as JSON or WDDX and store them as text. On Wed, Apr 6, 2011 at 1:41 PM, Adam Bourg adam.bo...@gmail.com wrote: I've got really large sets of data that are related to each day of the week and the hour. Rather then creating a massive table containing these values, I have stored

Re: Storing Arrays or Structures in a database

2011-04-06 Thread John M Bliss
cfwddx action=cfml2wddx input=#ARGUMENTS.workWeek# output=wddxworkWeek On Wed, Apr 6, 2011 at 12:41 PM, Adam Bourg adam.bo...@gmail.com wrote: I've got really large sets of data that are related to each day of the week and the hour. Rather then creating a massive table containing these

re: Storing Arrays or Structures in a database

2011-04-06 Thread Jason Fisher
Serialize with WDDX or JSON, I would say. Those are complex variable types which need to be serialized into strings before insertion into a DB. From: Adam Bourg adam.bo...@gmail.com Sent: Wednesday, April 06, 2011 1:49 PM To: cf-talk

RE: Storing Arrays or Structures in a database

2011-04-06 Thread Jeff Garza
Arrays are easy as you can simply use Arraytolist() to convert it to a delimited text string and then use ListtoArray() to convert back once you get it out. Though, CF has some really nice list functions, so you might not even have to do that. Also, select boxes return comma separated lists

Re: Storing Arrays or Structures in a database

2011-04-06 Thread Carl Von Stetten
Keep in mind that WDDX adds quite a bit of extra stuff around your data as compared to JSON. For example, take this ColdFusion array: cfset myArray = [John,Paul,George,Ringo] Here is the serialized JSON version: [John,Paul,George,Ringo] Here is the WDDX version: wddxPacket

Re: Storing Arrays or Structures in a database

2011-04-06 Thread John Blayter
Another way to do it is to serialize the object in a base64 string. I've had some great success using this method to persist complex objects to the database. cfscript function serializeObject(object){ var local = structNew(); local.byteOut = createObject(java,

RE: Storing Arrays or Structures in a database

2011-04-06 Thread Bobby Hartsfield
Just talked about this today with a colleague. Convert it to JSON and store that. When you need to use it, get it from the database and deseralize it. .:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com http://cf4em.com -Original Message- From: Adam Bourg

RE: Storing Arrays or Structures in a database

2011-04-06 Thread Bobby Hartsfield
PM To: cf-talk Subject: RE: Storing Arrays or Structures in a database Arrays are easy as you can simply use Arraytolist() to convert it to a delimited text string and then use ListtoArray() to convert back once you get it out. Though, CF has some really nice list functions, so you might not even

RE: Storing Arrays or Structures in a database

2011-04-06 Thread Jeff Garza
True. I used wddx to serialize some multidimensional arrays just the other day... Jeff -Original Message- From: Bobby Hartsfield [mailto:bo...@acoderslife.com] Sent: Wednesday, April 06, 2011 2:39 PM To: cf-talk Subject: RE: Storing Arrays or Structures in a database Assuming you

RE: Storing Arrays or Structures in a database

2011-04-06 Thread Andrew Scott
To: cf-talk Subject: RE: Storing Arrays or Structures in a database True. I used wddx to serialize some multidimensional arrays just the other day... Jeff ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com

Re: Storing Arrays or Structures in a database

2011-04-06 Thread Michael Grant
, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Jeff Garza [mailto:j...@garzasixpack.com] Sent: Thursday, 7 April 2011 8:10 AM To: cf-talk Subject: RE: Storing Arrays or Structures in a database True. I used wddx to serialize some multidimensional arrays just

Re: Storing Arrays or Structures in a database

2011-04-06 Thread denstar
On Wed, Apr 6, 2011 at 5:54 PM, Michael Grant wrote: And you can pass it back and forth between cf and js with no fuss or muss. Well, besides the weird is it a string or a number type of deal that can change 8 to 8.0 and a few other oddities. ;) :Den -- It is easier to make a saint out of

RE: Storing Arrays or Structures in a database

2011-04-06 Thread Andrew Scott
: Storing Arrays or Structures in a database Well, besides the weird is it a string or a number type of deal that can change 8 to 8.0 and a few other oddities. ;) :Den -- ~| Order the Adobe Coldfusion Anthology now! http

Re: Storing Arrays or Structures in a database

2011-04-06 Thread Michael Grant
Given. I have a tendency to always use parseInt anyway, so I don't generally suffer that woe. However your point is well taken... a teeny bit of fuss, with a pinch of muss. On Wed, Apr 6, 2011 at 8:12 PM, denstar valliants...@gmail.com wrote: On Wed, Apr 6, 2011 at 5:54 PM, Michael Grant

Re: Storing Arrays or Structures in a database

2011-04-06 Thread denstar
I was mostly just being pedantic. :) It works fine out of the box most the time. And for the rest of the time, there's json.cfc, as Andrew mentioned. :) No joke that it's way better than WDDX. Three cheers for JSON! Hip, hip, hip! :den the pelvis uno -- It is veneer, rouge,