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...@acoderslife.com wrote: Assuming you are dealing with one dimensional arrays, sure, converting it to a list could work. .:.:.:.:.:.:.:.:.:.:.:.:.:. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343596 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Storing Arrays or Structures in a database
Hence the could. There are plenty of wrenches to throw into it (like the delimiter character being used as a normal character in one of the values). .:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com http://cf4em.com -Original Message- From: Raymond Camden [mailto:rcam...@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...@acoderslife.com wrote: Assuming you are dealing with one dimensional arrays, sure, converting it to a list could work. .:.:.:.:.:.:.:.:.:.:.:.:.:. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343604 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Storing Arrays or Structures in a database
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 them in a Structure, but I can't seem to get Structures or Arrays to insert into a database. How can I store an array or structure in a MS 2008 SQL server? Array Code: cfset name=Adam / cfscript // 7 days, day 0 = Mon, Day 7 = sun workWeek=[t,t,f,t,f,t,f]; /cfscript cfinvoke method=injectData component=anubis cfinvokeargument name=name value=#name# / cfinvokeargument name=workWeek value=#workWeek# / /cfinvoke cffunction name=injectData access=public returntype=void hint=Injects the Employee App form data cfquery datasource=DSN name=insertData INSERT INTO mod_employmentAppProfile( name, workWeekendsEvenings ) VALUES ( #ARGUMENTS.name#, #ARGUMENTS.workWeek# ) /cfquery ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343573 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Storing Arrays or Structures in a database
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 values, I have stored them in a Structure, but I can't seem to get Structures or Arrays to insert into a database. How can I store an array or structure in a MS 2008 SQL server? Array Code: cfset name=Adam / cfscript // 7 days, day 0 = Mon, Day 7 = sun workWeek=[t,t,f,t,f,t,f]; /cfscript cfinvoke method=injectData component=anubis cfinvokeargument name=name value=#name# / cfinvokeargument name=workWeek value=#workWeek# / /cfinvoke cffunction name=injectData access=public returntype=void hint=Injects the Employee App form data cfquery datasource=DSN name=insertData INSERT INTO mod_employmentAppProfile( name, workWeekendsEvenings ) VALUES ( #ARGUMENTS.name#, #ARGUMENTS.workWeek# ) /cfquery ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343574 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
re: Storing Arrays or Structures in a database
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 cf-talk@houseoffusion.com Subject: Storing Arrays or Structures in a database 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 them in a Structure, but I can't seem to get Structures or Arrays to insert into a database. How can I store an array or structure in a MS 2008 SQL server? Array Code: cfset name=Adam / cfscript // 7 days, day 0 = Mon, Day 7 = sun workWeek=[t,t,f,t,f,t,f]; /cfscript cfinvoke method=injectData component=anubis cfinvokeargument name=name value=#name# / cfinvokeargument name=workWeek value=#workWeek# / /cfinvoke cffunction name=injectData access=public returntype=void hint=Injects the Employee App form data cfquery datasource=DSN name=insertData INSERT INTO mod_employmentAppProfile( name, workWeekendsEvenings ) VALUES ( #ARGUMENTS.name#, #ARGUMENTS.workWeek# ) /cfquery ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343575 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
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 have to do that. Also, select boxes return comma separated lists back to CF when a form is submitted (ditto for checkboxes with the same name)... So that might work in your favor. For structures though, WDDX is your friend, and quite easy to do... Try cfwddx action=CFML2WDDX input=#workweek# output=workweekXML Then stuff workweekXML into the database field. When you retrieve the data back out of the database, use cfwddx again to convert back to a CF structure cfwddx action=WDDX2CFML input=queryname.databaseWDDXField output=localStructVariable Just make sure that your db field can handle a decent sized chunk of data, especially if you are allowing user defined data in this column as the WDDX format can get kinda bloated. -Original Message- From: Adam Bourg [mailto:adam.bo...@gmail.com] Sent: Wednesday, April 06, 2011 10:41 AM To: cf-talk Subject: Storing Arrays or Structures in a database 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 them in a Structure, but I can't seem to get Structures or Arrays to insert into a database. How can I store an array or structure in a MS 2008 SQL server? Array Code: cfset name=Adam / cfscript // 7 days, day 0 = Mon, Day 7 = sun workWeek=[t,t,f,t,f,t,f]; /cfscript cfinvoke method=injectData component=anubis cfinvokeargument name=name value=#name# / cfinvokeargument name=workWeek value=#workWeek# / /cfinvoke cffunction name=injectData access=public returntype=void hint=Injects the Employee App form data cfquery datasource=DSN name=insertData INSERT INTO mod_employmentAppProfile( name, workWeekendsEvenings ) VALUES ( #ARGUMENTS.name#, #ARGUMENTS.workWeek# ) /cfquery ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343576 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Storing Arrays or Structures in a database
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 version='1.0'header/dataarray length='4'stringJohn/stringstringPaul/stringstringGeorge/stringstringRingo/string/array/data/wddxPacket The larger the array or structure, the bigger the bloat from WDDX, and the more database space required to store it. This needs to be considered when designing your database columns. HTH, Carl On 4/6/2011 10:52 AM, Michael Grant wrote: Serialize them as JSON or WDDX and store them as text. On Wed, Apr 6, 2011 at 1:41 PM, Adam Bourgadam.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 them in a Structure, but I can't seem to get Structures or Arrays to insert into a database. How can I store an array or structure in a MS 2008 SQL server? Array Code: cfset name=Adam / cfscript // 7 days, day 0 = Mon, Day 7 = sun workWeek=[t,t,f,t,f,t,f]; /cfscript cfinvoke method=injectData component=anubis cfinvokeargument name=name value=#name# / cfinvokeargument name=workWeek value=#workWeek# / /cfinvoke cffunction name=injectData access=public returntype=void hint=Injects the Employee App form data cfquery datasource=DSN name=insertData INSERT INTO mod_employmentAppProfile( name, workWeekendsEvenings ) VALUES ( #ARGUMENTS.name#, #ARGUMENTS.workWeek# ) /cfquery ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343577 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Storing Arrays or Structures in a database
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, java.io.ByteArrayOutputStream); local.byteOut.init(); local.objOut= createObject(java, java.io.ObjectOutputStream); local.objOut.init(local.byteOut); local.objOut.writeObject(arguments.object); local.objOut.close(); return toBase64(local.byteOut.toByteArray()); } function deserializeObject(objectString){ var local = structNew(); local.inputStream = createObject(java, java.io.ByteArrayInputStream); local.objIn = createObject(java, java.io.ObjectInputStream); local.returnObj = ; local.inputStream.init(toBinary(arguments.objectString)); local.objIn.init(local.inputStream); local.returnObj = local.objIn.readObject(); local.objIn.close(); return local.returnObj; } /cfscript I've been using this in http://sessionswap.riaforge.org/ for a long time. John Blayter Land line: 303.731.3009 Mobile: 303.325.1979 http://www.blayter.com/john/ Denver ColdFusion User Group Manager http://denvercfug.org/ On Wed, Apr 6, 2011 at 12:02 PM, Jeff Garza j...@garzasixpack.com wrote: 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 back to CF when a form is submitted (ditto for checkboxes with the same name)... So that might work in your favor. For structures though, WDDX is your friend, and quite easy to do... Try cfwddx action=CFML2WDDX input=#workweek# output=workweekXML Then stuff workweekXML into the database field. When you retrieve the data back out of the database, use cfwddx again to convert back to a CF structure cfwddx action=WDDX2CFML input=queryname.databaseWDDXField output=localStructVariable Just make sure that your db field can handle a decent sized chunk of data, especially if you are allowing user defined data in this column as the WDDX format can get kinda bloated. -Original Message- From: Adam Bourg [mailto:adam.bo...@gmail.com] Sent: Wednesday, April 06, 2011 10:41 AM To: cf-talk Subject: Storing Arrays or Structures in a database 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 them in a Structure, but I can't seem to get Structures or Arrays to insert into a database. How can I store an array or structure in a MS 2008 SQL server? Array Code: cfset name=Adam / cfscript // 7 days, day 0 = Mon, Day 7 = sun workWeek=[t,t,f,t,f,t,f]; /cfscript cfinvoke method=injectData component=anubis cfinvokeargument name=name value=#name# / cfinvokeargument name=workWeek value=#workWeek# / /cfinvoke cffunction name=injectData access=public returntype=void hint=Injects the Employee App form data cfquery datasource=DSN name=insertData INSERT INTO mod_employmentAppProfile( name, workWeekendsEvenings ) VALUES ( #ARGUMENTS.name#, #ARGUMENTS.workWeek# ) /cfquery ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343580 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Storing Arrays or Structures in a database
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 [mailto:adam.bo...@gmail.com] Sent: Wednesday, April 06, 2011 1:41 PM To: cf-talk Subject: Storing Arrays or Structures in a database 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 them in a Structure, but I can't seem to get Structures or Arrays to insert into a database. How can I store an array or structure in a MS 2008 SQL server? Array Code: cfset name=Adam / cfscript // 7 days, day 0 = Mon, Day 7 = sun workWeek=[t,t,f,t,f,t,f]; /cfscript cfinvoke method=injectData component=anubis cfinvokeargument name=name value=#name# / cfinvokeargument name=workWeek value=#workWeek# / /cfinvoke cffunction name=injectData access=public returntype=void hint=Injects the Employee App form data cfquery datasource=DSN name=insertData INSERT INTO mod_employmentAppProfile( name, workWeekendsEvenings ) VALUES ( #ARGUMENTS.name#, #ARGUMENTS.workWeek# ) /cfquery ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343584 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Storing Arrays or Structures in a database
Assuming you are dealing with one dimensional arrays, sure, converting it to a list could work. .:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com http://cf4em.com -Original Message- From: Jeff Garza [mailto:j...@garzasixpack.com] Sent: Wednesday, April 06, 2011 2:02 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 have to do that. Also, select boxes return comma separated lists back to CF when a form is submitted (ditto for checkboxes with the same name)... So that might work in your favor. For structures though, WDDX is your friend, and quite easy to do... Try cfwddx action=CFML2WDDX input=#workweek# output=workweekXML Then stuff workweekXML into the database field. When you retrieve the data back out of the database, use cfwddx again to convert back to a CF structure cfwddx action=WDDX2CFML input=queryname.databaseWDDXField output=localStructVariable Just make sure that your db field can handle a decent sized chunk of data, especially if you are allowing user defined data in this column as the WDDX format can get kinda bloated. -Original Message- From: Adam Bourg [mailto:adam.bo...@gmail.com] Sent: Wednesday, April 06, 2011 10:41 AM To: cf-talk Subject: Storing Arrays or Structures in a database 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 them in a Structure, but I can't seem to get Structures or Arrays to insert into a database. How can I store an array or structure in a MS 2008 SQL server? Array Code: cfset name=Adam / cfscript // 7 days, day 0 = Mon, Day 7 = sun workWeek=[t,t,f,t,f,t,f]; /cfscript cfinvoke method=injectData component=anubis cfinvokeargument name=name value=#name# / cfinvokeargument name=workWeek value=#workWeek# / /cfinvoke cffunction name=injectData access=public returntype=void hint=Injects the Employee App form data cfquery datasource=DSN name=insertData INSERT INTO mod_employmentAppProfile( name, workWeekendsEvenings ) VALUES ( #ARGUMENTS.name#, #ARGUMENTS.workWeek# ) /cfquery ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343585 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Storing Arrays or Structures in a database
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 are dealing with one dimensional arrays, sure, converting it to a list could work. .:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com http://cf4em.com -Original Message- From: Jeff Garza [mailto:j...@garzasixpack.com] Sent: Wednesday, April 06, 2011 2:02 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 have to do that. Also, select boxes return comma separated lists back to CF when a form is submitted (ditto for checkboxes with the same name)... So that might work in your favor. For structures though, WDDX is your friend, and quite easy to do... Try cfwddx action=CFML2WDDX input=#workweek# output=workweekXML Then stuff workweekXML into the database field. When you retrieve the data back out of the database, use cfwddx again to convert back to a CF structure cfwddx action=WDDX2CFML input=queryname.databaseWDDXField output=localStructVariable Just make sure that your db field can handle a decent sized chunk of data, especially if you are allowing user defined data in this column as the WDDX format can get kinda bloated. -Original Message- From: Adam Bourg [mailto:adam.bo...@gmail.com] Sent: Wednesday, April 06, 2011 10:41 AM To: cf-talk Subject: Storing Arrays or Structures in a database 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 them in a Structure, but I can't seem to get Structures or Arrays to insert into a database. How can I store an array or structure in a MS 2008 SQL server? Array Code: cfset name=Adam / cfscript // 7 days, day 0 = Mon, Day 7 = sun workWeek=[t,t,f,t,f,t,f]; /cfscript cfinvoke method=injectData component=anubis cfinvokeargument name=name value=#name# / cfinvokeargument name=workWeek value=#workWeek# / /cfinvoke cffunction name=injectData access=public returntype=void hint=Injects the Employee App form data cfquery datasource=DSN name=insertData INSERT INTO mod_employmentAppProfile( name, workWeekendsEvenings ) VALUES ( #ARGUMENTS.name#, #ARGUMENTS.workWeek# ) /cfquery ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343586 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Storing Arrays or Structures in a database
If anyone is on ColdFusion 8+ then instead of wddx one might use Json instead, as it has a smaller footprint than WDDX does. Regards, 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 the other day... Jeff ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343587 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Storing Arrays or Structures in a database
And you can pass it back and forth between cf and js with no fuss or muss. On Wed, Apr 6, 2011 at 6:09 PM, Andrew Scott andr...@andyscott.id.auwrote: If anyone is on ColdFusion 8+ then instead of wddx one might use Json instead, as it has a smaller footprint than WDDX does. Regards, 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 the other day... Jeff ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343588 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Storing Arrays or Structures in a database
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 a libertine than out of a prig. George Santayana ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343589 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Storing Arrays or Structures in a database
Well I prefer the json.cfc that has been floating around for a while, it doesn't suffer those problems. Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: denstar [mailto:valliants...@gmail.com] Sent: Thursday, 7 April 2011 10:12 AM To: cf-talk Subject: Re: 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://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343590 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Storing Arrays or Structures in a database
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 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 a libertine than out of a prig. George Santayana ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343591 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Storing Arrays or Structures in a database
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, aestheticism, art museums, new theaters, etc. that make America impotent. The good things are football, kindness, and jazz bands. George Santayana On Wed, Apr 6, 2011 at 6:33 PM, Michael Grant wrote: 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. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343592 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm