That's the actual sql... a simple statement.
Now this is strange... I ran a little test.
I changed the event_day data directly in the database
from 1,1,1,3,4,6 or whatever it was and added one
to each digit and made the event_day data 2,2,2,4,5,7.
This data is in a MySQL db with a field type of
now that IS strange... is there some query caching involved???
i have even reproduced your table and query on my CF8/MySQL5 setup, and
it returns correct data...
does your cfdump still return 1,1,1,1 ???
did you try running:
cfoutput query=get_days
#get_days.event_day#br/
/cfoutput
(no cfloop)
Rick,
This might sound really, really stupid... but is your datasource
pointing to the a different version of your database? Also, make sure
that caching is turned off within the admin for things like class files.
Matthew Williams
Geodesic GraFX
www.geodesicgrafx.com/blog
I know this does not solve the actual problem but if all you need to do is
convert 1-7 to the day of the week you could just make a query result using
the QueryNew() function and avoid querying the database altogether. Are you
100% sure this is the only query in the site returning incorrect data?
I doubt it would make any difference, if the cfdump has the wrong values
then the problem would be outside of how he is looping over the query and
referencing the values.
On 10/15/07, Azadi Saryev [EMAIL PROTECTED] wrote:
now that IS strange... is there some query caching involved???
i have
Could CF8 be converting the Tiny Integer type to say a bit/boolean type?
Could you quickly test using an equivalent table but use integer instead
of tiny integer?
-Original Message-
From: Rick Faircloth [mailto:[EMAIL PROTECTED]
Sent: Monday, October 15, 2007 8:02 AM
To: CF-Talk
Could CF8 be converting the Tiny Integer type to say a bit/boolean type?
I was thinking about this, but in this case, all even values would
converted to zeros, not ones
--
___
REUSE CODE! Use custom tags;
See
@ Azadi: The cfdump reports no query caching. Even after I manually
changed the data in the database to exclude the integer 1, I still get
all 1's ! What datatype did you assign to event_day? If it was tinyint,
did you give it a length of 1?
@ Matthew: I changed two things to make sure I
It could be more simple...
All non-zero values are true.
-Original Message-
From: Claude Schneegans [mailto:[EMAIL PROTECTED]
Sent: Monday, October 15, 2007 10:57 AM
To: CF-Talk
Subject: Re: Why would this query not return the correct data?
Could CF8 be converting the Tiny Integer
When accessing MySQL 5 from Java (i.e. when using JDBC) all TINYINT(1) fields
are converted to
Boolean values.
Documented here:
http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-type-conversions.html
You can prevent this behavior by adding a Connection String to your
ColdFusion
Thanks, Tom!
Rick
-Original Message-
From: Tom Donovan [mailto:[EMAIL PROTECTED]
Sent: Monday, October 15, 2007 1:44 PM
To: CF-Talk
Subject: Re: Why would this query not return the correct data?
When accessing MySQL 5 from Java (i.e. when using JDBC) all TINYINT(1)
fields are
Hi, all.
Here's the query:
cfquery name=get_days datasource=#dsn#
select distinct event_days from weekly schedule order by event_day
/cfquery
The data that should be returned if the query is looped is
1, 1, 1, 1, 2, 4, 6
However, when I run.
cfloop query=get_days
Considering that your doing a select distinct, the correct output
should be 1, 2, 4, 6 and not 1, 1, 1, 1, 2, 4, 6 as you first stated.
So it looks like you're getting the very first value 4 times. Try to
scope the output and see if that helps:
cfloop query=get_days
Follow-up:
When I run the same query below in a query editor,
the correct data, 1, 2, 4, 6 is returned.
What wouldn't CF 8 return the same data with the same query?
Rick
-Original Message-
From: Rick Faircloth [mailto:[EMAIL PROTECTED]
Sent: Sunday, October 14, 2007 1:40 AM
To:
cfloop query=get_days
cfoutput#event_days#/cfoutput
/cfloop
This is an old CF bug:
Inside a loop, a column name alone always comes from the first record.
You must specify the query name to get the current row:
cfloop query=get_days
cfoutput#get_days.event_days#/cfoutput
/cfloop
--
I'd do the latter and still prefix the column with the query name. But not
for any reason other than I just do it that way all the time after becoming
a scoping nazi due to a horrible project I overtook many years ago.
On 10/14/07, Maximilian Nyman [EMAIL PROTECTED] wrote:
Considering that
On 10/14/07, Rick Faircloth [EMAIL PROTECTED] wrote:
@ All...
This is just nuts...
I can run this sql in an editor and get the correct results:
select distinct event_day from weekly_schedule order by event_day
And the correct results are 1, 2, 4, 6.
But if I run that same sql in a CF8
What does it show when you run a cfdump on the query? cfdump
var=#get_days# /
On 10/14/07, Rick Faircloth [EMAIL PROTECTED] wrote:
@ All...
This is just nuts...
I can run this sql in an editor and get the correct results:
select distinct event_day from weekly_schedule order by event_day
@ All...
This is just nuts...
I can run this sql in an editor and get the correct results:
select distinct event_day from weekly_schedule order by event_day
And the correct results are 1, 2, 4, 6.
But if I run that same sql in a CF8 cfquery, scoping or not scoping
every variable, all I get is
Also if that shows the query itself is in fact pulling out the correct data
then have you tried doing a cfoutput with the query attribute and
eliminating the cfloop with the cfoutput within that? Something like:
cfoutput query=Get_Days#get_days.event_day#br //cfoutput
On 10/14/07, Aaron Rouse
cfdump is returning the same wrong results... so strange.
-Original Message-
From: Charlie Griefer [mailto:[EMAIL PROTECTED]
Sent: Sunday, October 14, 2007 8:48 PM
To: CF-Talk
Subject: Re: Why would this query not return the correct data?
On 10/14/07, Rick Faircloth [EMAIL
is this
select distinct event_day from weekly_schedule order by event_day
your actual sql statement, or just a 'simplified' version for the
mailing list?
Rick Faircloth wrote:
@ All...
This is just nuts...
I can run this sql in an editor and get the correct results:
select distinct
22 matches
Mail list logo