Another data type question
Okay, so I've got a SELECT menu that allows the user to choose which DB field they'd like to see results on, then a text box to allow them to enter the appropriate data for the SELECT choice. Now I'm wondering if I should add some sort of CFIF to show the appropriate SELECT for the 2nd portion instead of the text box b/c I'm having problems with it recognizing the datatype on my query to show results. Or is there a way to detect which datatype within my query - possibly CFIF datatype1 use this code, etc. Some of the SELECT drop downs are text in my db, some are checkboxes and some True/False. Any insight or feedback would be greatly appreciated. TIA, Donna -- Donna French [EMAIL PROTECTED] Blog: http://dgfrench.blogspot.com Site: http://www.dgfrenchdesigns.com ~| Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF community. http://www.houseoffusion.com/banners/view.cfm?bannerid=35 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183308 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Another data type question
Donna, Here's an old code snippet from CF4/SQL7 days - may still work - if you're using MSSQL. Just an example of how to get at datatypes. Mark !--- using the sp_columnlist proc built into SQL Server --- CFSET TableName = #TableName# CFSTOREDPROC PROCEDURE=sp_columns DATASOURCE=#DataSource# CFPROCPARAM TYPE=In CFSQLTYPE=CF_SQL_VARCHAR DBVARNAME=@table_name VALUE=#TableName# NULL=No CFPROCRESULT NAME=First RESULTSET=1 /CFSTOREDPROC TABLE CFOUTPUT QUERY=First TRTD#Column_Name#/TD TD#Type_Name#/TD TD#Length#/TD TD#Nullable#/TD TD#Column_def#/TD /TR /CFOUTPUT Donna French [EMAIL PROTECTED]To: CF-Talk [EMAIL PROTECTED] om cc: Subject: Another data type question 11/03/2004 03:06 PM Please respond to cf-talk Okay, so I've got a SELECT menu that allows the user to choose which DB field they'd like to see results on, then a text box to allow them to enter the appropriate data for the SELECT choice. Now I'm wondering if I should add some sort of CFIF to show the appropriate SELECT for the 2nd portion instead of the text box b/c I'm having problems with it recognizing the datatype on my query to show results. Or is there a way to detect which datatype within my query - possibly CFIF datatype1 use this code, etc. Some of the SELECT drop downs are text in my db, some are checkboxes and some True/False. Any insight or feedback would be greatly appreciated. TIA, Donna -- Donna French [EMAIL PROTECTED] Blog: http://dgfrench.blogspot.com Site: http://www.dgfrenchdesigns.com ~| This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. http://www.houseoffusion.com/banners/view.cfm?bannerid=11 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183310 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
RE: Another data type question
And in Access... You'll have to run a query that selects the column you want first... cfquery name=MyQuery datasource=MyDSN maxrows=1 SELECT MyColumn From table /cfquery then... cfset MetaData = QueryName.getMetaData() cfset ColumName = MyColumn cfset DataType = QueryName.getColumnTypeName(MetaData.GetColumnType(QueryName.findColumn(Colu mnName))) -Original Message- From: Mark Wimer [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 03, 2004 4:42 PM To: CF-Talk Subject: Re: Another data type question Donna, Here's an old code snippet from CF4/SQL7 days - may still work - if you're using MSSQL. Just an example of how to get at datatypes. Mark !--- using the sp_columnlist proc built into SQL Server --- CFSET TableName = #TableName# CFSTOREDPROC PROCEDURE=sp_columns DATASOURCE=#DataSource# CFPROCPARAM TYPE=In CFSQLTYPE=CF_SQL_VARCHAR DBVARNAME=@table_name VALUE=#TableName# NULL=No CFPROCRESULT NAME=First RESULTSET=1 /CFSTOREDPROC TABLE CFOUTPUT QUERY=First TRTD#Column_Name#/TD TD#Type_Name#/TD TD#Length#/TD TD#Nullable#/TD TD#Column_def#/TD /TR /CFOUTPUT Donna French [EMAIL PROTECTED]To: CF-Talk [EMAIL PROTECTED] om cc: Subject: Another data type question 11/03/2004 03:06 PM Please respond to cf-talk Okay, so I've got a SELECT menu that allows the user to choose which DB field they'd like to see results on, then a text box to allow them to enter the appropriate data for the SELECT choice. Now I'm wondering if I should add some sort of CFIF to show the appropriate SELECT for the 2nd portion instead of the text box b/c I'm having problems with it recognizing the datatype on my query to show results. Or is there a way to detect which datatype within my query - possibly CFIF datatype1 use this code, etc. Some of the SELECT drop downs are text in my db, some are checkboxes and some True/False. Any insight or feedback would be greatly appreciated. TIA, Donna -- Donna French [EMAIL PROTECTED] Blog: http://dgfrench.blogspot.com Site: http://www.dgfrenchdesigns.com ~| Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF community. http://www.houseoffusion.com/banners/view.cfm?bannerid=35 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183315 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54