RE: Anyone see anything wrong with the syntax of the query?
Obvious first question- what is the exact value of #arguments.listing_office_mls_id#? When debugging something that I can't figure out from the query, I put the whole things within a CFOUTPUT so I can see exactly what's being sent to the DB. -Original Message- From: listmas...@houseoffusion.com [mailto:listmas...@houseoffusion.com] On Behalf Of Rick Faircloth Sent: Tuesday, March 05, 2013 8:48 AM To: cf-talk Subject: Anyone see anything wrong with the syntax of the query? select substring_index(p.mls_number, '_', 1) as p.mls_number, p.street_number, p.street_name, p.city, p.state, oh.mls_number, oh.date, oh.start_time, oh.end_time, oh.host_name fromproperties p left join fortstewart.open_houses oh on substring_index(p.mls_number, '_', 1) = oh.mls_number where p.listing_office_mls_id = '#arguments.listing_office_mls_id#' order byp.street_name, p.street_number I keep getting a CF error stating I have a syntax error on this line: wherep.listing_office_mls_id = '#arguments.listing_office_mls_id#' Anything? Thanks! Rick ~| 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:354819 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: question on cfloop
Do you ever manipulate somearray inside the loop? I am not sure if #ArrayLen(somearray)# is evaluated once or at each looping. -Original Message- From: listmas...@houseoffusion.com [mailto:listmas...@houseoffusion.com] On Behalf Of funand learning Sent: Thursday, February 28, 2013 4:47 PM To: cf-talk Subject: Re: question on cfloop I am sorry, I wasn't clear. the "to" is arraylen. Sometimes the arraylen is 1 #j# --this returns 2 ~| 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:354744 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: form-post to SQL-insert creates double-entry
Oops- forgot that you had CFPARAMs for all the variables. You'd need to remove those with the conditional. -Original Message- From: Dave Jemison [mailto:djemi...@vinesse.com] Sent: Tuesday, January 15, 2013 12:46 PM To: 'cf-talk@houseoffusion.com' Subject: RE: form-post to SQL-insert creates double-entry Do you mean that all the code on one page (input.cfm)? If so, this about it logically. The addDonor query is processed every time the page is loaded- once where the user enters the data (blank data except for the PK) and a second time (with the user entered data). You need a conditional around the query to only fire if the form has been submitted: INSERT INTO DONOR (first,last,flag,supe,phone) VALUES ('#form.first#','#form.last#','#form.flag#','#form.supe#','#form.phone#') Additionally, you need to do some data scrubbing before the cfquery to prevent SQL injection. - Dave -Original Message- From: listmas...@houseoffusion.com [mailto:listmas...@houseoffusion.com] On Behalf Of B Griffith Sent: Tuesday, January 15, 2013 12:34 PM To: cf-talk Subject: form-post to SQL-insert creates double-entry Hello All, I appreciate everyone's help on my other posts and think I'm coming to understand CF a lot better than I did before I started posting here a few days ago, so kudos to you, friends! My latest issue w/ my burgeoning new website is the input.cfm page, where an end-user may (in theory) enter a donor's information into a webform, click submit, and the data will subsequently be inserted into the SQL Server (2005) table dbo.DONOR, which while it's under development, has only six fields: kcid (auto-incrementing PK/UID for the database) and the other five which you see in the code below and are probably pretty self-explanatory. I have tried creating an empty structure called 'form' before applying the code and finally settled on a block of statements to set the vars to a default. I can't see a way around this because NOT doing so causes the form to indeed show at the top of the webpage, but it is followed by a CF error page. INCLUDING the tags or or form = structNew(); causes the error output to go away but results in TWO recordsets being sent to the DB, one blank (except for the PK which is set up to auto-increment in SQL) and one with the correct info, and taking the next PK number. I also tried setting the fields to NOTNULL = TRUE in SQL but to no avail, apparently "" translates into something besides null on the server-side. Here is the code, I would greatly appreciate your thoughts on what I'm doing wrong and how to rectify it: Input form for new donor Donor First Name: Donor Last Name: Donor's Immediate Supervisor: Supervisor's Phone Number: Has this employee provided a sample in the past 30 days? (Y/N): Back to homepage Random Donor Generator INSERT INTO DONOR (first,last,flag,supe,phone) VALUES ('#form.first#','#form.last#','#form.flag#','#form.supe#','#form.phone#') ~| 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:353894 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: form-post to SQL-insert creates double-entry
Do you mean that all the code on one page (input.cfm)? If so, this about it logically. The addDonor query is processed every time the page is loaded- once where the user enters the data (blank data except for the PK) and a second time (with the user entered data). You need a conditional around the query to only fire if the form has been submitted: INSERT INTO DONOR (first,last,flag,supe,phone) VALUES ('#form.first#','#form.last#','#form.flag#','#form.supe#','#form.phone#') Additionally, you need to do some data scrubbing before the cfquery to prevent SQL injection. - Dave -Original Message- From: listmas...@houseoffusion.com [mailto:listmas...@houseoffusion.com] On Behalf Of B Griffith Sent: Tuesday, January 15, 2013 12:34 PM To: cf-talk Subject: form-post to SQL-insert creates double-entry Hello All, I appreciate everyone's help on my other posts and think I'm coming to understand CF a lot better than I did before I started posting here a few days ago, so kudos to you, friends! My latest issue w/ my burgeoning new website is the input.cfm page, where an end-user may (in theory) enter a donor's information into a webform, click submit, and the data will subsequently be inserted into the SQL Server (2005) table dbo.DONOR, which while it's under development, has only six fields: kcid (auto-incrementing PK/UID for the database) and the other five which you see in the code below and are probably pretty self-explanatory. I have tried creating an empty structure called 'form' before applying the code and finally settled on a block of statements to set the vars to a default. I can't see a way around this because NOT doing so causes the form to indeed show at the top of the webpage, but it is followed by a CF error page. INCLUDING the tags or or form = structNew(); causes the error output to go away but results in TWO recordsets being sent to the DB, one blank (except for the PK which is set up to auto-increment in SQL) and one with the correct info, and taking the next PK number. I also tried setting the fields to NOTNULL = TRUE in SQL but to no avail, apparently "" translates into something besides null on the server-side. Here is the code, I would greatly appreciate your thoughts on what I'm doing wrong and how to rectify it: Input form for new donor Donor First Name: Donor Last Name: Donor's Immediate Supervisor: Supervisor's Phone Number: Has this employee provided a sample in the past 30 days? (Y/N): Back to homepage Random Donor Generator INSERT INTO DONOR (first,last,flag,supe,phone) VALUES ('#form.first#','#form.last#','#form.flag#','#form.supe#','#form.phone#') ~| 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:353893 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: calling coldfusion page from SSIS package
Why not have the CF job call the SSIS package? > Hi All - > > I have the following scenario > > 1) Coldfusion page is run as a scheduled job > > 2) After the above script is run, a SSIS package is run. > > I want to make sure that the Coldfusion job is successful before > running the SSIS package. Is there a way to call the coldfusion job > from SSIS package to syncrhonize both the jobs? ~| 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:352655 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: automated screen capture of web pages
That's what I'm leaning towards right now. Unfortunately, the pages I've tested so far are pretty heavy with css and JavaScript and the resulting PDF file looks awful. I'm hoping the archived folders will look nicer... >The cfdocument option John Bliss mentioned works nicely. I just wrote a >script that nicely converted a couple websites on my dev machine into a >collection of pdfs. :) > > > >> >> You can do this with: >> >> cfdocument format="PDF" src="#theurl#" filename="#thefilename#" ~| 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:352564 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
automated screen capture of web pages
A recent project involves removing over a thousand folders from a site and archiving them. There is also a requirement to create an image of each archived page. Rather than manually going to each page (e.g., archived.example.com/folder1/ and manually take a screenshot then save it), I am hoping to find something more automated. My boss suggested snagit, but I don't see how to create an automated process like this with it. I suppose an option may be to loop through the folder and do a cfhttp request and use cfdocument to make a .pdf file of each page? Other suggestions? ~| 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:352555 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: ON-THE-FLY FILTERS
Glad I could help! I remember pulling my hair out a while ago before I figured that one out. Another trick you can use: instead of It's mainly just a matter of preference, but I've found the first way easier to debug when there are a lot of text and variables being concatenated, especially if creating URIs with lots of &s. >Thanks! First time I've ever had to use that one. > > >Have you tried the following? >SELECT tblY.fldX >FROM tblY >#PreserveSingleQuotes(SESSION.F)#; ~| 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:351755 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: ON-THE-FLY FILTERS
Have you tried the following? SELECT tblY.fldX FROM tblY #PreserveSingleQuotes(SESSION.F)#; > CF8 > > SELECT tblY.fldX > FROM tblY > WHERE tblY.fldA='something'; > > That works okay. But I want to set the WHERE clause on-the-fly. So the > user selects the filter (via a form) and the result is stored as > (where > FORM.Result = something) > > Do a cfoutput to check SESSION.F and that shows WHERE tblY. > fldA='something'All is well. > > So, my code is > > SELECT tblY.fldX > FROM tblY > #SESSION.F#; > > The problem is, it now displays as > > SELECT tblY.fldX > FROM tblY > WHERE tblY.fldA="something"; > > And that throws an error. Why does SESSION.F display correctly in the > cfoutput but CF8 changes the ' to " when I use it in 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:351753 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: strange behavior with IE 9
One other item- on another server running CF5 (yes, I know, I know...), the form fields are dumped correctly. And it seems to works okay on CF8. The problem child seems to point to MX 6.1... ~| 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:351702 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
strange behavior with IE 9
Several users who recently got updated computers with Windoze 7/IE 9 now report that they are unable to submit online forms- clicking the Submit button just reloads the page. Everything works as it should with FF/Chrome. I have been able to replicate the problem on my own machine. I even made a plain vanilla page to test the issue: In test.cfm, I dump all the form field variables. FF dumps them all correctly, IE shows nothing. I've Googled the issue and found problems related to using iframes or JavaScript to submit the form, but was unable to find anything dealing with a default installation of IE (which most users are going to use). Changing the method from post to get will allow the form to be submitted, but that's certainly not an option in some cases. Am I missing something staring me straight in the face? ~| 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:351701 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm