Duncan I Loxton wrote:
> We use UUId for our users primary key - what cfsqltype should I use to
> get the correct match?
> 
> e.g.
> <cfquery name="getStaffDetail" dataSource="#Application.DataSource#"
> userName="#Application.DBUserName#"
> password="#Application.DBUserPwd#">
>       SELECT *
>       FROM Users
>       usr_id = <cfqueryparam value="#attributes.usr_id#" 
> cfsqltype="CF_SQL_UUID">  
> </cfquery>
> 
> There doesnt seem to be a match in the documentation - should I be
> using a different type that copes with UUID's?

If there is a special type for UUIDs you will find it in the 
documentation of your database drivers. The types that CF offers 
are really just the types the JDBC spec offers so if the JDBC 
driver you are using extends the JDBC spec you will find the type 
to use there. Else just use a varchar and cast the type serverside:
SELECT *
FROM Users
usr_id = CAST(<cfqueryparam value="#attributes.usr_id#" 
cfsqltype="CF_SQL_char" length="35 / 6">  AS UUID)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:189601
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to