Yeah, Enums basically are just a varchar, although on the storage side the DB only stores an integer index to the value, so they are quite space efficient.

 

Basically passing in any string to an enum column is fine, however if its not one of the enumerated values MySQL will store ‘’ in the column.  That’s why I asked about whether validating the input to setMyEnumCol() against the list of enumerated values would be something Reactor could do, or whether it should be something that a developer should build on top.

 

Chris

 

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter J. Farrell
Sent: 20 February 2006 15:51
To: [email protected]
Subject: Re: Reactor For CF Enum columns

 

Doug Hughes said the following on 2/20/2006 9:41 AM:

Do me one more favor:

 

Can you send me what the cfqueryparam would look like for both enum and set?  I want to see how the data is passed in and it’s various attributes.

 

Doug

ENUM:
<cfqueryparam value="#arguments.companyStatusBean.getCompany_statuscode()#" cfsqltype="cf_sql_varchar" />

You would pass in a single value like "valid" or "suspended".

SET:
<cfqueryparam value="#arguments.companyStatusBean.getCompany_statuscode()#" cfsqltype="cf_sql_varchar" />

You would pass in a single value like "valid" or multiple values like "valid,confirmed".

There shouldn't be a length attribute to the queryparam IMHO because the ENUM or SET values could change and there really isn't any reason to check the length since the DB will match the passed value or values to the list it has internally.

http://dev.mysql.com/doc/refman/5.0/en/enum.html
http://dev.mysql.com/doc/refman/5.0/en/set.html



-- 
Peter J. Farrell :: Maestro Publishing
Member Team Mach-II :: Member Team Fusion
http://blog.maestropublishing.com
 
Create boilerplate beans and transfer objects for ColdFusion!
Fire up a cup of Rooibos!
http://rooibos.maestropublishing.com/
 




-- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/



-- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/

Reply via email to