Place your non-CF files into a non-web folder (say,
C:\SecureFiles\MySite\ or whatever) and then serve those files through a
CF script. For example, perhaps the file request link looks like this:
href=index.cfm?event=file.downloadid=xyz
Then the file.download event checks the session; if
Nice solution for those in hosted environments, Claude! Simple and
effective!
~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
Seamus,
Can you post your updated query?
~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
OK, I wonder if it's the * in COUNT(*) ... try this:
SELECT tbl_member_language_group.language_group_name,
COUNT(tbl_demographics.contact_id) AS CountOfcontact_id,
tbl_demographics.town,
tbl_demographics.region
FROM tbl_member_language_group LEFT JOIN
I'm with Mike on this one. The query is fine, as you know from running it on
the DB server itself. CF does nothing more than pass through the query to the
JDBC driver, but that query will present no difficulties. The only thing left
that I can think of is that the datasource in CFAdmin
What do you see if you dump?
cfdump var=#rs# /
The metadata should at least confirm the SQL that's getting passed
through. SQL Server certainly doesn't care about CF, it's just serving
the request of the JDBC driver.
~|
Sticky, meaning that a variable holds the same value across multiple
calls, because it's in the application scope, and therefore shared across
all users of that application.
The 'arguments' scope should be used within the body of the function, not
the CFARGUMENT tag. So, this is fine:
Yes, on one of my shopping apps, I put the following right in my
onRequestStart method:
cfif cgi.https is off
!--- redirect to secure connection ---
cfset go = https://; cgi.server_name cgi.path_info /
cfif len(cgi.query_string)
cfset go = go ?
Completely agree with Brad. Also wouldn't hurt to ensure that the
arguments parameters aren't sticky, by referencing the scope of 'language'
and 'placeholder' as appropriate.
cffunction access=public name=lookup returntype=string output=no
hint=Returns the text found for the given language
!--- get the time in whole number, 24-hour (military time) ---
cfset timeTest = val(timeFormat(now(), HHmm)) /
!--- run the tests ---
cfif (timeTest lt 800) or (timeTest gte 1200 and timeTest lt 1400) or
(timeTest gt 1700)
img src=imageToShow.jpg /
/cfif
The exception is blank, which cannot be resolved as Boolean.
So, cfif isBoolean(variableName) and variableName will truly resolve
either true or false.
~|
Want to reach the ColdFusion community with something they want? Let
Actually, empty string simply breaks the Boolean check, it's the primary
exception.
cfif isBoolean(stringVar) ...
will at least let it through only if it's actually a value that CF can
apply a true/false test to ...
From: Peter Boughton
That totally depends on your DB setup.
If you have a column that does not allow NULL, then you have have send the
empty string ('') if there's no value. If you have SQL code that tests
Country IS NULL, then you may want to send NULL for that value in place of
the empty string.
Again,
I would guess that the urlEncoded() version is probably longer than the
line length of some email readers, so it's getting truncated and then your
app gets a partial ID back. +1 to Alan on the idea of only passing the ID
...
From: Alan Rother
What are the data types of the columns you're trying to GROUP BY? I'm sure
it will barf on a memo field, for instance.
~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of
Right, include all the columns, but also
GROUP BY cluster
not
GROUP BY clust
In other words, group on the actual column name, not the alias.
Now, if your goal is simply to get only 1 of every record combination, since
you're not using any other Aggregate functions besides GROUP BY, why
Okay, that makes sense, but I'm thinking that you won't be able to do the
grouping at the SQL level in that case.
As Jochem noted, GROUP BY can only put records together where all the
grouped fields match, and the assumption is that all other columns are
summarized or otherwise aggregated.
Doesn't look like any of the parens are actually necessary on this
query, are they?
Shot in the dark here, but is exception a reserved word in SQL Server?
~|
Want to reach the ColdFusion community with something they want? Let
Eventually integers do get too large for the database field. If you're
truly adding a million new IDs / day, that could happen. There's a fairly
modest upper limit to 'int', so definitely look at 'bigint' (SQL Server) to
handle integer IDs if you take that route.
Collation's not the problem, but the Data Type of your columns might be.
Make sure you're using nvarchar ntext (not varchar and text) [SQL Server]
and ensure that both page and form encoding allow Unicode, like using
charset UTF-8.
Better yet, just define the function outside the loop (top of the
template?) and then just call it from inside your loop.
From: Don L do...@yahoo.com
Sent: Wednesday, June 10, 2009 2:39 PM
To: cf-talk cf-talk@houseoffusion.com
Subject: Re: CFfunction
Just looking at the link you sent in a browser, the image is nearly all
black, which makes me think it's a CMYK jpeg, instead of an RGB jpeg.
Browsers and the Adobe image engine can't handle the CMYK ... that's my
guess.
The other benefit of createUUID() is that you can later split / combine
records from different tables if you ever need to, such as pulling
production records down to review in development ... no integer clashes
when you've got fully unique values across the tables and datasources.
Looks like that was fixed in JVM 1.3.1_04 ... and CF 8 is shipped with 1.6.0_4,
with the recommendation to upgrade to 1.6.0_11 or higher, so I think we're OK
on the server clock issue
(http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4500388). Fascinating,
though.
I have also had decent luck with the hidden form field. In your form, put
an input type=text in a div that is display: none, so the field isn't
technically hidden, but a human won't see it, and then call the field
something like name=lastName, something that a bot will always fill out.
Assuming you're on CFMX 7 or 8, you no longer need to LOCK on READ, so if
you're concerned about race conditions on the WRITE, just do:
cflock scope=session type=EXCLUSIVE timeout=10
cfset session.foo = application.bar
/cflock
(timeout can be whatever is appropriate)
You could do it better with aggregate functions, but this will work, too.
Just make the completionDate lookup part of your base query (note the LEFT
OUTER JOIN), and then use the GROUP attribute of the CFOUTPUT tag to do the
looping for you in one go:
cfquery name=getCareManagers
That would work, but it's unnecessary overhead unless you're still on CF 5.
Virtually all that locking has been handled in MX.
~|
Want to reach the ColdFusion community with something they want? Let them know
on the House
Query of Queries would work really well, and would be very efficient ...
why not do that?
Query 'employees' has: firstName, lastName, title, email, phone, ext
cfquery dbtype=query name=employees
SELECT firstName,
lastName,
email
FROM employees
/cfquery
That would get you there with very
What does your full CFFORM tag look like?
~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
On #2, I assume then that you know which column you would be removing, so
how about:
get the list of current columns, whatever they are:
cfset colList = employees.columnList /
remove a known column, in this example phone:
cfset colList = listDeleteAt(colList, listFindNoCase(colList, phone))
/
@Jay
Yes, fair enough. Granted that CF doesn't guarantee the order of
execution when processing threads in a request, does the application in
this case really have the possibility of having multiple threads making
sequential changes to that specific session variable (which is
thread-safe to
Rick,
If it looks unclear, you can also do the following:
cfoutput query=getStuff group=theTitleFieldHere
h1#someTitleField#/h1
cfoutput group=theDetailField
p#theDetailField#/p
/cfoutput
/cfoutput
Note that the inner CFOUTPUT has 'group' attribute, but no 'query' attribute.
The plain
It's actually been there since 4.0, I believe. I know they added the
groupCaseSensitive attribute in 4.5, so the group option was in place by
that point. Essentially it's a way to get your output to follow your SQL
groupings, when that sort of thing is necessary. So like doing a blotter
LOL, don't you just love finding something new that makes life (or at least
coding) easier?
~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
Correct. cmd.exe simply opens the window which allows you to run batch files
... that's what CFEXECUTE is already doing for you. So just run this:
cfexecute name=f:\inetpub\webroot\real_estate_data\hmls\10_hmls_batch
files\load_hmls_active_photos.bat /
Execute the batch file directly,
+1 for Red-Gate's SQL Compare and Data Compare. Not only finds the
differences, but one click to generate the code to go from either
version to the other version. Very handy.
~|
Want to reach the ColdFusion community with
Ummm, not sure why your cookie.theID would shift, but I would say absolutely
that the CF_SQL_TYPE is designed to match the database column data type, not
the incoming variable parameter. The entire point of the CF_SQL_TYPE is to let
the JDBC driver handle the data pass-through for you in a
Try a sub-query. Pretty sure this will get you what you're looking for (or
close):
SELECT sub.thisCount,
sub.emailID,
e.emailAddress
sub.emailDate,
sub.groupID
FROM log_email e RIGHT OUTER JOIN
(
SELECT COUNT(emailAddress) AS
cfset listLoc = listFind(orderIDList, url.orderID) /
cfif listLoc eq 1
cfset prevOrderID = /
cfelse
cfset prevOrderID = listGetAt(orderIDList, listLoc - 1) /
/cfif
cfif listLoc lt listLen(orderIDList)
cfset nextOrderID = listGetAt(orderIDList, listLoc + 1) /
cfelse
cfset nextOrderID = /
/cfif
, May 01, 2009 10:43 AM
To: cf-talk cf-talk@houseoffusion.com
Subject: RE: list question
Jason,
This worked like a champ...
Thanks
sas
--
Scott Stewart
ColdFusion Developer
4405 Oakshyre Way
Raleigh, NC 27616
(h) 919.874.6229 (c) 703.220.2835
-Original Message-
From: Jason Fisher
An unchecked checkbox doesn't exist in the subsequent form scope. Move
your CFIF up above your CFSET's:
cfloop index=pmt from = 1 to = #form.numrows#
cfif isDefined(form.paid_#pmt#) and Trim(pd) eq Confirmed
cfset pd=form['paid_' pmt]
cfset rid=form['regid_' pmt]
cfquery datasource=#dsn#
I recommend that you sit down with the designer and your CF template and go
through the basics of how CF interacts with the HTML. Show CFLOOP and
CFOUTPUT and how HTML blocks may get repeated, etc. Impress on the
designer that any CF tag should be left in its current position relative
to
In CF Admin, under Server Settings Mail, in the Mail Logging Settings,
you can set both the logging level (Error, Warning, Info, etc) as well as a
checkbox to Log all mail messages sent by ColdFusion.
~|
Adobe® ColdFusion®
And for all those reading this and using MSSQL, an inline statement would look
like this:
cfquery ...
declare @p1 nvarchar(50)
set @p1 = '#userSuppliedValue#'
select *
from tableName
where column = @p1
/cfquery
So, basically cfqueryparam is creating the Declare and Set for you.
Ah, yes, Francois, you are correct. I forgot to mention that in addition
to creating the @var parameters (which you can see in the CF debug output),
the CFQUERYPARAM also ensures that you don't get '; BAD SQL INJECTION'
stuff getting through into your SET @p1 = '#myUserVar#' expression.
Dominic, you are right that there are exceptions from a performance
perspective ... can't remember who blogged about that in detail? See Simon
Horwith's for one example:
http://www.horwith.com/index.cfm/2009/4/5/some-cf-best-practices-that-break
But you are right about the Query Plan
I can't speak for MySQL, but in MSSQL, every query (not just prepared
statements) is processed into a Query Plan before processing. The server then
caches as many of these QPs as possible, so that repeated calls to the same
'query definition' do not have the overhead of having to re-generate
Not sure what you're looking for Steve ... just the syntax for adding your
'dayview' value to the URL string? Also, as a side note, you can get rid of
most of those # signs ... The following will add your computed date to the URL
string in a 'safe' format, passing it as a variable called
Some notes on the right MIME type for the Office 2007 formats, which IIS6
doesn't know how to handle.
http://www.jameskovacs.com/blog/ConfiguringIIS6ToServeOffice2007FileFormats.
aspx
~|
Adobe® ColdFusion® 8 software 8 is
Absolutely.
cfset myCustomVar = whateverABC1299X /
...
cffile ... destination=#dest##myCustomVar#.#cffile.serverFileExt# /
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free
Look at Lucene, which you can drop into your codebase and run as your indexing
engine. It's an open source Java-based solution.
http://lucene.apache.org/
Ray's also got a ColdFusion wrapper for it, called Seeker:
http://seeker.riaforge.org/
You don't want to use the '' inside the CFFILE tag. Try this, assuming
#dest# is a variable holding a full file folder path ending with '\':
cfif structKeyExists(form, upload)
cfloop index=i from=1 to=#Session.numberoffields# step=1
cfset variables.filename =
Use cgi.remote_addr ... that will be the address of the User, rather than
the Server. That should do it.
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
Not quite sure what you're after, but if you're using CFHTTP and trying
to reconstruct a URL that gets generated from a request, like in the
case of a redirect, try this:
cfhttp method=GET url=http://www.yourHTTPREquest.com/?blah=blah;
redirect=No/cfhttp
cfset httpURL =
Definitely not odd, when you think through all the possible use cases. If I
build an auto-incrementer that takes in any start date, then I may have a July
28 start, which would indicate that 1 month out must be August 28 and one month
back must be June 28. Given that scenario, how would the
At its most basic, GET will populate the URL scope, POST will populate the FORM
scope. Is there a reason you can't look to the FORM scope during processing?
~|
Adobe® ColdFusion® 8 software 8 is the most important and
Dunno about the raw Java handler, but it appears that a custom CF 404
handler does have full access to URL, FORM, CGI, etc.
I threw together a CF template with this body and called it dsp.404.cfm:
h1I am a 404 handler/h1
form action=nofile.cfm method=post
input type=Text name=varString
Actually, I had forgotten that my local dev is probably still IIS 5, where
this works perfectly. Reproducing the Custom 404 on IIS 6, however, works
splendidly *except* that it doesn't pick up the FORM scope at all. Now,
that's odd.
I wouldn't want to guarantee anything, but if you uninstalled the current
CF8 multiserver dev version, and left the current CF7 running, then I think
a fresh install of CF8 would pick up your CF7 settings and you'd be in
business. Not sure if that's what you're looking for, but I think that
It could be that the CFX you are using were compiled in 16-bit, which we have
found to be problematic on 64-bit Citrix. Not sure that CF8 64-bit would have
the same issue, but it wouldn't be out of the question. In other words, we
have found that 32-bit apps run fine on 64-bit, but 64-bit
In that case, it sounds like you may be able to simply add the CF8 Standard
license to the current CF8 Dev install. You can stop and disable the CF7
services through the Services console, get everything up and running with CF8,
and then uninstall CF7. Should work. If you need to copy
Dan makes a good point about hardware and clustering, although if you do your
clustering at the hardware level (that is, a hardware load balancer), then
Standard edition where apps utilize Client vars in the DB will serve you quite
well.
You're getting the numeric index, rather than the currency value. Try this,
assuming that the database has columns like 'product_price_eur'.
for (i=1; i LTE listLen(currencies); i=i+1) {
c = listGetAt(currencies, i);
product_price_#c# = evaluate('getProduct.product_price_' c);
And the new folder in NTFS permissions has access allowed by the local IUSR
account?
Yep, same as the other sites...anonymous access enabled...
Rick
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic
As Brad notes, messageid is your best bet for uniqueness ... messagenumber is a
query column, too, but it changes per request (recalculated based on what's in
the folder on the server). If you need a unique value in the DB, I would go
with messageid rather than subject, but it sounds like
I would agree with Brian and Claude on adding the column for sorting. It
would be easy enough to adjust your INSERT / UPDATE calls to auto-create
the sort version, like this:
cfset sortTitle = replace(reReplaceNoCase(form.title, (A|An|The) (.*),
\2, \1), , , all) /
UPDATE ...
SET title =
This is invalid:
distinct(count prodcode)
Are you trying to do a DISTINCT on the aggregate function COUNT()?
Not sure that would work, but it would have to be DISTINCT COUNT(prodcode)
if that's what you're after.
~|
Interesting ... COUNT(DISTINCT prodcode) will work, huh? That may come in
handy some day. Thanks!
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
Not sure of your column names, or where your 'price' value is stored, but I
think you want something like what's below. Note that this also will show
all your products which may have had '0' orders so far (by using the LEFT
join).
cfquery name=get_orders datasource=#application.dsn#
Awesome, glad to help! Aggregate functions are your fun and easy
friends (SUM, COUNT, MIN, MAX, GROUP BY) ... good stuff.
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free
How about this, using an expression for the ROWNUM test ... not sure it works,
but some variation of this may be worth a try?
SELECT stuff
FROM aTable
WHERE ROWNUM (COUNT(*) - n)
ORDER BY query_seq DESC
~|
Adobe® ColdFusion®
No, it shouldn't. There is no subquery, only the aggregate COUNT() function,
and that's simply there to get the max number of rows. Max number - n = our
starting number for last n, right? so I don't care about sorting within the
COUNT(), only the aggregate value. The simple query is still:
I don't have access to an Oracle database, so, no. Thankfully, I haven't
had to develop on Oracle for the past several years, after spending several
years splitting my time between Oracle and SQL Server. Seems like it
should work, but I can't verify.
You're setting the value of session.pageList to the string arrayNew(), which
is throwing your error. If you're using cfparam then you need the # signs and
to create an array you need to specify the number of dimensions (in this case
1):
cfparam name=session.pageList default=#arrayNew(1)# /
As Dominic pointed out above, just do:
cfset arrayAppend( session.pageList, structNew() ) /
ArrayAppend() returns true / false, not an array.
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
@Adrian,
Interesting question ... can't really think of anything off-hand.
From: Adrian Lynch cont...@adrianlynch.co.uk
Sent: Wednesday, March 11, 2009 11:25 AM
To: cf-talk cf-talk@houseoffusion.com
Subject: RE: Append Arrays with Structures
Out of
Thanks for the info, Dominic. Seems like that shouldn't make sense ... a
Boolean that has no 'off' state, yet it perfectly makes sense that only an
exception could be 'false' and exceptions need to be thrown, not simply
reported as 'false'.
Thanks!
Jason
Jeanmarie,
In Billy's example, if the Linked Server (which is a reference to the Access
database) is called 'ACCESSNOTES', and if you want to make a SQL Server call to
a table called 'NOTES' in that database, the FROM statement would look like
this (note the extra .s in there):
FROM
In my experience, co-lo is the way to go for ColdFusion installations,
simply due to the inexperience of many sysadmins in dealing with CF Admin
and all the minor performance tweaks that we tend to become familiar with
over time. One downside of co-lo, however, can sometimes be physical
3 . is correct. The authentication issue would probably be related to the
Linked Server configuration (just a guess), but the fact that you even get an
auth error seems to indicate that the 3 . is getting you to an actual DB
connection. Basically, not too generalize overly much, the dot
More specifically, what are you going to do with 300,000 ntext fields ... that
could potentially be many GB of data, which the server will be holding in
active memory. As a general rule, I leave my ntext fields out of any query
that's pulling a list of more than a few items.
IIRC, blockFactor is only relevant on the Oracle drivers, and it refers
specifically to how Oracle expects to batch and return large recordsets. If
Oracle is allowed to spool out large recordsets without returning them in
blocks, it will often spin the DB server out of threads, which then
So, your function definition has been simplified like the below and it's
still throwing the error?
cffunction name=fnProcessForm displayname=fnProcessForm
hint=Processes Submitted Form output=false access=remote
returnType=struct
cfargument name=dsn type=string required=Yes /
Or, if you're trying to figure out how to select the value from the database,
you may be looking for something like this:
form ...
cfoutput query=qRecord
select name=selList size=1
cfloop query=qData
option value=#idValue# cfif qRecord.idValue is
idValueselected/cfif#displayValue#/option
You need:
cfset SESSION.consumerProduct.Cnsmr_ProductID = Form.Cnsmr_ProductID
(without the double quotes )
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
cfquery name=qListeners datasource=#request.dsn#
SELECT *
FROM dbo.#stationName#_listener_list
Where (username LIKE cfqueryparam value=%#form.keyword#%
cfsqltype=cf_sql_clob
OR name LIKE cfqueryparam value=%#form.keyword#% cfsqltype=cf_sql_clob)
cfif structKeyExists(form, myCheckBox)
Dominic makes a good point. To this end, I often find it useful to use my
'sortBy' params as aliases rather than as direct SQL, so something like this:
cfargument name=sortBy type=string default=name /
cfset var order = /
cfswitch expresssion=#arguments.sortBy#
cfcase value=id
cfset order
I've been real happy with CrystalTech.com for shared CF hosting. They offer
CF8, SQL 2005 (not sure about 2008, but haven't looked into it), and SSL. Just
one vote ;)
~|
Adobe® ColdFusion® 8 software 8 is the most important
HTML, of course, will run 'as is'. To get CF to run, you need to execute it,
generally with a DE() wrapper, if I recall correctly:
cfoutput query=myContentQry
#evaluate(de(myContentFieldWithCFTags))#
/cfoutput
~|
Adobe®
Or, if you don't need to loop the output for any other reason, just do this
once, without using CFOUTPUT at all:
cfset myList = valueList(n1.n1Id) /
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic
Not quite I sure I follow (sorry, almost out the door here), but I think
you just want your aggregate to an entry for every A regardless of B,
right? Try making your joins LEFT, and I think you'll have it:
...
FROM
tableA p LEFT OUTER JOIN
tableB e ON (p.use_no = e.use_no AND p.year
In a hardware load-balanced environment, I have always used Client vars rather
than Session. (Just make sure you store them in the DB, not in the Registry.)
Basically, the Client vars are a contract between the browser and the
application, whereas Session vars are a contract between the
@Brad,
I totally understand that issue of having large / complex session blocks and
facing the potential of deep re-work. One thought in that vein, especially
thinking forward to the potential performance shocks of running large sessions
in memory: you may want to consider pushing more to
Try this:
cfoutput
cfloop from=1 to=7 index=i
cfset variables[F_Name#i#] = Form[L_Name i]
#variables[F_Name#i#]# br /
/cfloop
/cfoutput
I think that's what you're looking for. I used variables scope simply to more
easily use the struct
Not sure about what the record_with_dups is exactly supposed to
represent, but it looks like you want something along these lines:
SELECT a.county, a.rec_type, COUNT(a.use_no) AS records,
COUNT(b.dup_set) AS record_with_dups
FROM [Table A] AS a LEFT OUTER JOIN
[Table B] AS b ON a.use_no =
You're not doing anything wrong, any system that tries to import the CSV will
automatically assume that every comma is a field delimiter, just like it's
supposed to do. If you have content with commas in, you'll have to pick a
different field delimiter, like Tab or pipe (|).
Example with
Highly recommend the Dymo LabelWriter printers. (No, there is no commercial
relationship here, I just use their printers.) I've got a CF app pushing
labels through from the browser to the local machine using the ActiveX that
comes installed with the printer driver for the LabelWriter 400
This should do it:
SELECT
max(nl_mailgroups.ml_id) as ml_id,
max(nl_mailgroups.ml_firstname) as ml_firstname,
max(nl_mailgroups.ml_lastname) as ml_lastname,
max(nl_mailgroups.other) as other,
nl_mailgroups.ml_email
FROM nl_mailgroups INNER JOIN
Definitely more difficult if you're limited on the printer side. What I like
about the Dymo's isn't just the printer, but the label software, which reads
the label type and didn't require any use of HTML or CSS ... I literally set
the label template up in Dymo's own software and then just fed
301 - 400 of 513 matches
Mail list logo