You're missing quotes.
1 : !--- if the cookie is here, procees to dashboard ---
2 : cfset validated_id=0
3 : cfif isDefined(session.userid)
Wil Genovese
Sr. Web Application Developer/
Systems Administrator
CF Webtools
www.cfwebtools.com
wilg...@trunkful.com
www.trunkful.com
On Aug 22, 2011,
blog: AW Unplugged
http://www.austin-williams.com/unplugged
-Original Message-
From: Wil Genovese [mailto:jugg...@trunkful.com]
Sent: Monday, August 22, 2011 1:53 PM
To: cf-talk
Subject: Re: What the heck
You're missing quotes.
1 : !--- if the cookie is here, procees to dashboard
It should be cfif isDefined(session.userid) isdefined requires what you are
looking for to be in quotes unless the variable name you are looking for is
stored in session.userid.
Steve
-Original Message-
From: Robert Harrison [mailto:rob...@austin-williams.com]
Sent: Monday, August
IsDefined takes a string. But you'll want to do structKeyExists instead
anyway.
On Mon, Aug 22, 2011 at 11:50 AM, Robert Harrison
rob...@austin-williams.com wrote:
What am I missing here
Element USERID is undefined in SESSION.
The error occurred in
Your comment mentions cookie .. should it be (cookie.userid)?
-Original Message-
From: Robert Harrison [mailto:rob...@austin-williams.com]
Sent: Monday, August 22, 2011 12:51 PM
To: cf-talk
Subject: What the heck
What am I missing here
Element USERID is undefined in SESSION.
Your comment mentions cookie .. should it be (cookie.userid)?
That's further down :-)
cfif isDefined(session.userid)
cfif session.userid gt 0
cfset validated_id=#session.userid#
/cfif
cfelseif IsDefined(Cookie.StudentPortalUser)
cfset
cfif StructKeyExists(cookie,StudentPortalUser)
Is what I would do
Same with Session
cfif StructKeyExists(Session,UserID)
-Original Message-
From: Robert Harrison [mailto:rob...@austin-williams.com]
Sent: Monday, August 22, 2011 1:16 PM
To: cf-talk
Subject: RE: What the heck
It doesn't really matter, but I just... can't... let... it... slide.
No need for a single hash in this code.
cfif isDefined(session.userid)
cfif session.userid
cfset validated_id = session.userid /
/cfif
cfelseif IsDefined(Cookie.StudentPortalUser)
cfset
What am I missing here
That would be quotes... isdefined('session.userid')
Prepare yourself for the suggestions of changing to structKeyExists(session,
'userid')
.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
http://cf4em.com
-Original Message-
From: Robert
On Monday 09 Mar 2009, Claude Schneegans wrote:
Each memo field needs some special treatment and only some specific
words are retrieved.
So I need to simply read all records and loop on them.
Use maxrows/startrow to do it in blocks of 1000 or something.
--
Tom Chiverton
Helping to centrally
On Sun, Mar 8, 2009 at 11:42 PM, Claude Schneegans wrote:
I've always thought that all what CFQUERY was doing was to create some
connection to the database, and then the actual content of all records
would be read as needed during some loop on the result set.
That would be impossible for CF
That doesn't work because getArmes contains only a count of the records in
armesArmoriaux, not the actual records.
-Original Message-
From: Al Musella, DPM [mailto:muse...@virtualtrials.com]
Sent: Sunday, March 08, 2009 7:37 PM
To: cf-talk
Subject: Re: What the heck is happening during
:44, Billy Cox wrote:
That doesn't work because getArmes contains only a count of the
records in
armesArmoriaux, not the actual records.
-Original Message-
From: Al Musella, DPM [mailto:muse...@virtualtrials.com]
Sent: Sunday, March 08, 2009 7:37 PM
To: cf-talk
Subject: Re: What
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.
It gets a connection
from the pool, queries the DB, retrieves all the data and finally
returns the connection to the pool.
Well, I'm stunned. I was sure CF was better designed than that.
I thought that data was retrieved as loops were going.
Obviously course, with 300k records, CF is reading
I don't think this is unexpected behaviour
It is not only unexpected, it is completely retarded.
All ODBC/JDBC functions are designed so the database can be connected,
then the SQL statement be compiled, then data retrieved row by row, as
needed. Even dBase, Clipper, Foxpro worked this way.
There are a number of reasons why running the select directly in
Access may
appear much faster.
1) You are probably running it locally so there is no costly transfer of
data between servers.
I'm running the CF app locally also, so the difference does not come
from connexion time.
Anywa, the
Change it to this and the time should go down by a factor of about
100,000
Thanks, you bet this is what I would have done if I only needed the
number of records ;-)
The output of recordCount was there only for illustration purpose.
On Mon, Mar 9, 2009 at 4:18 PM, Claude Schneegans wrote:
All ODBC/JDBC functions are designed so the database can be connected,
then the SQL statement be compiled, then data retrieved row by row, as
needed.
CF just needs all the records all the time because that is the only
way to get a
More specifically, what are you going to do with 300,000 ntext fields
I am creating a cross table index on word found in memo fields.
Each memo field needs some special treatment and only some specific
words are retrieved.
So I need to simply read all records and loop on them.
I found another
- if the resultset were never used the query would never be run on
the server;
Well, if the result set is not used, what is the advantage of having the
query run anyway?
- if the resultset were used multiple times the query would be run
multiple times on the server;
If the result set is
CF just needs all the records all the time because that is the only
way to get a recordcount.
While I don't think that is quite true, I do think there is a good
reason for having the resultset downloaded at once. ColdFusion expects
you to use the recordset within the single request and this
just out of curiosity:
did you try experimenting with BLOCKFACTOR attribute of cfquery?
i am just curious, since you already are retrieving such a large
dataset, if using blockfactor makes any difference at all on processing
time...
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Claude
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
because that is the only way to get a recordcount.
A big price in efficiency to pay for something we use only sometimes.
Most of the time, we only need to know if there are records or not.
~|
Adobe® ColdFusion® 8 software 8
If that's all you need to know, use SELECT TOP 1...
On Mon, Mar 9, 2009 at 11:05 AM, Claude Schneegans
schneeg...@internetique.com wrote:
because that is the only way to get a recordcount.
A big price in efficiency to pay for something we use only sometimes.
Most of the time, we only
What we are really talking about here is having the right tool for the
job.
dBase, Clipper and FoxPro are all database management systems, and so
are designed to work efficiently in examples like the one you are
citing.
ColdFusion is a Web Application server, designed to interact with a
Indeed, while the initial query may take longer, it is perhaps better
performing than hitting the db on each iteration within the request.
Thoughts?
Perfectly right for small result sets.
But as soon as the virtual memory must be used, each record will
generate some read-write-reread action,
did you try experimenting with BLOCKFACTOR attribute of cfquery?
i am just curious, since you already are retrieving such a large
dataset, if using blockfactor makes any difference at all on processing
time...
The blockfactor is supposed to be one by default, but I tried it anyway,
and no, it
blockFactor is only relevant on the Oracle drivers
CF 5 doc says This parameter applies to ORACLE native database drivers
and to ODBC drivers
This is ambiguous, If it applies only to Oracle, it should be stated:
This parameter applies to ORACLE native database drivers and to ORACLE
ODBC
On Mon, Mar 9, 2009 at 4:44 PM, Claude Schneegans wrote:
- if the resultset were never used the query would never be run on
the server;
Well, if the result set is not used, what is the advantage of having the
query run anyway?
A select isn't necessarily idempotent (if CF were able to
On Mon, Mar 9, 2009 at 5:05 PM, Claude Schneegans wrote:
because that is the only way to get a recordcount.
A big price in efficiency to pay for something we use only sometimes.
Most of the time, we only need to know if there are records or not.
That is what maxrows is for. The query will
On Mon, Mar 9, 2009 at 4:41 PM, Dominic Watson wrote:
CF just needs all the records all the time because that is the only
way to get a recordcount.
While I don't think that is quite true
It is not strictly true. You can declare a cursor, do a move end, read
from the metadata how many records
if cf did not get the full dataset from the db, would it still be able
to show query debugging / execution times / etc, and would cf monitor
still work and be able to show you long-running/unoptimized queries / etc?
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
(if CF were able to determine it was a select in the first place)
Well, it must be able somehow to determine the query returns data,
otherwise, how would it create a structure from any result set?
~|
Adobe® ColdFusion® 8
Subject: Re: What the heck is happening during CFQUERY?
From: Claude Schneegans schneeg...@internetique.com
Date: Mon, March 09, 2009 1:11 pm
To: cf-talk cf-talk@houseoffusion.com
(if CF were able to determine it was a select in the first place)
Well, it must be able somehow to determine
Regardless, CF wouldn't know if the cfquery was going to return a result
set until after it had sent the commands to the database for execution
and waited for the results to come back, and that would sort of defeat
the purpose, wouldn't it?
No, because the driver does not return the result set,
It seems like you know a bit about databases. Why not write the
looping code in the database using T-SQL, VB, or .NET and keep CF out
of the picture entirely? What is CF providing that makes you want to
use it for this index building task? It doesn't sound like you are
serving up Web pages to
Yes, CFQUERY reads all the content of the query. It gets a connection
from the pool, queries the DB, retrieves all the data and finally
returns the connection to the pool.
mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/
2009/3/9 Claude Schneegans
The CFQUERY connects to the database, returns the whole of the
resulting query result into the specified variable, then closes the
connection; the variable is held in memory for the lifetime of the
request.
So, if you run a query that, as in this case, returns more than
300,000 records,
By the time the cfquery tag has finished executing the entire data set has
been returned from the database and is loaded into memory in ColdFusion.
If the cfquery tag is taking a very long time to complete then:
1) The actual SQL is taking a long time to complete.
2) and/or you are returning a
Change it to this and the time should go down by a factor of about 100,000
:
CFQUERY NAME=getArmes DATASOURCE=Armoriaux
SELECT count (*) as N
FROM armesArmoriaux
/CFQUERY
CFOUTPUTgetArmes.recordCount = #getArmes.n#BR
cfquery.ExecutionTime = #cfquery.ExecutionTime#BR/CFOUTPUTCFABORT
]
Sent: 04 August 2003 20:35
To: CF-Talk
Subject: RE: What the heck is wrong with this Query?
::: CFSET egypt_Count =
ListValueCountNoCase(ValueList(PA_CT.PA_COUNTRY),egypt)
:: De-dupe the list then count it
How you you do that, exactly?
I need to be able to use #InsertNameOfCountryHere_Count
you need to add the other columns in the group by clause...
cfquery name=PA_CT datasource=phoenixart
SELECT
DISTINCT PA_COUNTRY,
ID,
PA_CATEGORY
FROM
papers
GROUP BY
PA_CATEGORY,
ID,
PA_COUNTRY
/cfquery
That should work...
Mike
- Original Message -
cfquery name=PA_CT datasource=phoenixart
SELECT DISTINCT PA_COUNTRY, ID, PA_CATEGORY
FROM papers
GROUP BY PA_CATEGORY, ID, PA_COUNTRY
/cfquery
will work.
I think that all of the columns in a select distinct need to be in the
groupby also if I remember correctly.
-Original Message-
that you don't
want grouped, ie MIN, MAX, AVG, COUNT...etc, varies on what db you use
hth,
seth
-Original Message-
From: Bryan F. Hogan [mailto:[EMAIL PROTECTED]
Sent: Monday, August 04, 2003 9:45 AM
To: CF-Talk
Subject: RE: What the heck is wrong with this Query?
cfquery name=PA_CT
The query itself doesn't error out like this, but I'm not getting the needed
results to count categories like I need:
cfquery name=PA_CT datasource=phoenixart
SELECT DISTINCT PA_COUNTRY, ID, PA_CATEGORY
FROM papers
GROUP BY PA_COUNTRY, ID, PA_CATEGORY
/cfquery
CFSET egypt_Count =
De-dupe the list then count it
:)
-Jack
-Original Message-
From: Les Mizzell [mailto:[EMAIL PROTECTED]
Sent: Monday, August 04, 2003 10:33 AM
To: CF-Talk
Subject: RE: What the heck is wrong with this Query?
The query itself doesn't error out like this, but I'm not getting
in this e-mail are those of the individual sender and
may not necessarily reflect the views of ICLP.
-Original Message-
From: Les Mizzell [mailto:[EMAIL PROTECTED]
Sent: 04 August 2003 15:33
To: CF-Talk
Subject: RE: What the heck is wrong with this Query?
The query itself doesn't
::: CFSET egypt_Count =
ListValueCountNoCase(ValueList(PA_CT.PA_COUNTRY),egypt)
:: De-dupe the list then count it
How you you do that, exactly?
I need to be able to use #InsertNameOfCountryHere_Count# anywhere on the
page as needed - for each of some 30 different countries
error, but deleting the attribute altogether
makes it run like a charm - like it did on 4.01.
Thanks for the tips, hints and advice.
Erika
- Original Message -
From: "Peter Tilbrook" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, April 18, 2000 9:09 PM
Subject: RE: What the
Make sure your database file is not read only
Duane
-Original Message-
From: Erika Foster [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 19, 2000 12:56 AM
To: [EMAIL PROTECTED]
Subject: What the heck is wrong with 4.5 and my queries?
The first problem I encountered after
The custom tag just might not be compatible with 4.5. I had to go back to
4.01 for a similar reason (but with a CFX).
-Original Message-
From: Erika Foster [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 19 April 2000 2:56 PM
To: [EMAIL PROTECTED]
Subject: What the heck is wrong with 4.5 and
53 matches
Mail list logo