coldfusion

What is the behavior of Coldfusion cftransaction tag when multiple databases are accessed?

强颜欢笑 提交于 2019-12-25 09:04:24
问题 The coldfusion documentation, (I'm using CF8) states: Changes to data that is requested by the queries are not committed to the datasource until all actions within the transaction block have executed successfully. But it also states: In a transaction block, you can write queries to more than one database, but you must commit or roll back a transaction to one database before writing a query to another I have multiple transactions in my code base which access 2 databases for both selects and

sql/coldfusion delete duplicate rows

北战南征 提交于 2019-12-25 08:35:42
问题 Here is my table Display UPC 0 0553406259120 0 0753406259120 1 0753406259120 1 0453406259120 If you notice, row 2 and 3 have the same UPC. I would like to delete all rows that have display = 0 and duplicate upc. So in my table I want to delete row 2 only. Here is my coldfusion code so far that doesn't work. Please advice. <cfquery name="GetData" datasource="#Application.ds#" dbtype="ODBC" username="#Application.UserName#" password="#Application.Password#"> DELETE UPC FROM products WHERE

Having trouble with a SQL Join in ColdFusion

一曲冷凌霜 提交于 2019-12-25 08:00:00
问题 I'm trying to do something very simple in CF/SQL but just can't seem to figure out what I am doing wrong. I have these tables: movies genres actors moviesGenres moviesActors ------ ------ ------ ------------ ------------ movieId genreId actorId id id title name fname movie movie lname genre actor I'm trying to write a query that simply lists all movies, with each movie's genre (multiple selections possible) and each movie's actors (again, multiple selections possible). When I write the query

Cannot register REST services

南楼画角 提交于 2019-12-25 07:49:43
问题 I try to register a directory as a REST app in my CFIDE administrator: Error registering REST service. Please ensure that you have entered a proper mapping and path. Application servizi could not be initialized. Reason: The application does not contain any rest enabled CFCs. The application does not contain any rest enabled CFCs. My directory contains: Application.cfc component output="false" { this.name = "otticanet-rest"; this.applicationTimeout = createTimespan(0,1,0,0); this.datasource =

Coldfusion 8 - SerializeJSON - Outputting with a comment

岁酱吖の 提交于 2019-12-25 07:34:27
问题 I have a strange issue which has started happening with SerializeJSON , it's outputting the JSON with a comment at the beginning and I have no idea why. I've setup this test case: <!--- initialize variables ---> <cfset records = QueryNew('') /> <!--- create property bean ---> <cfscript> output = SerializeJSON(records); </cfscript> <cfdump var="#records#"> <cfdump var="#output#"> Which outputs: //{"COLUMNS":[],"DATA":[]} Is this familiar to anyone? SOLVED Found the issue. The cause was setting

How to text value from a textbox in Coldfusion

时间秒杀一切 提交于 2019-12-25 07:28:11
问题 <cffunction name="TEST" returntype="string" output="false"> <cfreturn "So your name is #name#?")> </cffunction> <cfif (isDefined("form.test"))> <cfoutput>#test()#</cfoutput><br> </cfif> <cfform> <cfinput name="names" type="text"> <cfinput name="TEST" type="submit" value="Call test()"> </cfform> How to get the text from the textbox and set it in a variable? THANKS! 回答1: This is how I would re-write this. Please note that I removed cfform and cfinput form example. They are not needed, and will

Creating FW/1 Service in application.cfc

喜你入骨 提交于 2019-12-25 07:10:03
问题 I am trying to create call a service in application.cfc The original code looked like It is now void function setupApplication() { ... application.objCCFRO = new model.services.setting(); application.stSetting = application.objCCFRO.loadini("standard.ini"); I am trying to convert it to application.stSetting = variables.beanFactory.getBean( "settingService" ).loadIni("standard.ini"); The documentation says sometimes you need access to the bean factory directly (such as for obtaining a

Help getting, or displaying, random records in ColdFusion from a MySQL query?

流过昼夜 提交于 2019-12-25 06:39:03
问题 I've got a jquery roller/scroller that displays snippets of records returned from my 'Helpful Hints' database table query. I want to keep the scroller to about 15 records but not always the first 15 records. Is it more efficient to write a query like: SELECT * FROM table ORDER BY RAND() LIMIT n Which returns a random result or do I return the whole query and have my ColdFusion component serve up a random number of the query result? The future of my scroller will include random records from my

Populating a second dropdown using ColdFusion, jQuery, and Ajax

戏子无情 提交于 2019-12-25 05:46:14
问题 I have one dropdown that has 14 values. Depending on the value chosen, it'll query a SQL Server database and return some clients to display in a second dropdown. I want that 2nd dropdown to use the jQuery Multiselect Widget where each value has a checkbox to select. Here is what I last tried to do, and it just doesn't work. <form> <label for="lstTiers">Tier:</label> <select name="lstTiers" id="lstTiers"> <option value="1">Tier 1</option> <option value="2">Tier 2</option> <option value="3"

ColdFusion Web Poll - Update poll results in MS Access Database

杀马特。学长 韩版系。学妹 提交于 2019-12-25 05:19:21
问题 How can I code when option1 is selected to update access db with + 1 vote. Database only has one record with Option1, Option2, Option3 & etc in each column. The total vote count will display under each column based on which option is choosen. 回答1: Database only has one record with Option1, Option2, Option3 The biggest problem is your table structure. Manipulating the data would be far easier if the options were stored in rows (not columns). For a very simple table, insert each option as a