Oh, sweet! That is a better way to do it. I guess as long as
servicefactory doesn't go away, this should work with furture versions.
I'd hate to see Adobe drop that, because I know a lot of people use it.
-Original Message-
From: Denny Valliant [mailto:[EMAIL PROTECTED]
Sent:
is there query.recordcount with non-SELECT queries?
Oh, sweet! That is a better way to do it. I guess as long as
servicefactory doesn't go away, this should work with furture versions.
I'd hate to see Adobe drop that, because I know a lot of people use it.
-Original Message-
From: Denny
Oh, you can't access the servicefactory from a shared host? I guess
that makes sense, there's a lot of stuff in there that would affect all
customers on the box.
-Original Message-
From: Russ Michaels [mailto:[EMAIL PROTECTED]
Sent: Monday, April 24, 2006 3:53 PM
handy yes, its
Jacob,
I am glad that you found it useful and managed to translate it for SQL
server as well. I also saw you blog post about this technique.
Thanks
Qasim
On 4/20/06, Munson, Jacob [EMAIL PROTECTED] wrote:
I got this working for MS SQL, here's the code:
cfscript
//connection url
connURL
It might b e worth noting that you can use undocumented don't use these
and expect them to work over time type functions to use an existing
datasource, so you don't need to save your db user pass hardly.
Something like:
daFactory = CreateObject (Java,
Well I have been using JDBC Statement call from CF and it will return you
number of records effected for updated, inserts or deletes.
Really? Then CF has no excuse anymore.
--
___
REUSE CODE! Use custom tags;
See
How do you do that?
-Original Message-
From: Qasim Rasheed [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 19, 2006 6:40 PM
Well I have been using JDBC Statement call from CF and it
will return you
number of records effected for updated, inserts or deletes.
-
Jacob,
Here is an example implementation for Oracle. You can definitely modify it
for any other database.
cfscript
//connection url
connURL = jdbc:macromedia:oracle://..;
jclass = createobject('java','java.lang.Class');
jclass.forName('macromedia.jdbc.oracle.OracleDriver');
On 4/18/06, Mike Klostermeyer [EMAIL PROTECTED] wrote:
I wouldn't say that. Sometimes it is helpful to know how many records were
updated or deleted without having to do a select query beforehand. Is there
a Java service factory way of getting at this information?
CF7 has a result attribute
Sam,
AFAIK the result attribute doesn't return records affected from
insert/delete/updates. Please correct me if I am wrong.
Thanks
Qasim
On 4/20/06, Sam Farmer [EMAIL PROTECTED] wrote:
On 4/18/06, Mike Klostermeyer [EMAIL PROTECTED] wrote:
I wouldn't say that. Sometimes it is helpful to
AFAIK the result attribute doesn't return records affected from
insert/delete/updates. Please correct me if I am wrong.
You are right, I just tried it and it says recordcount: 0, and the
only other data returned is cached, executiontime, and sql code.
---
This transmission may
I got this working for MS SQL, here's the code:
cfscript
//connection url
connURL = jdbc:macromedia:sqlserver://server:1433;
jclass = createobject('java','java.lang.Class');
jclass.forName('macromedia.jdbc.sqlserver.SQLServerDriver');
driverManager = CreateObject('java',
You log ingo to 'search' and type in search by name the letters naf and
you should be able to find him
Customer service
-Original Message-
From: Pete Ruckelshaus [mailto:[EMAIL PROTECTED]
Sent: 18 April 2006 16:16
To: CF-Talk
Subject: Why is there query.recordcount with non-SELECT
-Original Message-
From: Nashir Sunderji [EMAIL PROTECTED]
To: CF-Talk cf-talk@houseoffusion.com
Date: Wed, 19 Apr 2006 08:25:58 +0100
Subject: RE: Why is there query.recordcount with non-SELECT queries?
You log ingo to 'search' and type in search by name the letters
naf and
you should
it
and see if its there.
Russ
-Original Message-
From: Nashir Sunderji [EMAIL PROTECTED]
To: CF-Talk cf-talk@houseoffusion.com
Date: Wed, 19 Apr 2006 08:25:58 +0100
Subject: RE: Why is there query.recordcount with non-SELECT queries?
You log ingo to 'search' and type
Russ Michaels wrote:
No, only selects return a recordcount.
Although SQL does return a message about how many records are updated
Maybe some implementations update the diagnostic area with that
information, but returning a count of the number of records
affected is not part of the SQL
On 4/19/06, Jochem van Dieten [EMAIL PROTECTED] wrote:
Russ Michaels wrote:
No, only selects return a recordcount.
Although SQL does return a message about how many records are updated
Maybe some implementations update the diagnostic area with that
information, but returning a count of
Dave Carabetta wrote:
On 4/19/06, Jochem van Dieten [EMAIL PROTECTED] wrote:
Maybe some implementations update the diagnostic area with that
information, but returning a count of the number of records
affected is not part of the SQL specification. More importantly,
it is only part of JDBC 3
:[EMAIL PROTECTED]
Sent: Wednesday, April 19, 2006 1:51 PM
To: CF-Talk
Subject: Re: Why is there query.recordcount with non-SELECT queries?
On 4/19/06, Jochem van Dieten [EMAIL PROTECTED] wrote:
Russ Michaels wrote:
No, only selects return a recordcount.
Although SQL does return a message
is there query.recordcount with non-SELECT queries?
On 4/19/06, Jochem van Dieten [EMAIL PROTECTED] wrote:
Russ Michaels wrote:
No, only selects return a recordcount.
Although SQL does return a message about how many records are
updated
Maybe some implementations update
are ya'll just debating usefullness? Or is the return of the recordcount
actually creating a problem somewhere?
I think the first two messages in the thread are quite clear:
1. It would be useful that a query returns the number of updated record
in an UPDATE in query.recordCount
2. The qurery
That was my concensus early on. Seems like it would be a hard sell to
argue against either of those statements.
--
Rob Wilkerson
~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238174
Archives:
:[EMAIL PROTECTED]
Sent: Wednesday, April 19, 2006 2:13 PM
To: CF-Talk
Subject: Re: Why is there query.recordcount with non-SELECT queries?
are ya'll just debating usefullness? Or is the return of the recordcount
actually creating a problem somewhere?
I think the first two messages in the thread
it might be worth looking at whats returned in the
metadata (getMetaData) and the query result structure
I did some testing, and CF doesn't appear to treat update queries the
same as select queries. Neither cfdump nor getMetaData work with an
update query, in fact CF doesn't even recognize the
CF shouldn't return a RecordCount on non-selecting queries.
Well, the best would be it returns a sensible value. If it cannot,
better return nothing, AND document it.
--
___
REUSE CODE! Use custom tags;
See
CF doesn't appear to treat update queries the
same as select queries
I think a good reason is that a SELECT SQL query returns a dataset, an
INSERT, UPDATE or DELETE
does not.
What we call a QUERY in CF is actually a dataset, the SELECT, UPDATE or
other is not a query,
it is an SQL statement.
I suppose one solutions, while it is a bit more work would be to have
osmething like:
cfquery ...
DECLARE @record_count INT;
SET @record_count = ISNULL(
(
SELECT COUNT(*) AS record_count FROM [TABLE] WHERE where clauses
),
0
);
!--- Now run update ---
UPDATE. WHERE..
This would work, as long as you're using MS SQL.
-Original Message-
From: Ben Nadel [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 19, 2006 1:26 PM
I suppose one solutions, while it is a bit more work would be to have
osmething like:
cfquery ...
DECLARE @record_count INT;
Not sure on which kind of database it will work.
All I know is that it wont work with Access database.
Another way to get the same result would be to store a date time value
in the same query
as the INSERT or UPDATE, then count them in another query.
If the field is indexed, it should take a
Well I have been using JDBC Statement call from CF and it will return you
number of records effected for updated, inserts or deletes.
Thanks
Qasim
On 4/19/06, Claude Schneegans [EMAIL PROTECTED] wrote:
Not sure on which kind of database it will work.
All I know is that it wont work with
Should queries that do an update return a queryname.recordcount
variable? I'm trying to determine how many records get changed during
an update statement.
Pete
~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238007
As I recall, the value gets returned, but always says 0. It's not
useful for anything other than select queries.
On 4/18/06, Pete Ruckelshaus [EMAIL PROTECTED] wrote:
Should queries that do an update return a queryname.recordcount
variable? I'm trying to determine how many records get changed
: Tuesday, April 18, 2006 10:22 AM
To: CF-Talk
Subject: Re: Why is there query.recordcount with non-SELECT queries?
As I recall, the value gets returned, but always says 0. It's not
useful for anything other than select queries.
On 4/18/06, Pete Ruckelshaus [EMAIL PROTECTED] wrote:
Should queries
having to do a select query beforehand. Is there
a Java service factory way of getting at this information?
Mike
-Original Message-
From: Rob Wilkerson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 18, 2006 10:22 AM
To: CF-Talk
Subject: Re: Why is there query.recordcount with non
speed.
-Original Message-
From: Rob Wilkerson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 18, 2006 11:32 AM
To: CF-Talk
Subject: Re: Why is there query.recordcount with non-SELECT queries?
Sorry, I should have been more clear. I meant that the return value
(queryname.recordCount
is there query.recordcount with non-SELECT queries?
As I recall, the value gets returned, but always says 0. It's not
useful for anything other than select queries.
On 4/18/06, Pete Ruckelshaus [EMAIL PROTECTED] wrote:
Should queries that do an update return a queryname.recordcount
with non-SELECT queries?
Note on the minor comment: not all db's will allow this.
On 4/18/06, Ben Nadel [EMAIL PROTECTED] wrote:
Minor comment, but I often will run an Update and a select in the same
CFQuery statement... This will return rows/recordcount (potentially).
ColdFusion doesn't know
37 matches
Mail list logo