Is there a better way to do this import

2012-12-12 Thread Edward Chanter

I'm in the process of rebuilding one of our sites and part of that means
rationalising data and correcting mistakes that were made in the original
build. I've got a chunk of data that needs to be extracted and transformed,
then inserted into a new table in a new database. I'm currently using CF to
do the heavy lifting and so my first question is whether CF is best for
this or if I should try to do this with SQL queries. If the answer is 2 can
anyone point me in the right direction as to how I would go about doing
this in native SQL? Or is there a more efficient way to do this in CF?

Here's what the code currently looks like. Bear in mind that the citem
table contains over 90k rows so we're talking about a lot of data here.

!--- gets the old data the modX fields need merging into a new dbase
schema ---
cfquery datasource=#oldDSN# name=gtd
select id, mod, mod2, mod3, mod4
from citem
where active = 1
/cfquery
!--- Start looping through items ---
cfoutput query=gtd
!--- Get the new item ID from the new database ---
cfquery datasource=#newDSN# name=getNewItemID
select id from items where oldid = '#gtd.id#'
/cfquery

!-- Merge the mod fields into a list ---
cfset topicList = ''
cfset topicList = listappend(#topicList#,'#gtd.mod#')
cfset topicList = listappend(#topicList#,'#gtd.mod2#')
cfset topicList = listappend(#topicList#,'#gtd.mod3#')
cfset topicList = listappend(#topicList#,'#gtd.mod4#')
!--- Loop through the list ---
cfloop list=#topicList# index=t

!--- Assuming there's a value in the field do the insert into the new
database ---
cfif trim(t) NEQ '' and trim(t) NEQ '0'
!-- Get the value for the new topicid field ---
cfquery datasource=#newDSN# name=getNewTopicID
select id from topics where oldid = '#t#'
/cfquery
!--- Insert the data into the new topiclinks table that will link topic
IDs and item IDs ---
cfquery datasource=#newDSN#
insert into topiclinks
(topicid,itemid)
values
('#getNewTopicID.id#','#getNewItemID.id#')
/cfquery
!--- Increment a counter so I know how many rows were created ---
cfset numTopics = numTopics + 1
 /cfif
 /cfloop
 /cfoutput


~|
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:353439
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Is there a better way to do this import

2012-12-12 Thread Cameron Childress

On Wed, Dec 12, 2012 at 11:16 AM, Edward Chanter firew...@cc.uk.com wrote:

 my first question is whether CF is best for
 this or if I should try to do this with SQL queries. If the answer is 2 can
 anyone point me in the right direction as to how I would go about doing
 this in native SQL? Or is there a more efficient way to do this in CF?


Making all the data do a round trip to CF and then back to the Database is
always going to be slightly slower. Doing this 90K times in a row may
magnify this effect. If it's slow in CF, then yes, write it in SQL. Only
you can answer this question. If it's a one time migration though, who
cares if it's slow as long as it happens.

Explaining how to write the SQL to do this is beyond the scope of a simple
email, but I would start by taking a look into the syntax for SELECT
INTO, which will allow you to select data from one table directly into
another. If you need to massage the data first, then it will get more
complicated.

-Cameron

-- 
Cameron Childress
--
p:   678.637.5072
im: cameroncf
facebook http://www.facebook.com/cameroncf |
twitterhttp://twitter.com/cameronc |
google+ https://profiles.google.com/u/0/117829379451708140985




~|
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:353440
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Is there a better way to do this import

2012-12-12 Thread Edward Chanter

Thanks for the tip Cameron,  I will definitely research SELECT INTO as
suggested, all I was hoping for was a pointer like that. I have a lot of
tables to transfer but not all require any massaging of the data so I might
be able to use CF for some and SQL for the others.

Cheers :)


On 12 December 2012 16:23, Cameron Childress camer...@gmail.com wrote:


 On Wed, Dec 12, 2012 at 11:16 AM, Edward Chanter firew...@cc.uk.com
 wrote:

  my first question is whether CF is best for
  this or if I should try to do this with SQL queries. If the answer is 2
 can
  anyone point me in the right direction as to how I would go about doing
  this in native SQL? Or is there a more efficient way to do this in CF?
 

 Making all the data do a round trip to CF and then back to the Database is
 always going to be slightly slower. Doing this 90K times in a row may
 magnify this effect. If it's slow in CF, then yes, write it in SQL. Only
 you can answer this question. If it's a one time migration though, who
 cares if it's slow as long as it happens.

 Explaining how to write the SQL to do this is beyond the scope of a simple
 email, but I would start by taking a look into the syntax for SELECT
 INTO, which will allow you to select data from one table directly into
 another. If you need to massage the data first, then it will get more
 complicated.

 -Cameron

 --
 Cameron Childress
 --
 p:   678.637.5072
 im: cameroncf
 facebook http://www.facebook.com/cameroncf |
 twitterhttp://twitter.com/cameronc |
 google+ https://profiles.google.com/u/0/117829379451708140985

 


 

~|
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:353441
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Is there a better way to do this import

2012-12-12 Thread Russ Michaels

you may also want to read up on stored procedures,custom functions cursors,
and bulk inserts which would help in converting cfml to TSQL


On Wed, Dec 12, 2012 at 4:28 PM, Edward Chanter firew...@cc.uk.com wrote:


 Thanks for the tip Cameron,  I will definitely research SELECT INTO as
 suggested, all I was hoping for was a pointer like that. I have a lot of
 tables to transfer but not all require any massaging of the data so I might
 be able to use CF for some and SQL for the others.

 Cheers :)


 On 12 December 2012 16:23, Cameron Childress camer...@gmail.com wrote:

 
  On Wed, Dec 12, 2012 at 11:16 AM, Edward Chanter firew...@cc.uk.com
  wrote:
 
   my first question is whether CF is best for
   this or if I should try to do this with SQL queries. If the answer is 2
  can
   anyone point me in the right direction as to how I would go about doing
   this in native SQL? Or is there a more efficient way to do this in CF?
  
 
  Making all the data do a round trip to CF and then back to the Database
 is
  always going to be slightly slower. Doing this 90K times in a row may
  magnify this effect. If it's slow in CF, then yes, write it in SQL. Only
  you can answer this question. If it's a one time migration though, who
  cares if it's slow as long as it happens.
 
  Explaining how to write the SQL to do this is beyond the scope of a
 simple
  email, but I would start by taking a look into the syntax for SELECT
  INTO, which will allow you to select data from one table directly into
  another. If you need to massage the data first, then it will get more
  complicated.
 
  -Cameron
 
  --
  Cameron Childress
  --
  p:   678.637.5072
  im: cameroncf
  facebook http://www.facebook.com/cameroncf |
  twitterhttp://twitter.com/cameronc |
  google+ https://profiles.google.com/u/0/117829379451708140985
 
  
 
 
 

 

~|
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:353442
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Is there a better way to do this import

2012-12-12 Thread Cameron Childress

No problem. These sorts of data migrations are always a pain, and somewhat
unrewarding tasks...

-Cameron

On Wed, Dec 12, 2012 at 11:28 AM, Edward Chanter firew...@cc.uk.com wrote:

 Thanks for the tip Cameron,  I will definitely research SELECT INTO as
 suggested, all I was hoping for was a pointer like that. I have a lot of
 tables to transfer but not all require any massaging of the data so I might
 be able to use CF for some and SQL for the others.


~|
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:353443
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Is there a better way to do this import

2012-12-12 Thread Edward Chanter

Thanks Russ, stored procedures I know something about the others I've never
had to use before but will check them out.


On 12 December 2012 16:36, Russ Michaels r...@michaels.me.uk wrote:


 you may also want to read up on stored procedures,custom functions cursors,
 and bulk inserts which would help in converting cfml to TSQL




~|
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:353444
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Is there a way to do an arbitrary sort order on a specific cell?

2010-05-15 Thread Andrew Scott

Have you thought about building it up as an associate array first then sort
based on the struct key?

Then convert it to a query later?



-Original Message-
From: Les Mizzell [mailto:lesm...@bellsouth.net] 
Sent: Saturday, 15 May 2010 8:43 AM
To: cf-talk
Subject: Re: Is there a way to do an arbitrary sort order on a specific
cell?


Charlie Griefer wrote:
 case statement in the ORDER BY should work.
 
 See http://www.devx.com/tips/Tip/17288

Checking my syntax, but doesn't seem to work for a query of queries..

Like:

cfloop query=featureMENU
  cfset temp = QueryAddRow(hasMEDIA)
  cfset temp = QuerySetCell(hasMEDIA, tHEAD, #req.tHEAD#, #tCOUNT#)
  cfset temp = QuerySetCell(hasMEDIA, sid, #sid#, #tCOUNT#)
/cfloop


cfquery dbtype=query name=getAllMedia
SELECT
tHEAD,
sid
FROM hasMEDIA
ORDER by ( Case thisHEAD
WHEN 'Feature Article' THEN 1
WHEN 'Quoatable' THEN 2
WHEN 'On the Money' THEN 3
WHEN 'In the News' THEN 4
WHEN 'Innovation' THEN 5
WHEN 'About Us' THEN 6
WHEN 'Border Bound' THEN 7
WHEN 'Quick Facts' THEN 8
ELSE 100 END )
/cfquery

ERROR: Query Of Queries syntax error.
Encountered (. Incorrect ORDER BY column reference [(].
Only simple column reference, alias name, and integer column id are 
allowed.


__ Information from ESET NOD32 Antivirus, version of virus signature
database 5115 (20100514) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com





~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333722
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Is there a way to do an arbitrary sort order on a specific cell?

2010-05-14 Thread Les Mizzell

Is there a way to do an arbitrary sort order on a specific cell?

For example, let's say I have a cell colour.
Possible values:
1. blue
2. cyan
3. green
4. orange
5. red
6. silver

I want to sort on this cell, BUT, I want the order to show all

red first
blue second
green third
  ... blah ...


__ Information from ESET NOD32 Antivirus, version of virus signature 
database 5115 (20100514) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333700
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Is there a way to do an arbitrary sort order on a specific cell?

2010-05-14 Thread Charlie Griefer

case statement in the ORDER BY should work.

See http://www.devx.com/tips/Tip/17288

On Fri, May 14, 2010 at 9:24 AM, Les Mizzell lesm...@bellsouth.net wrote:


 Is there a way to do an arbitrary sort order on a specific cell?

 For example, let's say I have a cell colour.
 Possible values:
 1. blue
 2. cyan
 3. green
 4. orange
 5. red
 6. silver

 I want to sort on this cell, BUT, I want the order to show all

 red first
 blue second
 green third
  ... blah ...


 __ Information from ESET NOD32 Antivirus, version of virus
 signature database 5115 (20100514) __

 The message was checked by ESET NOD32 Antivirus.

 http://www.eset.com



 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333702
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Is there a way to do an arbitrary sort order on a specific cell?

2010-05-14 Thread Leigh

 Is there a way to do an arbitrary sort order on a specific
 cell?

What do you mean by cell? A query, grid, etcetera ...?  In general terms, you 
could assign a sort number to each color (red=1, blue=2, ecetera). Then sort 
by that value.



  


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333703
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Is there a way to do an arbitrary sort order on a specific cell?

2010-05-14 Thread Les Mizzell

Charlie Griefer wrote:
 case statement in the ORDER BY should work.
 
 See http://www.devx.com/tips/Tip/17288

Checking my syntax, but doesn't seem to work for a query of queries..

Like:

cfloop query=featureMENU
  cfset temp = QueryAddRow(hasMEDIA)
  cfset temp = QuerySetCell(hasMEDIA, tHEAD, #req.tHEAD#, #tCOUNT#)
  cfset temp = QuerySetCell(hasMEDIA, sid, #sid#, #tCOUNT#)
/cfloop


cfquery dbtype=query name=getAllMedia
SELECT
tHEAD,
sid
FROM hasMEDIA
ORDER by ( Case thisHEAD
WHEN 'Feature Article' THEN 1
WHEN 'Quoatable' THEN 2
WHEN 'On the Money' THEN 3
WHEN 'In the News' THEN 4
WHEN 'Innovation' THEN 5
WHEN 'About Us' THEN 6
WHEN 'Border Bound' THEN 7
WHEN 'Quick Facts' THEN 8
ELSE 100 END )
/cfquery

ERROR: Query Of Queries syntax error.
Encountered (. Incorrect ORDER BY column reference [(].
Only simple column reference, alias name, and integer column id are 
allowed.


__ Information from ESET NOD32 Antivirus, version of virus signature 
database 5115 (20100514) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333713
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Is there a way to do an arbitrary sort order on a specific cell?

2010-05-14 Thread Leigh

 Checking my syntax, but doesn't seem to work for a query of
 queries..

QoQ's are very limited. They do not support CASE statements, AFAIK. 

If you are using a database query as the source of this information, add a CASE 
statement to your base database query to generate a column called SortNumber. 
Then use that column for ordering.  Alternatively, you could add a SortNumber 
column to your base table.



  


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333715
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Is there a way to do an arbitrary sort order on a specific cell?

2010-05-14 Thread Les Mizzell

 If you are using a database query as the source of this information, add a 
 CASE statement to your base database query to generate a column called 
 SortNumber. Then use that column for ordering.  Alternatively, you could 
 add a SortNumber column to your base table.


I wish it were that easy. The information is coming from a number of 
different sources - RSS feeds, a database or two - and being 
consolidated down into a single source

In theory, I could add a new database table to the site in question, and 
populate it every X number of hours on a schedule, but that's not 
exactly how this is set up to function. It's something I'm looking into 
though.

Thanks!


__ Information from ESET NOD32 Antivirus, version of virus signature 
database 5115 (20100514) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333716
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Is there a way to do an arbitrary sort order on a specific cell?

2010-05-14 Thread Leigh

 In theory, I could add a new database table to the site in
 question, and populate it every X number of hours on a schedule, but
 that's not  exactly how this is set up to function. 

Well .. either way, you will have to change to something if the CASE values are 
not static. Be it a table, or a SQL query. However, if your base query is _not_ 
a database query, then you do not have many options, AFAIK. You are limited by 
the capabilities of QoQ's. It is either, add a sortNumber column and populate 
it row-by-row, or use a hack to simulate an OUTER join in QoQ's (tres ugly).




  


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333717
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Is there a way to do an arbitrary sort order on a specific cell?

2010-05-14 Thread Leigh

 Well .. either way, you will have to change to something if
 the CASE values are not static. Be it a table, or a SQL
 query. 

... or your CF code.


  


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333718
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Is there a way to do this?

2008-07-07 Thread Rick Faircloth
Hi, all...

I'm using a dynamically populated select (multiple)
allowing users to select one or more cities for which
they'd like to view properties.

When the form which contains the form is submitted, it
submits back to the same page it's on.

What I'd like to have happen in the select is for the
first selection to appear at the top of the select choices.

e.g.

First Population of Select:

- any city
- Athens
- Atlanta
- Albany
- Augusta
- etc.

User chooses Albany.

Select reappears:

- Albany
- Augusta
- etc.

Any way to control this with CF or otherwise?

Thanks,

Rick




~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308675
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Is there a way to do this?

2008-07-07 Thread Charlie Griefer
something like:

select name=city
 option value=#cityID#cfif form.city is cityID
selected=selected/cfif#city#/option
/select

you'll probably have to throw a cfparam name=form.city default=
/ out there for the initial form display.

getting the 2nd select to display the appropriate cities will be a
bit more work, and the answer will depend on how you're currently
doing it.  If it's javascript, you'll need to invoke the javascript
function manually.  something like:

cfif structKeyExists(form, 'city')
 cfoutputscript
type=text/javascriptpopulateAreas('#form.city#');/script/cfoutput
/cfif

But the short answer is... yes.  there is a way to do this :)

On Mon, Jul 7, 2008 at 11:24 AM, Rick Faircloth
[EMAIL PROTECTED] wrote:
 Hi, all...

 I'm using a dynamically populated select (multiple)
 allowing users to select one or more cities for which
 they'd like to view properties.

 When the form which contains the form is submitted, it
 submits back to the same page it's on.

 What I'd like to have happen in the select is for the
 first selection to appear at the top of the select choices.

 e.g.

 First Population of Select:

 - any city
 - Athens
 - Atlanta
 - Albany
 - Augusta
 - etc.

 User chooses Albany.

 Select reappears:

 - Albany
 - Augusta
 - etc.

 Any way to control this with CF or otherwise?

 Thanks,

 Rick




 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308676
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Is there a way to do this?

2008-07-07 Thread Brian Kotek
This can be done using JavaScript. You can Google for form manipulation code
or check out something like jQuery which would make resorting or modifying
the select box quite simple and wouldn't require a request to the server.

On Mon, Jul 7, 2008 at 2:24 PM, Rick Faircloth [EMAIL PROTECTED]
wrote:

 Hi, all...

 I'm using a dynamically populated select (multiple)
 allowing users to select one or more cities for which
 they'd like to view properties.

 When the form which contains the form is submitted, it
 submits back to the same page it's on.

 What I'd like to have happen in the select is for the
 first selection to appear at the top of the select choices.

 e.g.

 First Population of Select:

 - any city
 - Athens
 - Atlanta
 - Albany
 - Augusta
 - etc.

 User chooses Albany.

 Select reappears:

 - Albany
 - Augusta
 - etc.

 Any way to control this with CF or otherwise?

 Thanks,

 Rick




 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308677
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Is there a way to do this?

2008-07-07 Thread Rick Faircloth
Thanks for the replies, Charlie and Brian...

Actually, I should have been more clear.

I've got this code working, which re-selects all of the
selected citis:

cfoutput query=get_cities
cfif (isDefined(form.fieldnames) and isDefined(session.city) and 
session.city contains
#city#) or session.city is #city#
option value=#city# selected#city# - #num_cities#/option
cfelse
option value=#city##city# - #num_cities#/option
/cfif
/cfoutput

What I need now is to get the first selected item to display
at the top of the list.

Will that require javascript?  jQuery, perhaps?

Rick




 -Original Message-
 From: Charlie Griefer [mailto:[EMAIL PROTECTED]
 Sent: Monday, July 07, 2008 2:33 PM
 To: CF-Talk
 Subject: Re: Is there a way to do this?
 
 something like:
 
 select name=city
  option value=#cityID#cfif form.city is cityID
 selected=selected/cfif#city#/option
 /select
 



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308679
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Is there a way to do this?

2008-07-07 Thread Ian Skinner
Rick Faircloth wrote:
 Thanks for the replies, Charlie and Brian...

 Actually, I should have been more clear.

 I've got this code working, which re-selects all of the
 selected citis:

 cfoutput query=get_cities
   cfif (isDefined(form.fieldnames) and isDefined(session.city) and 
 session.city contains
 #city#) or session.city is #city#
   option value=#city# selected#city# - #num_cities#/option
   cfelse
   option value=#city##city# - #num_cities#/option
   /cfif
 /cfoutput

 What I need now is to get the first selected item to display
 at the top of the list.

 Will that require javascript?  jQuery, perhaps?

 Rick
You could, but if you are building the select in CF as above, just do 
something to sort the query into the desired order with the selected 
city first.  How this could be done depends on how the data is 
organized, but it is 'doable'.




~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308680
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Is there a way to do this?

2008-07-07 Thread Greg Morphis
You could do something like (not tested)
select distinct city, orderby from (
select city, 2 as orderby
from table
where city  foo_city
union
select city, 1 as orderby
from table
where city = foo_city
) order by orderby, city

that would tack the prior cities onto the end

On Mon, Jul 7, 2008 at 2:19 PM, Ian Skinner [EMAIL PROTECTED] wrote:
 Rick Faircloth wrote:
 Thanks for the replies, Charlie and Brian...

 Actually, I should have been more clear.

 I've got this code working, which re-selects all of the
 selected citis:

 cfoutput query=get_cities
   cfif (isDefined(form.fieldnames) and isDefined(session.city) and 
 session.city contains
 #city#) or session.city is #city#
   option value=#city# selected#city# - #num_cities#/option
   cfelse
   option value=#city##city# - #num_cities#/option
   /cfif
 /cfoutput

 What I need now is to get the first selected item to display
 at the top of the list.

 Will that require javascript?  jQuery, perhaps?

 Rick
 You could, but if you are building the select in CF as above, just do
 something to sort the query into the desired order with the selected
 city first.  How this could be done depends on how the data is
 organized, but it is 'doable'.




 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308683
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Is there a way to do this?

2008-07-07 Thread Rick Faircloth
Well... the cities that populate the multiple select
are returned by a query that provides each distinct city name.

So the cities are not in the db, and all I have to work with
is the name of the city, itself.

I could pull the selected cities out of the order and place
them on top of the list, but I'd rather not do that, because
it might confuse the user.

I want the cities to stay in the same order as the query delivers them,
but with the first selected city on the top.

It would be nice if there were some attribute of the select option, like
option value=#city# selected top#city#/option so I could have that
option with top as an attribute scroll (not animate) to that point
in the list as the first selection.

I may have to use some jQuery and assign an id to each option dynamically,
then have jQuery find the first selected option and somehow make the
list scroll to that point.

Thoughts?

Rick

 -Original Message-
 From: Ian Skinner [mailto:[EMAIL PROTECTED]
 Sent: Monday, July 07, 2008 3:19 PM
 To: CF-Talk
 Subject: Re: Is there a way to do this?
 
 Rick Faircloth wrote:
  Thanks for the replies, Charlie and Brian...
 
  Actually, I should have been more clear.
 
  I've got this code working, which re-selects all of the
  selected citis:
 
  cfoutput query=get_cities
  cfif (isDefined(form.fieldnames) and isDefined(session.city) and 
  session.city contains
  #city#) or session.city is #city#
  option value=#city# selected#city# - #num_cities#/option
  cfelse
  option value=#city##city# - #num_cities#/option
  /cfif
  /cfoutput
 
  What I need now is to get the first selected item to display
  at the top of the list.
 
  Will that require javascript?  jQuery, perhaps?
 
  Rick
 You could, but if you are building the select in CF as above, just do
 something to sort the query into the desired order with the selected
 city first.  How this could be done depends on how the data is
 organized, but it is 'doable'.
 
 
 
 
 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308687
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Is there a way to do this?

2008-07-07 Thread Rick Faircloth
Whoa, that's a dandy little query!

I see you've got from table... the cities are
pulled from a properties table via
select distinct city from properties

I guess I could use a QoQ in place of the table
as the datasource.

However, you mentioned that your query would
tack the prior cities onto the end and I would
prefer to keep the selected cities in the order
they are naturally and reduce the chance of confusing
the user.

It may be that the only way I can do this without jQuery
would be to run a query that returns the names of the
cities selected and then place them on top.  Then run
another query to get all the cities in order.  (Which
seems to be what your single query does, too, Greg).
Usually, I put the selected item in a single select
on top and then list the rest, including the selected
item again after that.

Guess that would work ok.


 -Original Message-
 From: Greg Morphis [mailto:[EMAIL PROTECTED]
 Sent: Monday, July 07, 2008 3:35 PM
 To: CF-Talk
 Subject: Re: Is there a way to do this?
 
 You could do something like (not tested)
 select distinct city, orderby from (
 select city, 2 as orderby
 from table
 where city  foo_city
 union
 select city, 1 as orderby
 from table
 where city = foo_city
 ) order by orderby, city
 
 that would tack the prior cities onto the end
 



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308698
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Is there a way to do this?

2008-07-07 Thread Ian Skinner
Rick Faircloth wrote:
 I want the cities to stay in the same order as the query delivers them,
 but with the first selected city on the top.

 It would be nice if there were some attribute of the select option, like
 option value=#city# selected top#city#/option so I could have that
 option with top as an attribute scroll (not animate) to that point
 in the list as the first selection.

This is the behavior of any HTML Select control I have ever created with 
an element defined as 'selected'.  As long as there where enough options 
below the selected element to fill the area of the select control.

This not how it works for you?

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308699
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Is there a way to do this?

2008-07-07 Thread Greg Morphis
You could
cfparam name=form.city default=0 /
select distinct city from properties where lower(city) !=
'#lcase(form.city)#' -- USE CFQUERYPARAM :)

then
select name=city multiple=true size=5
option value=0 cfif form.city eq 0selected/cfif -- select a
city --/option
cfoutput query=cities


/cfoutput
/select

This would put the selected city at the top

But then again you could use the union
select city, orderby from (
select city, 1 as orderby
from properties where city = form.city
union
select city 2 as orderby
from properties where city != form.city
) order by orderby, city

That would place your city at top



On Mon, Jul 7, 2008 at 3:22 PM, Rick Faircloth [EMAIL PROTECTED] wrote:
 Whoa, that's a dandy little query!

 I see you've got from table... the cities are
 pulled from a properties table via
 select distinct city from properties

 I guess I could use a QoQ in place of the table
 as the datasource.

 However, you mentioned that your query would
 tack the prior cities onto the end and I would
 prefer to keep the selected cities in the order
 they are naturally and reduce the chance of confusing
 the user.

 It may be that the only way I can do this without jQuery
 would be to run a query that returns the names of the
 cities selected and then place them on top.  Then run
 another query to get all the cities in order.  (Which
 seems to be what your single query does, too, Greg).
 Usually, I put the selected item in a single select
 on top and then list the rest, including the selected
 item again after that.

 Guess that would work ok.


 -Original Message-
 From: Greg Morphis [mailto:[EMAIL PROTECTED]
 Sent: Monday, July 07, 2008 3:35 PM
 To: CF-Talk
 Subject: Re: Is there a way to do this?

 You could do something like (not tested)
 select distinct city, orderby from (
 select city, 2 as orderby
 from table
 where city  foo_city
 union
 select city, 1 as orderby
 from table
 where city = foo_city
 ) order by orderby, city

 that would tack the prior cities onto the end




 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308701
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Is there a way to do this?

2008-07-07 Thread Rick Faircloth
Thanks for that code, Greg.

While you were working on that, I came up with this:

select name=city multiple size=9 class=textinput01

cfif isDefined(form.fieldnames) and isDefined(session.city)
cfloop index=city list=#form.city#
option value=cfoutput#city#/cfoutput 
style=background-color:#B0E0E6
selectedcfoutput#city#/cfoutput/option
/cfloop
/cfif

option value=any cityany city/option
cfoutput query=get_cities
option value=#city##city# - #num_cities#/option
/cfoutput

/select

It puts my selected cities on top with the regular gray select background color,
then as other selections are made, the selections on top turn light-blue 
(#B0E0E6),
and the new selections are the regular gray backgrounds.

Seems to work well... I'll have to see how users respond to this, however.

 -Original Message-
 From: Greg Morphis [mailto:[EMAIL PROTECTED]
 Sent: Monday, July 07, 2008 4:34 PM
 To: CF-Talk
 Subject: Re: Is there a way to do this?
 
 You could
 cfparam name=form.city default=0 /
 select distinct city from properties where lower(city) !=
 '#lcase(form.city)#' -- USE CFQUERYPARAM :)
 
 then
 select name=city multiple=true size=5
 option value=0 cfif form.city eq 0selected/cfif -- select a
 city --/option
 cfoutput query=cities
 
 
 /cfoutput
 /select
 
 This would put the selected city at the top
 
 But then again you could use the union
 select city, orderby from (
 select city, 1 as orderby
 from properties where city = form.city
 union
 select city 2 as orderby
 from properties where city != form.city
 ) order by orderby, city
 
 That would place your city at top
 



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308703
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: A question re a better way to do something

2008-02-08 Thread Richard White
if you want a message to pop up with javascript asking yes and no then you can 
either use vbscript or create a custom message box with yes no buttons. there 
is a really cool example at the following url: 

http://javascript.about.com/library/blmodald3.htm

hope this helps



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:298568
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


A question re a better way to do something

2008-02-08 Thread Toby King
I currently have three buttons on a page.  Here is the code for one of the 
buttons:

a href=javascript:; 
onClick=MM_openBrWindow('dsp_updating_session_status_popup.cfm?jobid=#jobid#action=start','BookingStatusPopup','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=650,height=450')img
 src=images/icon_finish.gif border=0 alt=Click here when booking is 
finished to finalise job/a

Basically I'm opening a popup window asking a user if they want to complete a 
booking in a rstaurant table booking system.  Ideally I would just like to be 
able to display a message which says finalise a booking click yes/no etc and 
then if yes was selected the booking status in the database would be set etc.  
If no was selected then nothing happens.

I'm assuming that this would be possible and its probably simple I just cant 
think.

Thanks in advance.



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:298547
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: A question re a better way to do something

2008-02-08 Thread Dave Francis
Would a Javascript confirm() work for you here?

-Original Message-
From: Toby King [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 08, 2008 10:59 AM
To: CF-Talk
Subject: A question re a better way to do something

I currently have three buttons on a page.  Here is the code for one of the
buttons:

a href=javascript:;
onClick=MM_openBrWindow('dsp_updating_session_status_popup.cfm?jobid=#jobid
#action=start','BookingStatusPopup','toolbar=yes,location=yes,status=yes,me
nubar=yes,scrollbars=yes,resizable=yes,width=650,height=450')img
src=images/icon_finish.gif border=0 alt=Click here when booking is
finished to finalise job/a

Basically I'm opening a popup window asking a user if they want to complete
a booking in a rstaurant table booking system.  Ideally I would just like to
be able to display a message which says finalise a booking click yes/no etc
and then if yes was selected the booking status in the database would be set
etc.  If no was selected then nothing happens.

I'm assuming that this would be possible and its probably simple I just cant
think.

Thanks in advance.





~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:298548
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: What's the easiest way to do this?

2007-06-12 Thread James Holmes
Yes, this is a task well suited to AJAX. Perhaps look at AjaxCFC (the
JQuery version) or mxAjax so that you get an integrated CF solution
out of the box.

As I use mxAjax, I'd use the mxData component to run a CFC method that
returns values based on those dropdowns; then I'd write the new data
into the last dropdown (perhaps with the DOM or with innerHTML).

On 6/12/07, Will Tomlinson [EMAIL PROTECTED] wrote:
 I have a form that uses qForms for 7 dynamic select menus.

 There's one other dataset/filter I need to add, but it isn't directly 
 connected with the data in the related menus.

 I can query this data and filter it using the related selects, but I only 
 know how to do it the old fashioned way - hit the server with a submit button 
 and return the data to a newly shown dropdown for courses.

 How could I do this with say, a button, Show course filter. You click the 
 button and it asynchrously runs the course query, using the filters from the 
 related selects.
 Then display it in a another dropdown filter.

 I know this has AJAX written all over it, but could somebody point me in the 
 right direction?

-- 
mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/

~|
Macromedia ColdFusion MX7
Upgrade to MX7  experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280737
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: What's the easiest way to do this?

2007-06-12 Thread Will Tomlinson
As I use mxAjax, I'd use the mxData component to run a CFC method that
returns values based on those dropdowns; then I'd write the new data
into the last dropdown (perhaps with the DOM or with innerHTML).


Thanks james. I'll investigate this. 

Will

~|
Deploy Web Applications Quickly across the enterprise with ColdFusion MX7  
Flex 2
Free Trial 
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280751
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: What's the easiest way to do this?

2007-06-12 Thread Will Tomlinson
James,

Will this work if I have multiple form fields that need to be passed to the 
cfc? 
What's mixing me up is the source attribute. Here's what I'm passing. 3 items, 
from 3 formfields. 

!--- Start ajaxcfc call ---

cfoutput
script type='text/javascript' src='../mxAjax/core/js/prototype.js'/script
script type='text/javascript' src='../mxAjax/core/js/mxAjax.js'/script
script type='text/javascript' src='../mxAjax/core/js/mxSelect.js'/script
/cfoutput

script language=javascript
var url = cfoutput#ajaxUrl#/cfoutput;

function init() {
new mxAjax.Select({
parser: new mxAjax.CFArrayToJSKeyValueParser(),
executeOnLoad: true,
target: course, 
paramArgs: new 
mxAjax.Param(url,{param:eval={eval},T7={Tier7},T6={Tier6}, httpMethod:get, 
cffunction:getCourses}),
source: eval,Tier7,Tier6
});
}
   addOnLoadEvent(function() {init();});
/script

If I change one of the dropdowns, nothing happens. 

Thanks,
Will

~|
Macromedia ColdFusion MX7
Upgrade to MX7  experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280754
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: What's the easiest way to do this?

2007-06-12 Thread James Holmes
Instead of using the mxselect use mxdata - this will let you pass in
each dropdown value as an argument to your CFC and get a return you
can use to build the last dropdown. Check my blog or the mxdata
example for some more details on mxdata. If you have more problems
with it let me know and I'll blog a solution.

On 6/12/07, Will Tomlinson [EMAIL PROTECTED] wrote:
 James,

 Will this work if I have multiple form fields that need to be passed to the 
 cfc?
 What's mixing me up is the source attribute. Here's what I'm passing. 3 
 items, from 3 formfields.

 !--- Start ajaxcfc call ---

 cfoutput
 script type='text/javascript' src='../mxAjax/core/js/prototype.js'/script
 script type='text/javascript' src='../mxAjax/core/js/mxAjax.js'/script
 script type='text/javascript' src='../mxAjax/core/js/mxSelect.js'/script
 /cfoutput

 script language=javascript
 var url = cfoutput#ajaxUrl#/cfoutput;

 function init() {
 new mxAjax.Select({
 parser: new mxAjax.CFArrayToJSKeyValueParser(),
 executeOnLoad: true,
 target: course,
 paramArgs: new 
 mxAjax.Param(url,{param:eval={eval},T7={Tier7},T6={Tier6}, 
 httpMethod:get, cffunction:getCourses}),
 source: eval,Tier7,Tier6
 });
 }
addOnLoadEvent(function() {init();});
 /script

 If I change one of the dropdowns, nothing happens.

 Thanks,
 Will

 

~|
CF 8 – Scorpio beta now available, 
easily build great internet experiences – Try it now on Labs
http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280757
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: What's the easiest way to do this?

2007-06-12 Thread Will Tomlinson
Thanks a ton james! 

Let me ask you something. I've spent quite a bit of time integrating qForms 
into this page to get the organization dropdowns talkin' to one another. 

http://208.106.220.252/soundings/T8Report.cfm

It all works perfectly. Choose test eval 1 in the eval dropdown. 

Then Business Technologies  Information technologies  ITN. 

At that point you can click refresh and I'm just submitting that form to 
populate the course dropdown. 

So depending on what you select in those three dropdowns, the form submits and 
it runs a query of courses with those criterias. 

THAT's the part I'd like to sub out with Ajax. 

So to get to my question, do you think I can integrate CFAjax for this? And it 
won't affect my qForms? I'm hopin' it will, since the target course dropdown 
really isn't involved in the qForm calls. Except the course dropdown IS in the 
qForm object. 

Just wanna make sure I don't waste alot of time on somethin' that may not work 
anyway. 

Thanks much,
Will

~|
Create Web Applications With ColdFusion MX7  Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280781
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: What's the easiest way to do this?

2007-06-12 Thread James Holmes
Yes, that should work fine with mxAjax (or any of the other choices
you have). It can even be triggered in the onChange on the tier5 box,
just like the qforms scripts are triggered on the others.

On 6/12/07, Will Tomlinson [EMAIL PROTECTED] wrote:
 Thanks a ton james!

 Let me ask you something. I've spent quite a bit of time integrating qForms 
 into this page to get the organization dropdowns talkin' to one another.

 http://208.106.220.252/soundings/T8Report.cfm

 It all works perfectly. Choose test eval 1 in the eval dropdown.

 Then Business Technologies  Information technologies  ITN.

 At that point you can click refresh and I'm just submitting that form to 
 populate the course dropdown.

 So depending on what you select in those three dropdowns, the form submits 
 and it runs a query of courses with those criterias.

 THAT's the part I'd like to sub out with Ajax.

 So to get to my question, do you think I can integrate CFAjax for this? And 
 it won't affect my qForms? I'm hopin' it will, since the target course 
 dropdown really isn't involved in the qForm calls. Except the course dropdown 
 IS in the qForm object.

 Just wanna make sure I don't waste alot of time on somethin' that may not 
 work anyway.

-- 
mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/

~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2  MX7 integration  create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280784
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: What's the easiest way to do this?

2007-06-12 Thread Will Tomlinson
Yes, that should work fine with mxAjax (or any of the other choices
you have). It can even be triggered in the onChange on the tier5 box,
just like the qforms scripts are triggered on the others.

oops, I meant mxAjax. I've been lookin' at so many the last day or so I can't 
keep'em straight.  :)

~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280787
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: What's the easiest way to do this?

2007-06-12 Thread Will Tomlinson
Yes, this is a task well suited to AJAX. Perhaps look at AjaxCFC (the
JQuery version) or mxAjax so that you get an integrated CF solution
out of the box.


I'm hijackin' code from yer blog right now. Gonna try and make this work. I'll 
keep ya posted. 

~|
ColdFusion 8 beta – Build next generation applications today.
Free beta download on Labs
http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280790
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: What's the easiest way to do this?

2007-06-12 Thread Will Tomlinson
Ok James, I'm gettin close! I have it runnin the query when the page loads, 
which is of course not what I want. But this tells me things are workin. 

I've modified the example on your blog. Now, I'm REAL slow when it comes to JS, 
so bear with me here. 

Here's my JS call:

script language=javascript
var url = cfoutput#ajaxUrl#/cfoutput;
cfoutput
function init() {
new mxAjax.Data({
executeOnLoad:true,
paramArgs: new 
mxAjax.Param(url,{param:eval=#FORM.eval#,T7=#FORM.Tier7#,T6=#FORM.Tier6#, 
cffunction:getCourses}),
   postFunction: handleData
   });
   
function handleData(response) {
var myHTMLOutput = JSON.parse(response);
document.getElementById(myTargetSpan).innerHTML = 
myHTMLOutput;
}
}
   
addOnLoadEvent(function() {init();});
/cfoutput
/script

I left executeonload to true because This script is wrapped with a cfif 
anyway. It won't fire when the page loads, so I'm good to go there. 

Here's the function I stuck in example.cfc:

cffunction name=getCourses output=true
  cfargument name=eval
  cfargument name=T7
  cfargument name=T6
  cfset var courseArray = ArrayNew(1)
  cfset var getCourses = 
  
  cfquery datasource=#APPLICATION.dsn# name=getCourses
  SELECT 
  SectionID,
  Section, 
  evalid,
  Title,
  StudentID,
  Course
  FROM tblstudentcourses
  !--- Get courses for the evaluation selected  ---
  WHERE evalid =
  cfqueryparam cfsqltype=cf_sql_integer value=#ARGUMENTS.eval#
  !--- Filter courses according to any organizational filters submitted ---
  cfif Len(ARGUMENTS.T7) AND ARGUMENTS.T7 NEQ All
AND orgtier7code =
cfqueryparam value=#ARGUMENTS.T7#
  /cfif
  cfif Len(ARGUMENTS.T6) AND ARGUMENTS.T6 NEQ All
AND orgtier6code =
cfqueryparam value=#ARGUMENTS.T6#
  /cfif
  /cfquery
  
  cfsavecontent variable=showCourseMenu
  select name=course
option value=AllAll/option
  cfoutput query=getCourses
option value=#sectionid##section# - #title#/option
  /cfoutput
  /select  
  /cfsavecontent   
  cfreturn showCourseMenu
/cffunction


Up to this point, things are workin nicely. That menu pops right up when an 
eval is chosen in the top dropdown - This is the coolest thing I've ever done!

Here's my trouble. How do I get it to fire off when any of those organization 
filters are changed? 

I already have an onChange in them for the qForms. Here's an example of Tier 7 
(stripping out the conditional stuff for easier reading:

 select name=Tier7 
onChange=objForm.Tier6.populate(stcTiers[objForm.Tier7.getValue()], null, 
null, stcBlank);
   option value=AllAll/option
 cfoutput query=get7OrgTiers group=orgtier7id
 cfoutput group=orgtier7id
option value=#orgtier7code##orgtier7title#/option
/cfoutput 
/select

How do you fire this thing off? Can it be appended to the onChange?

Thanks a ton james!

Will

~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2  MX7 integration  create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280826
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


What's the easiest way to do this?

2007-06-11 Thread Will Tomlinson
I have a form that uses qForms for 7 dynamic select menus. 

There's one other dataset/filter I need to add, but it isn't directly connected 
with the data in the related menus. 

I can query this data and filter it using the related selects, but I only know 
how to do it the old fashioned way - hit the server with a submit button and 
return the data to a newly shown dropdown for courses. 

How could I do this with say, a button, Show course filter. You click the 
button and it asynchrously runs the course query, using the filters from the 
related selects. 
Then display it in a another dropdown filter. 

I know this has AJAX written all over it, but could somebody point me in the 
right direction?

Thanks,
Will 

~|
ColdFusion MX7 and Flex 2 
Build sales  marketing dashboard RIA’s for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280733
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Is there a better way to do this

2006-12-21 Thread Bruce Sorge
First I would like to thank those of you who replied to my session time out
issue without being condescending. I still am amazed that I actually posted
that question and I feel totally stupid. LOL

Now for my new issue.
I have an edit form that I generate dynamically. There are a total of 10
rows and three columns in this form. What I am doing is, if there is a
record in the table, I pre-fill however many rows that there are records in
the database, and the rest of the rows are blank. I tried using if
statements checking for data in each row, and if there is data show the
pre-filled rows and then spit out the remainder of the rows with blank
fields but everything I tried only produced the rows that had data and
nothing else. Here is what I have.

!--- Set the start of the second loop by finding out how many records there
are, then add one to the number ---
cfset newStartCount = (#listCommitteeMembersRet.RecordCount# + 1)

!--- Loop through the records ---
cfloop from=1 to=#listCommitteeMembersRet.recordCount# index=i
  tr
   cfoutput query=listCommitteeMembersRet maxrows=1 startrow=#i#
input type=hidden name=EC_ID
value=#listCommitteeMembersRet.EC_ID# /
td width=200input type=text name=Name_#i# value=#Name#
//td
td width=125input type=text name=Phone_#i# value=#Phone#
//td
tdinput type=text name=Email_#i# value=#Email# //td
  /cfoutput
  /tr
  /cfloop
!--- Start the next loop showing blank records but keeping the index
incremental. ---
  cfloop from=#newStartCount# to=10 index=i
  tr
  cfoutput
  td width=200input type=text name=Name_#i# //td
td width=125input type=text name=Phone_#i# //td
tdinput type=text name=Email_#i# //td
  /cfoutput
  /tr
   /cfloop
Surely there has to be a more elegant way of doing this?
One thing that I noticed though. in the first loop, if I put to=10, then I
get the X number of rows pre-filled, then I get the remainder of the rows
output but no data like so:


tr
/tr
tr
/tr

And so on until all 10 rows are complete. So I know that it is actually
looping through the rows all 10 times, so there has to be a way to get the
blank records to fill in these rows.

Thanks,
-- 
Bruce Sorge


~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264804
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Is there a better way to do this

2006-12-21 Thread loathe
I think I see what your going for, but would like to have better
requirements.

Try this:

cfset myLen = listCommiteeMembersRet.recordCount

!--- Loop through the records ---
cfoutput query=listCommiteeMembersRet
input type=hidden name=EC_ID
value=#listCommitteeMembersRet.EC_ID# /
tr
td style=width : 200px;
input type=text name=Name_#i# /
/td
td style=width L 125px;
input type=text name=Phone_#i# value=#Phone#
/
/td
td
input type=text name=Email_#i# value=#Email#
/
/td
/tr
/cfoutput

cfif myLen lt 10
cfset loopLen = 10 - myLen
cfloop from=1 to=#loopLen# index=i
tr
cfoutput
td style=width : 200px;
nbsp;
/td
td style=width : 125px;
input type=text name=Phone_#i +
loopLen# /
/td
td
input type=text name=Email_#i +
loopLen# /
/td
/cfoutput
   /tr
/cfloop
/cfif

 -Original Message-
 From: Bruce Sorge [mailto:[EMAIL PROTECTED]
 Sent: Thursday, December 21, 2006 3:33 PM
 To: CF-Talk
 Subject: Is there a better way to do this
 
 First I would like to thank those of you who replied to my session time
 out
 issue without being condescending. I still am amazed that I actually
 posted
 that question and I feel totally stupid. LOL




~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264807
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Is there a better way to do this

2006-12-21 Thread Bruce Sorge
Loathe,
That was close. I made a couple of changes and it worked like a champ.
Thanks for getting me on the right track.


~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264840
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Is there a better way to do this?

2006-02-23 Thread Thomas Chiverton
On Wednesday 22 February 2006 18:28, Andy Matthews wrote:
 dynamically. Loads of different possibilities though and I'm not sure if it
 would be worth it.

If you need the component more than once, or it is complicated to set up, it's 
worth it.

-- 

Tom Chiverton 
Advanced ColdFusion Programmer

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233221
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Is there a better way to do this?

2006-02-22 Thread Will Tomlinson
Will, is that a typo? You're outputting from a CFC! BLASPHEMY! :-)

ohhh yeah, and I LOVE it!  heeheheee

Rick already gave me a black eye for using cfcontent in a cfc. :)

I asked about it and was given permission from an oo ninja master, whose name 
shall go unmentioned. :)

Will

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233073
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Is there a better way to do this?

2006-02-22 Thread Thomas Chiverton
On Wednesday 22 February 2006 04:33, Michael T. Tangorre wrote:
 Will, is that a typo? You're outputting from a CFC! BLASPHEMY! :-)

We've got an excellent set of GUI components built in CFCs, it rocks.

-- 

Tom Chiverton 
Advanced ColdFusion Programmer

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233084
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Is there a better way to do this?

2006-02-22 Thread Andy Matthews
Care to share them Thomas?

;)

!//--
andy matthews
web developer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--//-

-Original Message-
From: Thomas Chiverton [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 22, 2006 8:51 AM
To: CF-Talk
Subject: Re: Is there a better way to do this?


On Wednesday 22 February 2006 04:33, Michael T. Tangorre wrote:
 Will, is that a typo? You're outputting from a CFC! BLASPHEMY! :-)

We've got an excellent set of GUI components built in CFCs, it rocks.

--

Tom Chiverton
Advanced ColdFusion Programmer



~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233086
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Is there a better way to do this?

2006-02-22 Thread Ken Ferguson
I'm with you Will. I've got one of those no-cfc-output-nazis here at my 
office and I just drive him crazy with a bunch of components that I use 
specifically for output of reports!

--Ferg

Will Tomlinson wrote:
 Will, is that a typo? You're outputting from a CFC! BLASPHEMY! :-)
 

 ohhh yeah, and I LOVE it!  heeheheee

 Rick already gave me a black eye for using cfcontent in a cfc. :)

 I asked about it and was given permission from an oo ninja master, whose name 
 shall go unmentioned. :)

 Will

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233107
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Is there a better way to do this?

2006-02-22 Thread Thomas Chiverton
On Wednesday 22 February 2006 14:57, Andy Matthews wrote:
 Care to share them Thomas?

I'd love to, but 
a) they're too tightly tidy to our data base (not enough MVC abstraction, tsk)
b) they're not mine, they're the companies :-)

It's just wrappers around things like a certain popular DHTML calender 
component, really. Nothing you can't knock up yourself in a spare 15 minutes.

-- 

Tom Chiverton 
Advanced ColdFusion Programmer

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233111
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Is there a better way to do this?

2006-02-22 Thread Andy Matthews
I see...

Just checking. That would be my next step in coding some of my Content
Management sections, setting up code that creates the form elements
dynamically. Loads of different possibilities though and I'm not sure if it
would be worth it.

!//--
andy matthews
web developer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--//-

-Original Message-
From: Thomas Chiverton [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 22, 2006 11:23 AM
To: CF-Talk
Subject: Re: Is there a better way to do this?


On Wednesday 22 February 2006 14:57, Andy Matthews wrote:
 Care to share them Thomas?

I'd love to, but
a) they're too tightly tidy to our data base (not enough MVC abstraction,
tsk)
b) they're not mine, they're the companies :-)

It's just wrappers around things like a certain popular DHTML calender
component, really. Nothing you can't knock up yourself in a spare 15
minutes.

--

Tom Chiverton
Advanced ColdFusion Programmer



~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233134
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Is there a better way to do this?

2006-02-21 Thread Will Tomlinson
I'm outputting a shipping option form from a cfc. The display table depends on 
a few things and it causes me to have to output the form in two different 
places.

This works but I didnt know if someone has a better alt. 

cffunction 
 cfargument.
 cfset var shipoptionform = 

cfsavecontent variable=shipoptionform
extremely long form, with if/elses here. 
/cfsavecontent

td
#shipoptionform# 
/td

and it goes somewhere else in here, depends on a cfif

td
#shipoptionform#
/td

Thanks,
Will
 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233068
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Is there a better way to do this?

2006-02-21 Thread Michael T. Tangorre
 From: Will Tomlinson [mailto:[EMAIL PROTECTED] 
 I'm outputting a shipping option form from a cfc. 

Will, is that a typo? You're outputting from a CFC! BLASPHEMY! :-)



~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233069
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Anyone know of a more elegant way to do this?

2005-05-19 Thread SStewart
Ewok...

This works, 

Thanks

sas

Scott A. Stewart, 
Web Application Developer
 
Engineering Consulting Services, Ltd. (ECS)
14026 Thunderbolt Place, Suite 300
Chantilly, VA 20151
Phone: (703) 995-1737
Fax: (703) 834-5527


-Original Message-
From: Ewok [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 18, 2005 06:03 pm
To: CF-Talk
Subject: RE: Anyone know of a more elegant way to do this?
Importance: Low

Sorry, first one didn’t come through I guess... here it is again

This doesn’t take into account that you may reach ZZ will you actually have
that many on one project? It seems like it would throw your whole numbering
out of whack if so anyway. I definitely agree with Claude (Im sure you do
too) but if you can manage to start with a new schema it would save a lot of
future headache... like actually having 01000AA - 01000ZZ and needing
another since the number seems to be more of a main project indicator and
the letters revisions or changes/updates... anyway... 

This will increment the letters AA - AZ and roll AZ to BA. It's by no means
perfect either but it's not 1000 lines of code :)


cfquery name=jobnum datasource=mydsn maxrows=1
select * from q order by jobid desc
/cfquery

cfset alpha = A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z

cfset LastJobNumber = jobnum.jobnumber

cfset FirstLetter = ucase(left(right(LastJobNumber, 2), 1))
cfset LastLetter = ucase(right(ucase(LastJobNumber), 1))
cfset NumberPrefix = rereplace(LastJobNumber, [^0-9], , ALL)

cfif LastLetter is Z
cfset NewLastLetter = A
cfset IncrementFirst = true
cfelse
cfset LastLetterPosition = ListFind(alpha, LastLetter)
cfset NewFirstLetter = FirstLetter
cfset NewLastLetter = ListGetAt(alpha, LastLetterPosition+1)
cfset IncrementFirst = false
/cfif

cfif IncrementFirst
cfset FirstLetterPosition = ListFind(alpha, FirstLetter)
cfset NewFirstLetter = ListGetAt(alpha, FirstLetterPosition+1)
/cfif

cfoutput#NumberPrefix##NewFirstLetter##newLastLetter#/cfoutput


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.12 - Release Date: 5/17/2005
 




~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207136
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Anyone know of a more elegant way to do this?

2005-05-19 Thread Ewok
No problem (and good luck) Let us know if you shut the doors when you hit
99ZZ :^O

-Original Message-
From: SStewart [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 19, 2005 9:11 AM
To: CF-Talk
Subject: RE: Anyone know of a more elegant way to do this?

Ewok...

This works, 

Thanks

sas

Scott A. Stewart, 
Web Application Developer
 
Engineering Consulting Services, Ltd. (ECS)
14026 Thunderbolt Place, Suite 300
Chantilly, VA 20151
Phone: (703) 995-1737
Fax: (703) 834-5527


-Original Message-
From: Ewok [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 18, 2005 06:03 pm
To: CF-Talk
Subject: RE: Anyone know of a more elegant way to do this?
Importance: Low

Sorry, first one didn’t come through I guess... here it is again

This doesn’t take into account that you may reach ZZ will you actually have
that many on one project? It seems like it would throw your whole numbering
out of whack if so anyway. I definitely agree with Claude (Im sure you do
too) but if you can manage to start with a new schema it would save a lot of
future headache... like actually having 01000AA - 01000ZZ and needing
another since the number seems to be more of a main project indicator and
the letters revisions or changes/updates... anyway... 

This will increment the letters AA - AZ and roll AZ to BA. It's by no means
perfect either but it's not 1000 lines of code :)


cfquery name=jobnum datasource=mydsn maxrows=1
select * from q order by jobid desc
/cfquery

cfset alpha = A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z

cfset LastJobNumber = jobnum.jobnumber

cfset FirstLetter = ucase(left(right(LastJobNumber, 2), 1))
cfset LastLetter = ucase(right(ucase(LastJobNumber), 1))
cfset NumberPrefix = rereplace(LastJobNumber, [^0-9], , ALL)

cfif LastLetter is Z
cfset NewLastLetter = A
cfset IncrementFirst = true
cfelse
cfset LastLetterPosition = ListFind(alpha, LastLetter)
cfset NewFirstLetter = FirstLetter
cfset NewLastLetter = ListGetAt(alpha, LastLetterPosition+1)
cfset IncrementFirst = false
/cfif

cfif IncrementFirst
cfset FirstLetterPosition = ListFind(alpha, FirstLetter)
cfset NewFirstLetter = ListGetAt(alpha, FirstLetterPosition+1)
/cfif

cfoutput#NumberPrefix##NewFirstLetter##newLastLetter#/cfoutput


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.12 - Release Date: 5/17/2005
 






~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207202
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Anyone know of a more elegant way to do this?

2005-05-19 Thread SStewart
Hopefully it'll be after my shelf-life is long gone :P

sas

Scott A. Stewart, 
Web Application Developer
 
Engineering Consulting Services, Ltd. (ECS)
14026 Thunderbolt Place, Suite 300
Chantilly, VA 20151
Phone: (703) 995-1737
Fax: (703) 834-5527


-Original Message-
From: Ewok [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 19, 2005 02:41 pm
To: CF-Talk
Subject: RE: Anyone know of a more elegant way to do this?
Importance: Low

No problem (and good luck) Let us know if you shut the doors when you hit
99ZZ :^O

-Original Message-
From: SStewart [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 19, 2005 9:11 AM
To: CF-Talk
Subject: RE: Anyone know of a more elegant way to do this?

Ewok...

This works, 

Thanks

sas

Scott A. Stewart, 
Web Application Developer
 
Engineering Consulting Services, Ltd. (ECS)
14026 Thunderbolt Place, Suite 300
Chantilly, VA 20151
Phone: (703) 995-1737
Fax: (703) 834-5527


-Original Message-
From: Ewok [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 18, 2005 06:03 pm
To: CF-Talk
Subject: RE: Anyone know of a more elegant way to do this?
Importance: Low

Sorry, first one didn’t come through I guess... here it is again

This doesn’t take into account that you may reach ZZ will you actually have
that many on one project? It seems like it would throw your whole numbering
out of whack if so anyway. I definitely agree with Claude (Im sure you do
too) but if you can manage to start with a new schema it would save a lot of
future headache... like actually having 01000AA - 01000ZZ and needing
another since the number seems to be more of a main project indicator and
the letters revisions or changes/updates... anyway... 

This will increment the letters AA - AZ and roll AZ to BA. It's by no means
perfect either but it's not 1000 lines of code :)


cfquery name=jobnum datasource=mydsn maxrows=1
select * from q order by jobid desc
/cfquery

cfset alpha = A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z

cfset LastJobNumber = jobnum.jobnumber

cfset FirstLetter = ucase(left(right(LastJobNumber, 2), 1))
cfset LastLetter = ucase(right(ucase(LastJobNumber), 1))
cfset NumberPrefix = rereplace(LastJobNumber, [^0-9], , ALL)

cfif LastLetter is Z
cfset NewLastLetter = A
cfset IncrementFirst = true
cfelse
cfset LastLetterPosition = ListFind(alpha, LastLetter)
cfset NewFirstLetter = FirstLetter
cfset NewLastLetter = ListGetAt(alpha, LastLetterPosition+1)
cfset IncrementFirst = false
/cfif

cfif IncrementFirst
cfset FirstLetterPosition = ListFind(alpha, FirstLetter)
cfset NewFirstLetter = ListGetAt(alpha, FirstLetterPosition+1)
/cfif

cfoutput#NumberPrefix##NewFirstLetter##newLastLetter#/cfoutput


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.12 - Release Date: 5/17/2005
 








~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207204
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Anyone know of a more elegant way to do this?

2005-05-19 Thread SStewart
Hopefully it'll be after my shelf-life is long gone :P

sas

Scott A. Stewart, 
Web Application Developer
 
Engineering Consulting Services, Ltd. (ECS)
14026 Thunderbolt Place, Suite 300
Chantilly, VA 20151
Phone: (703) 995-1737
Fax: (703) 834-5527


-Original Message-
From: Ewok [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 19, 2005 02:41 pm
To: CF-Talk
Subject: RE: Anyone know of a more elegant way to do this?
Importance: Low

No problem (and good luck) Let us know if you shut the doors when you
hit
99ZZ :^O

 

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207209
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Anyone know of a more elegant way to do this?

2005-05-18 Thread SStewart
I'm incrementing a project number, it's an alpha-numeric number  (001000A or 
001000AA) if it's a new project I just grab the first six numbers and 
increment, if it's an extended project I have to increment the letter with the 
next one.

My code works but it's kind of a battering ram approach, is there a more 
elegant way to do this?

Thanks

sas

cfif Right(qry_getLastPnum.lPnum,2) CONTAINS A
cfset lPnum = Left(qry_getLastPNum.lPnum,6)B
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS B
cfset lPnum = Left(qry_getLastPNum.lPnum,6)C
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS c
cfset lPnum = Left(qry_getLastPNum.lPnum,6)D
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS D
cfset lPnum = Left(qry_getLastPNum.lPnum,6)E
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS E
cfset lPnum = Left(qry_getLastPNum.lPnum,6)F

Scott A. Stewart, 
Web Application Developer
 
Engineering Consulting Services, Ltd. (ECS)
14026 Thunderbolt Place, Suite 300
Chantilly, VA 20151
Phone: (703) 995-1737
Fax: (703) 834-5527


-Original Message-
From: Adkins, Randy [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 18, 2005 11:08 am
To: CF-Talk
Subject: RE: Good Site Stats Tag Recommendation
Importance: Low

I like the look of Statistex however, I was going to obtain 
The full version but the wellmanweb site does not exist any
Longer.

I know awstats is off of sourceforge and is free, just never
Was able to get mine to work.

Sorry.. My 2 cents

-Original Message-
From: Steve Kahn [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 18, 2005 11:05 AM
To: CF-Talk
Subject: Good Site Stats Tag Recommendation

Anyone have a good site stats tag recommendation?

Thanks Steve





~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207061
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Anyone know of a more elegant way to do this?

2005-05-18 Thread Adrian Lynch
You could use Chr(65) though to Chr(90), this will give you A through to Z.

Chr() and Asc() together might give you something better.

Ade

-Original Message-
From: SStewart [mailto:[EMAIL PROTECTED]
Sent: 18 May 2005 19:34
To: CF-Talk
Subject: Anyone know of a more elegant way to do this?


I'm incrementing a project number, it's an alpha-numeric number  (001000A
or 001000AA) if it's a new project I just grab the first six numbers and
increment, if it's an extended project I have to increment the letter with
the next one.

My code works but it's kind of a battering ram approach, is there a more
elegant way to do this?

Thanks

sas

cfif Right(qry_getLastPnum.lPnum,2) CONTAINS A
cfset lPnum = Left(qry_getLastPNum.lPnum,6)B
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS B
cfset lPnum = Left(qry_getLastPNum.lPnum,6)C
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS c
cfset lPnum = Left(qry_getLastPNum.lPnum,6)D
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS D
cfset lPnum = Left(qry_getLastPNum.lPnum,6)E
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS E
cfset lPnum = Left(qry_getLastPNum.lPnum,6)F

Scott A. Stewart,
Web Application Developer

Engineering Consulting Services, Ltd. (ECS)
14026 Thunderbolt Place, Suite 300
Chantilly, VA 20151

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.12 - Release Date: 17/05/2005


~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207066
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Anyone know of a more elegant way to do this?

2005-05-18 Thread Justin D. Scott
A regular expression would work out much better for this.  Look for a single
character at the end, if found, reReplace() to a new variable using a
backreference to duplicate whatever letter is there already.  I'd write the
code for you but I'm too busy at the moment.  If Jochem is around he can do
it faster than me anyway ;)

-Justin


 -Original Message-
 From: Adrian Lynch [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, May 18, 2005 2:42 PM
 To: CF-Talk
 Subject: RE: Anyone know of a more elegant way to do this?
 
 You could use Chr(65) though to Chr(90), this will give you A 
 through to Z.
 
 Chr() and Asc() together might give you something better.
 
 Ade
 
 -Original Message-
 From: SStewart [mailto:[EMAIL PROTECTED]
 Sent: 18 May 2005 19:34
 To: CF-Talk
 Subject: Anyone know of a more elegant way to do this?
 
 
 I'm incrementing a project number, it's an alpha-numeric 
 number  (001000A
 or 001000AA) if it's a new project I just grab the first six 
 numbers and
 increment, if it's an extended project I have to increment 
 the letter with
 the next one.
 
 My code works but it's kind of a battering ram approach, is 
 there a more
 elegant way to do this?
 
 Thanks
 
 sas
 
 cfif Right(qry_getLastPnum.lPnum,2) CONTAINS A
   cfset lPnum = Left(qry_getLastPNum.lPnum,6)B
   cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS B
   cfset lPnum = Left(qry_getLastPNum.lPnum,6)C
   cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS c
   cfset lPnum = Left(qry_getLastPNum.lPnum,6)D
   cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS D
   cfset lPnum = Left(qry_getLastPNum.lPnum,6)E
   cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS E
   cfset lPnum = Left(qry_getLastPNum.lPnum,6)F
 
 Scott A. Stewart,
 Web Application Developer
 
 Engineering Consulting Services, Ltd. (ECS)
 14026 Thunderbolt Place, Suite 300
 Chantilly, VA 20151
 
 --
 No virus found in this outgoing message.
 Checked by AVG Anti-Virus.
 Version: 7.0.308 / Virus Database: 266.11.12 - Release Date: 
 17/05/2005
 
 
 

~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207067
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Anyone know of a more elegant way to do this?

2005-05-18 Thread Katz, Dov B \(IT\)
Looks like the second part of the number is hex... Perhaps this would
work?

cfset myStr=qry_getLastPnum.lPnum
Cfset myIdx=#REFind(myStr,[A-Z])#
cfset NumericString=left(mystr,myIdx)
CFSET alphaString=right(mystr,len(mystr)-myIdx)

Cfset NumericString=NumericString+1
Cfset alphaString= FormatBaseN(InputBaseN(alphaString,16)+1,16)



-Original Message-
From: SStewart [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 18, 2005 2:34 PM
To: CF-Talk
Subject: Anyone know of a more elegant way to do this?

I'm incrementing a project number, it's an alpha-numeric number
(001000A or 001000AA) if it's a new project I just grab the first six
numbers and increment, if it's an extended project I have to increment
the letter with the next one.

My code works but it's kind of a battering ram approach, is there a more
elegant way to do this?

Thanks

sas

cfif Right(qry_getLastPnum.lPnum,2) CONTAINS A
cfset lPnum = Left(qry_getLastPNum.lPnum,6)B
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS B
cfset lPnum = Left(qry_getLastPNum.lPnum,6)C
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS c
cfset lPnum = Left(qry_getLastPNum.lPnum,6)D
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS D
cfset lPnum = Left(qry_getLastPNum.lPnum,6)E
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS E
cfset lPnum = Left(qry_getLastPNum.lPnum,6)F

Scott A. Stewart,
Web Application Developer
 
Engineering Consulting Services, Ltd. (ECS)
14026 Thunderbolt Place, Suite 300
Chantilly, VA 20151
Phone: (703) 995-1737
Fax: (703) 834-5527


-Original Message-
From: Adkins, Randy [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 18, 2005 11:08 am
To: CF-Talk
Subject: RE: Good Site Stats Tag Recommendation
Importance: Low

I like the look of Statistex however, I was going to obtain The full
version but the wellmanweb site does not exist any Longer.

I know awstats is off of sourceforge and is free, just never Was able to
get mine to work.

Sorry.. My 2 cents

-Original Message-
From: Steve Kahn [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 18, 2005 11:05 AM
To: CF-Talk
Subject: Good Site Stats Tag Recommendation

Anyone have a good site stats tag recommendation?

Thanks Steve







~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207068
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Anyone know of a more elegant way to do this?

2005-05-18 Thread SStewart
I don't think it's HEX, the formula is Job (1) 
First Level Job(1 A-Z) (1A, 1B, 1C etc)
when you hit Z it becomes a Second Level Job (1 A(1-9, A-Z)) (1A1, 
10A2) when you run out of numbers... 1AA, 1AB etc, etc.



Scott A. Stewart, 
Web Application Developer
 
Engineering Consulting Services, Ltd. (ECS)
14026 Thunderbolt Place, Suite 300
Chantilly, VA 20151
Phone: (703) 995-1737
Fax: (703) 834-5527


-Original Message-
From: Katz, Dov B (IT) [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 18, 2005 02:46 pm
To: CF-Talk
Subject: RE: Anyone know of a more elegant way to do this?
Importance: Low

Looks like the second part of the number is hex... Perhaps this would
work?

cfset myStr=qry_getLastPnum.lPnum
Cfset myIdx=#REFind(myStr,[A-Z])#
cfset NumericString=left(mystr,myIdx)
CFSET alphaString=right(mystr,len(mystr)-myIdx)

Cfset NumericString=NumericString+1
Cfset alphaString= FormatBaseN(InputBaseN(alphaString,16)+1,16)



-Original Message-
From: SStewart [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 18, 2005 2:34 PM
To: CF-Talk
Subject: Anyone know of a more elegant way to do this?

I'm incrementing a project number, it's an alpha-numeric number
(001000A or 001000AA) if it's a new project I just grab the first six
numbers and increment, if it's an extended project I have to increment
the letter with the next one.

My code works but it's kind of a battering ram approach, is there a more
elegant way to do this?

Thanks

sas

cfif Right(qry_getLastPnum.lPnum,2) CONTAINS A
cfset lPnum = Left(qry_getLastPNum.lPnum,6)B
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS B
cfset lPnum = Left(qry_getLastPNum.lPnum,6)C
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS c
cfset lPnum = Left(qry_getLastPNum.lPnum,6)D
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS D
cfset lPnum = Left(qry_getLastPNum.lPnum,6)E
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS E
cfset lPnum = Left(qry_getLastPNum.lPnum,6)F

Scott A. Stewart,
Web Application Developer
 
Engineering Consulting Services, Ltd. (ECS)
14026 Thunderbolt Place, Suite 300
Chantilly, VA 20151
Phone: (703) 995-1737
Fax: (703) 834-5527


-Original Message-
From: Adkins, Randy [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 18, 2005 11:08 am
To: CF-Talk
Subject: RE: Good Site Stats Tag Recommendation
Importance: Low

I like the look of Statistex however, I was going to obtain The full
version but the wellmanweb site does not exist any Longer.

I know awstats is off of sourceforge and is free, just never Was able to
get mine to work.

Sorry.. My 2 cents

-Original Message-
From: Steve Kahn [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 18, 2005 11:05 AM
To: CF-Talk
Subject: Good Site Stats Tag Recommendation

Anyone have a good site stats tag recommendation?

Thanks Steve









~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207070
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Anyone know of a more elegant way to do this?

2005-05-18 Thread SStewart
And... I haven't written the second level yet... I wanted to see if a more 
elegant approach would save me from several thousand lines of code...

sas

Scott A. Stewart, 
Web Application Developer
 
Engineering Consulting Services, Ltd. (ECS)
14026 Thunderbolt Place, Suite 300
Chantilly, VA 20151
Phone: (703) 995-1737
Fax: (703) 834-5527


-Original Message-
From: Katz, Dov B (IT) [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 18, 2005 02:46 pm
To: CF-Talk
Subject: RE: Anyone know of a more elegant way to do this?
Importance: Low

Looks like the second part of the number is hex... Perhaps this would
work?

cfset myStr=qry_getLastPnum.lPnum
Cfset myIdx=#REFind(myStr,[A-Z])#
cfset NumericString=left(mystr,myIdx)
CFSET alphaString=right(mystr,len(mystr)-myIdx)

Cfset NumericString=NumericString+1
Cfset alphaString= FormatBaseN(InputBaseN(alphaString,16)+1,16)



-Original Message-
From: SStewart [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 18, 2005 2:34 PM
To: CF-Talk
Subject: Anyone know of a more elegant way to do this?

I'm incrementing a project number, it's an alpha-numeric number
(001000A or 001000AA) if it's a new project I just grab the first six
numbers and increment, if it's an extended project I have to increment
the letter with the next one.

My code works but it's kind of a battering ram approach, is there a more
elegant way to do this?

Thanks

sas

cfif Right(qry_getLastPnum.lPnum,2) CONTAINS A
cfset lPnum = Left(qry_getLastPNum.lPnum,6)B
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS B
cfset lPnum = Left(qry_getLastPNum.lPnum,6)C
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS c
cfset lPnum = Left(qry_getLastPNum.lPnum,6)D
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS D
cfset lPnum = Left(qry_getLastPNum.lPnum,6)E
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS E
cfset lPnum = Left(qry_getLastPNum.lPnum,6)F

Scott A. Stewart,
Web Application Developer
 
Engineering Consulting Services, Ltd. (ECS)
14026 Thunderbolt Place, Suite 300
Chantilly, VA 20151
Phone: (703) 995-1737
Fax: (703) 834-5527


-Original Message-
From: Adkins, Randy [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 18, 2005 11:08 am
To: CF-Talk
Subject: RE: Good Site Stats Tag Recommendation
Importance: Low

I like the look of Statistex however, I was going to obtain The full
version but the wellmanweb site does not exist any Longer.

I know awstats is off of sourceforge and is free, just never Was able to
get mine to work.

Sorry.. My 2 cents

-Original Message-
From: Steve Kahn [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 18, 2005 11:05 AM
To: CF-Talk
Subject: Good Site Stats Tag Recommendation

Anyone have a good site stats tag recommendation?

Thanks Steve









~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207071
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Anyone know of a more elegant way to do this?

2005-05-18 Thread Katz, Dov B \(IT\)
Fine so change 16 in my code to 36, same idea, different radix.

Levels would be base 36, starting at 10.  This will be rendered as A
initially. 

 FormatBaseN(InputBaseN(alphaString,36)+1,36)

-dov 

-Original Message-
From: SStewart [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 18, 2005 3:01 PM
To: CF-Talk
Subject: RE: Anyone know of a more elegant way to do this?

I don't think it's HEX, the formula is Job (1) First Level Job(1
A-Z) (1A, 1B, 1C etc) when you hit Z it becomes a Second
Level Job (1 A(1-9, A-Z)) (1A1, 10A2) when you run out of
numbers... 1AA, 1AB etc, etc.



Scott A. Stewart, 
Web Application Developer
 
Engineering Consulting Services, Ltd. (ECS)
14026 Thunderbolt Place, Suite 300
Chantilly, VA 20151
Phone: (703) 995-1737
Fax: (703) 834-5527


-Original Message-
From: Katz, Dov B (IT) [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 18, 2005 02:46 pm
To: CF-Talk
Subject: RE: Anyone know of a more elegant way to do this?
Importance: Low

Looks like the second part of the number is hex... Perhaps this would
work?

cfset myStr=qry_getLastPnum.lPnum
Cfset myIdx=#REFind(myStr,[A-Z])#
cfset NumericString=left(mystr,myIdx)
CFSET alphaString=right(mystr,len(mystr)-myIdx)

Cfset NumericString=NumericString+1
Cfset alphaString= FormatBaseN(InputBaseN(alphaString,16)+1,16)



-Original Message-
From: SStewart [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 18, 2005 2:34 PM
To: CF-Talk
Subject: Anyone know of a more elegant way to do this?

I'm incrementing a project number, it's an alpha-numeric number
(001000A or 001000AA) if it's a new project I just grab the first six
numbers and increment, if it's an extended project I have to increment
the letter with the next one.

My code works but it's kind of a battering ram approach, is there a more
elegant way to do this?

Thanks

sas

cfif Right(qry_getLastPnum.lPnum,2) CONTAINS A
cfset lPnum = Left(qry_getLastPNum.lPnum,6)B
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS B
cfset lPnum = Left(qry_getLastPNum.lPnum,6)C
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS c
cfset lPnum = Left(qry_getLastPNum.lPnum,6)D
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS D
cfset lPnum = Left(qry_getLastPNum.lPnum,6)E
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS E
cfset lPnum = Left(qry_getLastPNum.lPnum,6)F

Scott A. Stewart,
Web Application Developer
 
Engineering Consulting Services, Ltd. (ECS)
14026 Thunderbolt Place, Suite 300
Chantilly, VA 20151
Phone: (703) 995-1737
Fax: (703) 834-5527


-Original Message-
From: Adkins, Randy [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 18, 2005 11:08 am
To: CF-Talk
Subject: RE: Good Site Stats Tag Recommendation
Importance: Low

I like the look of Statistex however, I was going to obtain The full
version but the wellmanweb site does not exist any Longer.

I know awstats is off of sourceforge and is free, just never Was able to
get mine to work.

Sorry.. My 2 cents

-Original Message-
From: Steve Kahn [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 18, 2005 11:05 AM
To: CF-Talk
Subject: Good Site Stats Tag Recommendation

Anyone have a good site stats tag recommendation?

Thanks Steve











~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207072
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Anyone know of a more elegant way to do this?

2005-05-18 Thread Claude Schneegans
 I don't think it's HEX, the formula is Job (1)

First Level Job(1 A-Z) (1A, 1B, 1C etc)
when you hit Z it becomes a Second Level Job (1 A(1-9, A-Z)) (1A1, 
10A2) when you run out of numbers... 1AA, 1AB etc, etc.

I don't know if there a more elegant way to write the code, but I swear I could 
find a far much more elegant way to assign job numbers! ;-)

-- 
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.


~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207082
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Anyone know of a more elegant way to do this?

2005-05-18 Thread SStewart
Yeah, no kidding, BUT, I'm stepping into this after this system was 
established. I'm putting a web face on a set of Foxpro 5 freetables.

I don't know why it's done that way but I'm stuck with it.

:P

sas

Scott A. Stewart, 
Web Application Developer
 
Engineering Consulting Services, Ltd. (ECS)
14026 Thunderbolt Place, Suite 300
Chantilly, VA 20151
Phone: (703) 995-1737
Fax: (703) 834-5527


-Original Message-
From: Claude Schneegans [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 18, 2005 04:41 pm
To: CF-Talk
Subject: Re: Anyone know of a more elegant way to do this?
Importance: Low

 I don't think it's HEX, the formula is Job (1)

First Level Job(1 A-Z) (1A, 1B, 1C etc)
when you hit Z it becomes a Second Level Job (1 A(1-9, A-Z)) (1A1, 
10A2) when you run out of numbers... 1AA, 1AB etc, etc.

I don't know if there a more elegant way to write the code, but I swear I could 
find a far much more elegant way to assign job numbers! ;-)

-- 
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.




~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207083
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Anyone know of a more elegant way to do this?

2005-05-18 Thread Ewok
This doesn’t take into account that you may reach ZZ will you actually have
that many on one project? It seems like it would throw your whole numbering
out of whack if so anyway. I definitely agree with Claude (Im sure you do
too) but if you can manage to start with a new schema it would save a lot of
future headache... like actually having 01000AA - 01000ZZ and needing
another since the number seems to be more of a main project indicator and
the letters revisions or changes/updates... anyway... 

This will increment the letters AA - AZ and roll AZ to BA. It's by no means
perfect either but it's not 1000 lines of code :)


cfquery name=jobnum datasource=mydsn maxrows=1
select * from q order by jobid desc
/cfquery

cfset alpha = A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z

cfset LastJobNumber = jobnum.jobnumber

cfset FirstLetter = ucase(left(right(LastJobNumber, 2), 1))
cfset LastLetter = ucase(right(ucase(LastJobNumber), 1))
cfset NumberPrefix = rereplace(LastJobNumber, [^0-9], , ALL)

cfif LastLetter is Z
cfset NewLastLetter = A
cfset IncrementFirst = true
cfelse
cfset LastLetterPosition = ListFind(alpha, LastLetter)
cfset NewFirstLetter = FirstLetter
cfset NewLastLetter = ListGetAt(alpha, LastLetterPosition+1)
cfset IncrementFirst = false
/cfif

cfif IncrementFirst
cfset FirstLetterPosition = ListFind(alpha, FirstLetter)
cfset NewFirstLetter = ListGetAt(alpha, FirstLetterPosition+1)
/cfif

cfoutput#NumberPrefix##NewFirstLetter##newLastLetter#/cfoutput

-Original Message-
From: SStewart [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 18, 2005 2:34 PM
To: CF-Talk
Subject: Anyone know of a more elegant way to do this?

I'm incrementing a project number, it's an alpha-numeric number  (001000A
or 001000AA) if it's a new project I just grab the first six numbers and
increment, if it's an extended project I have to increment the letter with
the next one.

My code works but it's kind of a battering ram approach, is there a more
elegant way to do this?

Thanks

sas

cfif Right(qry_getLastPnum.lPnum,2) CONTAINS A
cfset lPnum = Left(qry_getLastPNum.lPnum,6)B
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS B
cfset lPnum = Left(qry_getLastPNum.lPnum,6)C
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS c
cfset lPnum = Left(qry_getLastPNum.lPnum,6)D
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS D
cfset lPnum = Left(qry_getLastPNum.lPnum,6)E
cfelseif Right(qry_getLastPnum.lPnum,2) CONTAINS E
cfset lPnum = Left(qry_getLastPNum.lPnum,6)F

Scott A. Stewart, 
Web Application Developer
 
Engineering Consulting Services, Ltd. (ECS)
14026 Thunderbolt Place, Suite 300
Chantilly, VA 20151
Phone: (703) 995-1737
Fax: (703) 834-5527


-Original Message-
From: Adkins, Randy [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 18, 2005 11:08 am
To: CF-Talk
Subject: RE: Good Site Stats Tag Recommendation
Importance: Low

I like the look of Statistex however, I was going to obtain 
The full version but the wellmanweb site does not exist any
Longer.

I know awstats is off of sourceforge and is free, just never
Was able to get mine to work.

Sorry.. My 2 cents

-Original Message-
From: Steve Kahn [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 18, 2005 11:05 AM
To: CF-Talk
Subject: Good Site Stats Tag Recommendation

Anyone have a good site stats tag recommendation?

Thanks Steve







~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207093
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Anyone know of a more elegant way to do this?

2005-05-18 Thread Ewok
Sorry, first one didn’t come through I guess... here it is again

This doesn’t take into account that you may reach ZZ will you actually have
that many on one project? It seems like it would throw your whole numbering
out of whack if so anyway. I definitely agree with Claude (Im sure you do
too) but if you can manage to start with a new schema it would save a lot of
future headache... like actually having 01000AA - 01000ZZ and needing
another since the number seems to be more of a main project indicator and
the letters revisions or changes/updates... anyway... 

This will increment the letters AA - AZ and roll AZ to BA. It's by no means
perfect either but it's not 1000 lines of code :)


cfquery name=jobnum datasource=mydsn maxrows=1
select * from q order by jobid desc
/cfquery

cfset alpha = A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z

cfset LastJobNumber = jobnum.jobnumber

cfset FirstLetter = ucase(left(right(LastJobNumber, 2), 1))
cfset LastLetter = ucase(right(ucase(LastJobNumber), 1))
cfset NumberPrefix = rereplace(LastJobNumber, [^0-9], , ALL)

cfif LastLetter is Z
cfset NewLastLetter = A
cfset IncrementFirst = true
cfelse
cfset LastLetterPosition = ListFind(alpha, LastLetter)
cfset NewFirstLetter = FirstLetter
cfset NewLastLetter = ListGetAt(alpha, LastLetterPosition+1)
cfset IncrementFirst = false
/cfif

cfif IncrementFirst
cfset FirstLetterPosition = ListFind(alpha, FirstLetter)
cfset NewFirstLetter = ListGetAt(alpha, FirstLetterPosition+1)
/cfif

cfoutput#NumberPrefix##NewFirstLetter##newLastLetter#/cfoutput


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.12 - Release Date: 5/17/2005
 


~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207095
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Anyone know of a more elegant way to do this?

2005-05-18 Thread Ewok
Ok, so I'm bored today...

This one DOES take into account the ZZ scenario and increment the number
portion as well...


cfoutput#incProjNum(001000ZZ)#/cfoutput

Will spit out 001001AA

I don’t know what Outlook or HoF is going to do to the formatting of this
but just paste it into a template and it should come out fine.


cfscript
function incProjNum(LastjobNumber)
{
alpha = A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z;

FirstLetter = ucase(left(right(LastJobNumber, 2), 1));
LastLetter = ucase(right(ucase(LastJobNumber), 1));
NumberPrefix = rereplace(LastJobNumber, [^0-9], , ALL);

NewNumberPrefix = NumberPrefix;

if (FirstLetter  LastLetter is ZZ)
{
IncrementLetters = false;
NewFirstLetter = A;
NewLastLetter = A;
}
else
{
IncrementLetters = true;
}

if (IncrementLetters)
{
if (LastLetter is Z)
{
NewLastLetter = A;
IncrementFirst = true;
}
else
{
LastLetterPosition = ListFind(alpha, LastLetter);
NewFirstLetter = FirstLetter;
NewLastLetter = ListGetAt(alpha,
LastLetterPosition+1);
IncrementFirst = false;
}

if (IncrementFirst)
{
FirstLetterPosition = ListFind(alpha, FirstLetter);
NewFirstLetter = ListGetAt(alpha,
FirstLetterPosition+1);
}

}
else
{
NewNumberPrefix = numberformat(NumberPrefix + 1, 00);
}

return NewNumberPrefix  NewFirstLetter  NewLastLetter;
}
/cfscript


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.12 - Release Date: 5/17/2005
 


~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207099
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: cfprocparam - easier way to do this?

2004-03-22 Thread Dave Watts
 I am wondering if there is a more efficient way to do this. I 
 want to be able to blindly pass in my vars to a stored 
 procedure, and let SQL determine if a NULL is required or 
 not. One variable example is below on how I am passing it, as 
 well as the first few lines of the stored procedure. Is this 
 the only way to achieve this and not store a space in the column?
 
 cfif trim(AUTH_AUTH_AVS) NEQ 
 	cfprocparam type=In variable=@AUTH_AUTH_AVS
 cfsqltype=CF_SQL_VARCHAR value=#auth_auth_avs# cfelse
 	 cfprocparam type=In variable=@AUTH_AUTH_AVS
 cfsqltype=CF_SQL_VARCHAR null=Yes
 /cfif	
 
 And the start of the stored proc:
 CREATE PROCEDURE nwoSP_insTblCCAuthLog (
 	@auth_auth_avs char (1)= NULL ,

You could simplify that a bit by embedding your conditional logic within the
NULL attribute of your CFPROCPARAM:

cfprocparam ... value=#AUTH_AUTH_AVS# null=#YesNoFormat(NOT
Len(Trim(AUTH_AUTH_AVS))#

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Is there a good way to do this?

2003-06-10 Thread Mark W. Breneman
I need to replace all single quotes with double single quotes in all of the
fields of a query.  I know that I could do it in a query but in this case I
am opting not to.


I have come up with this idea of but I am having a problem with the i[x]
part.  Any ideas?

cfoutput query=getreg 
cfset x=0 
cfloop index=i list=#columnlist#
cfset temp= QuerySetCell(getreg, i, replace(i[x],', '',all), x 
) 
cfset x=x+1 
/cfloop
/cfoutput



Mark W. Breneman
-Macromedia Certified ColdFusion Developer
-Network / Web Server Administrator
  Vivid Media
  [EMAIL PROTECTED]
  www.vividmedia.com
  608.270.9770

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: Is there a good way to do this?

2003-06-10 Thread Philip Arnold
One word - CFSCRIPT

Also, when you refer to a cell in a query with square brackets it's
Query[Field][Row]

So it'd be GetReg[i][x]

 From: Mark W. Breneman [mailto:[EMAIL PROTECTED]

 I need to replace all single quotes with double single quotes
 in all of the fields of a query.  I know that I could do it
 in a query but in this case I am opting not to.

 I have come up with this idea of but I am having a problem
 with the i[x] part.  Any ideas?

 cfoutput query=getreg 
   cfset x=0 
   cfloop index=i list=#columnlist#
   cfset temp= QuerySetCell(getreg, i,
 replace(i[x],', '',all), x ) 
   cfset x=x+1 
   /cfloop
 /cfoutput


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Host with the leader in ColdFusion hosting. 
Voted #1 ColdFusion host by CF Developers. 
Offering shared and dedicated hosting options. 
www.cfxhosting.com/default.cfm?redirect=10481

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: Is there a good way to do this?

2003-06-10 Thread Mosh Teitelbaum
I haven't tried it, so take this with a grain or three of salt, but 2 things
stand out:

1) Start x at 1, not 0, and
2) You probably have to use the Evaluate() function around the i[x] bit as
in:
replace(Evaluate(getreg.#i#[#x#]),', '',all)

Again, untested.

--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 942-5378
Fax: (301) 933-3651
Email: [EMAIL PROTECTED]
WWW: http://www.evoch.com/


 -Original Message-
 From: Mark W. Breneman [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 10, 2003 3:52 PM
 To: CF-Talk
 Subject: Is there a good way to do this?


 I need to replace all single quotes with double single quotes in
 all of the
 fields of a query.  I know that I could do it in a query but in
 this case I
 am opting not to.


 I have come up with this idea of but I am having a problem with the i[x]
 part.  Any ideas?

 cfoutput query=getreg 
   cfset x=0 
   cfloop index=i list=#columnlist#
   cfset temp= QuerySetCell(getreg, i,
 replace(i[x],', '',all), x ) 
   cfset x=x+1 
   /cfloop
 /cfoutput



 Mark W. Breneman
 -Macromedia Certified ColdFusion Developer
 -Network / Web Server Administrator
   Vivid Media
   [EMAIL PROTECTED]
   www.vividmedia.com
   608.270.9770

 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Get the mailserver that powers this list at 
http://www.coolfusion.com

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



Re: Is there a good way to do this?

2003-06-10 Thread S . Isaac Dealey
You weren't too far off...

cfoutput query=getreg 
  cfloop index=i list=#columnlist#
cfset temp= QuerySetCell(getreg,i,
replace(getreg[i][currentrow],',
'',all),currentrow)
  /cfloop
/cfoutput

Sorry for the wrap...

 I need to replace all single quotes with double single
 quotes in all of the
 fields of a query.  I know that I could do it in a query
 but in this case I
 am opting not to.


 I have come up with this idea of but I am having a problem
 with the i[x]
 part.  Any ideas?

 cfoutput query=getreg 
   cfset x=0 
   cfloop index=i list=#columnlist#
   cfset temp= QuerySetCell(getreg, i, replace(i[x],',
   '',all), x ) 
   cfset x=x+1 
   /cfloop
 /cfoutput



 Mark W. Breneman
 -Macromedia Certified ColdFusion Developer
 -Network / Web Server Administrator
   Vivid Media
   [EMAIL PROTECTED]
   www.vividmedia.com
   608.270.9770

 ~~
 ~~~|
 Archives:
 http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
 Subscription: http://www.houseoffusion.com/cf_lists/index.
 cfm?method=subscribeforumid=4
 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

 This list and all House of Fusion resources hosted by
 CFHosting.com. The place for dependable ColdFusion
 Hosting.
 http://www.cfhosting.com

   Unsubscribe: http://www.houseoffusion.com/cf_lists/uns
   ubscribe.cfm?user=633.558.4




s. isaac dealey972-490-6624

new epoch  http://www.turnkey.to

lead architect, tapestry cms   http://products.turnkey.to

tapestry api is opensource http://www.turnkey.to/tapi

certified advanced coldfusion 5 developer
http://www.macromedia.com/v1/handlers/index.cfm?ID=21816


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Host with the leader in ColdFusion hosting. 
Voted #1 ColdFusion host by CF Developers. 
Offering shared and dedicated hosting options. 
www.cfxhosting.com/default.cfm?redirect=10481

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: Is there a good way to do this?

2003-06-10 Thread Mosh Teitelbaum
Actually, either way would work.  Both of the following produce the same
result:

QueryName.ColumnName[RowNumber]

QueryName[ColumnName][RowNumber]

I had forgotten about this second format which is a good way of getting
around having to use Evaluate().

--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 942-5378
Fax: (301) 933-3651
Email: [EMAIL PROTECTED]
WWW: http://www.evoch.com/


 -Original Message-
 From: Philip Arnold [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 10, 2003 4:01 PM
 To: CF-Talk
 Subject: RE: Is there a good way to do this?


 One word - CFSCRIPT

 Also, when you refer to a cell in a query with square brackets it's
 Query[Field][Row]

 So it'd be GetReg[i][x]

  From: Mark W. Breneman [mailto:[EMAIL PROTECTED]
 
  I need to replace all single quotes with double single quotes
  in all of the fields of a query.  I know that I could do it
  in a query but in this case I am opting not to.
 
  I have come up with this idea of but I am having a problem
  with the i[x] part.  Any ideas?
 
  cfoutput query=getreg 
  cfset x=0 
  cfloop index=i list=#columnlist#
  cfset temp= QuerySetCell(getreg, i,
  replace(i[x],', '',all), x ) 
  cfset x=x+1 
  /cfloop
  /cfoutput


 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: Is there a good way to do this?

2003-06-10 Thread Mark W. Breneman
Thank you!

I knew it was something simple like that.

Yes, CFSCRIPT is how I should do it.

Mark W. Breneman
-Macromedia Certified ColdFusion Developer
-Network / Web Server Administrator
  Vivid Media
  [EMAIL PROTECTED]
  www.vividmedia.com
  608.270.9770

-Original Message-
From: Philip Arnold [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 10, 2003 3:01 PM
To: CF-Talk
Subject: RE: Is there a good way to do this?


One word - CFSCRIPT

Also, when you refer to a cell in a query with square brackets it's
Query[Field][Row]

So it'd be GetReg[i][x]

 From: Mark W. Breneman [mailto:[EMAIL PROTECTED]

 I need to replace all single quotes with double single quotes
 in all of the fields of a query.  I know that I could do it
 in a query but in this case I am opting not to.

 I have come up with this idea of but I am having a problem
 with the i[x] part.  Any ideas?

 cfoutput query=getreg 
   cfset x=0 
   cfloop index=i list=#columnlist#
   cfset temp= QuerySetCell(getreg, i,
 replace(i[x],', '',all), x ) 
   cfset x=x+1 
   /cfloop
 /cfoutput



~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: Is there a good way to do this?

2003-06-10 Thread S . Isaac Dealey
 One word - CFSCRIPT

Why?

Outside of having a structtoquery() function...

 Also, when you refer to a cell in a query with square
 brackets it's
 Query[Field][Row]

 So it'd be GetReg[i][x]

 From: Mark W. Breneman [mailto:[EMAIL PROTECTED]

 I need to replace all single quotes with double single
 quotes
 in all of the fields of a query.  I know that I could do
 it
 in a query but in this case I am opting not to.

 I have come up with this idea of but I am having a
 problem
 with the i[x] part.  Any ideas?

 cfoutput query=getreg 
  cfset x=0 
  cfloop index=i list=#columnlist#
  cfset temp= QuerySetCell(getreg, i,
 replace(i[x],', '',all), x ) 
  cfset x=x+1 
  /cfloop
 /cfoutput


s. isaac dealey972-490-6624

new epoch  http://www.turnkey.to

lead architect, tapestry cms   http://products.turnkey.to

tapestry api is opensource http://www.turnkey.to/tapi

certified advanced coldfusion 5 developer
http://www.macromedia.com/v1/handlers/index.cfm?ID=21816


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: Is there a good way to do this?

2003-06-10 Thread Chris Kief
Why even create the temp variable??

cfset QuerySetCell(...)

chris



-Original Message-
From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 10, 2003 1:14 PM
To: CF-Talk
Subject: Re: Is there a good way to do this?

You weren't too far off...

cfoutput query=getreg 
  cfloop index=i list=#columnlist#
cfset temp= QuerySetCell(getreg,i,
replace(getreg[i][currentrow],',
'',all),currentrow)
  /cfloop
/cfoutput

Sorry for the wrap...

 I need to replace all single quotes with double single
 quotes in all of the
 fields of a query.  I know that I could do it in a query
 but in this case I
 am opting not to.


 I have come up with this idea of but I am having a problem
 with the i[x]
 part.  Any ideas?

 cfoutput query=getreg 
  cfset x=0 
  cfloop index=i list=#columnlist#
  cfset temp= QuerySetCell(getreg, i, replace(i[x],',
  '',all), x ) 
  cfset x=x+1 
  /cfloop
 /cfoutput



 Mark W. Breneman
 -Macromedia Certified ColdFusion Developer
 -Network / Web Server Administrator
   Vivid Media
   [EMAIL PROTECTED]
   www.vividmedia.com
   608.270.9770

 ~~
 ~~~|
 Archives:
 http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
 Subscription: http://www.houseoffusion.com/cf_lists/index.
 cfm?method=subscribeforumid=4
 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

 This list and all House of Fusion resources hosted by
 CFHosting.com. The place for dependable ColdFusion
 Hosting.
 http://www.cfhosting.com

  Unsubscribe:
http://www.houseoffusion.com/cf_lists/uns
  ubscribe.cfm?user=633.558.4




s. isaac dealey972-490-6624

new epoch  http://www.turnkey.to

lead architect, tapestry cms   http://products.turnkey.to

tapestry api is opensource http://www.turnkey.to/tapi

certified advanced coldfusion 5 developer
http://www.macromedia.com/v1/handlers/index.cfm?ID=21816



~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: Is there a good way to do this?

2003-06-10 Thread S . Isaac Dealey
 I haven't tried it, so take this with a grain or three of
 salt, but 2 things
 stand out:

 1) Start x at 1, not 0, and
 2) You probably have to use the Evaluate() function around
 the i[x] bit as
 in:
   replace(Evaluate(getreg.#i#[#x#]),', '',all)

 Again, untested.

This should work, but is probably not the best way to handle it. The # around x in 
this string aren't necessary, in other words evaluate(getreg.#i#[x]) would also 
work... x however is a duplication of the getreg.currentrow variable, so all the stuff 
to manipulate x can go away... and you can use array notation for both dimension of 
the query which makes the evaluate() unnecessary overhead, so getreg[i][currentrow] 
also works.

hth 

s. isaac dealey972-490-6624

new epoch  http://www.turnkey.to

lead architect, tapestry cms   http://products.turnkey.to

tapestry api is opensource http://www.turnkey.to/tapi

certified advanced coldfusion 5 developer
http://www.macromedia.com/v1/handlers/index.cfm?ID=21816


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: Is there a good way to do this?

2003-06-10 Thread Philip Arnold
  One word - CFSCRIPT

 Why?

Speed and WhiteSpace

I know CFMX levels the speed between CF tags and CFSCRIPT but it's
easier to read and easier if the code is running on CF5 and CFMX

As for WhiteSpace, I know that CFSETTING can get rid of that, but most
people tend to not use it...




~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: Is there a good way to do this?

2003-06-10 Thread Mark W. Breneman
To be honest, I was not sure if I needed to or not.  I thought about it for
a sec and decided that I was sure it would work with the temp variable.

Is there a rule of thumb to when you have to use a temp var for doing stuff
like that.  I found some function last week that required me to make a temp
var.  (Well maybe it was the version of CF server that forced that.)

Mark W. Breneman
-Macromedia Certified ColdFusion Developer
-Network / Web Server Administrator
  Vivid Media
  [EMAIL PROTECTED]
  www.vividmedia.com
  608.270.9770

-Original Message-
From: Chris Kief [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 10, 2003 3:26 PM
To: CF-Talk
Subject: RE: Is there a good way to do this?


Why even create the temp variable??

cfset QuerySetCell(...)

chris



-Original Message-
From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 10, 2003 1:14 PM
To: CF-Talk
Subject: Re: Is there a good way to do this?

You weren't too far off...

cfoutput query=getreg 
  cfloop index=i list=#columnlist#
cfset temp= QuerySetCell(getreg,i,
replace(getreg[i][currentrow],',
'',all),currentrow)
  /cfloop
/cfoutput

Sorry for the wrap...

 I need to replace all single quotes with double single
 quotes in all of the
 fields of a query.  I know that I could do it in a query
 but in this case I
 am opting not to.


 I have come up with this idea of but I am having a problem
 with the i[x]
 part.  Any ideas?

 cfoutput query=getreg 
  cfset x=0 
  cfloop index=i list=#columnlist#
  cfset temp= QuerySetCell(getreg, i, replace(i[x],',
  '',all), x ) 
  cfset x=x+1 
  /cfloop
 /cfoutput



 Mark W. Breneman
 -Macromedia Certified ColdFusion Developer
 -Network / Web Server Administrator
   Vivid Media
   [EMAIL PROTECTED]
   www.vividmedia.com
   608.270.9770

 ~~
 ~~~|
 Archives:
 http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
 Subscription: http://www.houseoffusion.com/cf_lists/index.
 cfm?method=subscribeforumid=4
 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

 This list and all House of Fusion resources hosted by
 CFHosting.com. The place for dependable ColdFusion
 Hosting.
 http://www.cfhosting.com

  Unsubscribe:
http://www.houseoffusion.com/cf_lists/uns
  ubscribe.cfm?user=633.558.4




s. isaac dealey972-490-6624

new epoch  http://www.turnkey.to

lead architect, tapestry cms   http://products.turnkey.to

tapestry api is opensource http://www.turnkey.to/tapi

certified advanced coldfusion 5 developer
http://www.macromedia.com/v1/handlers/index.cfm?ID=21816




~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: Is there a good way to do this?

2003-06-10 Thread S . Isaac Dealey
Oops... forgot to remove the temp= ... heh. :)

 Why even create the temp variable??

 cfset QuerySetCell(...)

 chris



-Original Message-
From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 10, 2003 1:14 PM
To: CF-Talk
Subject: Re: Is there a good way to do this?

You weren't too far off...

cfoutput query=getreg 
  cfloop index=i list=#columnlist#
cfset temp= QuerySetCell(getreg,i,
replace(getreg[i][currentrow],',
'',all),currentrow)
  /cfloop
/cfoutput

Sorry for the wrap...

 I need to replace all single quotes with double single
 quotes in all of the
 fields of a query.  I know that I could do it in a query
 but in this case I
 am opting not to.


 I have come up with this idea of but I am having a
 problem
 with the i[x]
 part.  Any ideas?

 cfoutput query=getreg 
 cfset x=0 
 cfloop index=i list=#columnlist#
 cfset temp= QuerySetCell(getreg, i, replace(i[x],',
 '',all), x ) 
 cfset x=x+1 
 /cfloop
 /cfoutput



 Mark W. Breneman
 -Macromedia Certified ColdFusion Developer
 -Network / Web Server Administrator
   Vivid Media
   [EMAIL PROTECTED]
   www.vividmedia.com
   608.270.9770

 
 ~~
 ~~~|
 Archives:
 http://www.houseoffusion.com/cf_lists/index.cfm?forumid=
 4
 Subscription:
 http://www.houseoffusion.com/cf_lists/index.
 cfm?method=subscribeforumid=4
 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

 This list and all House of Fusion resources hosted by
 CFHosting.com. The place for dependable ColdFusion
 Hosting.
 http://www.cfhosting.com

 Unsubscribe:
http://www.houseoffusion.com/cf_lists/uns
 ubscribe.cfm?user=633.558.4




s. isaac dealey972-490-6624

new epoch  http://www.turnkey.to

lead architect, tapestry cms   http://products.turnkey.to

tapestry api is opensource http://www.turnkey.to/tapi

certified advanced coldfusion 5 developer
http://www.macromedia.com/v1/handlers/index.cfm?ID=21816



 ~~
 ~~~|
 Archives:
 http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
 Subscription: http://www.houseoffusion.com/cf_lists/index.
 cfm?method=subscribeforumid=4
 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

 This list and all House of Fusion resources hosted by
 CFHosting.com. The place for dependable ColdFusion
 Hosting.
 http://www.cfhosting.com

   Unsubscribe: http://www.houseoffusion.com/cf_lists/uns
   ubscribe.cfm?user=633.558.4




s. isaac dealey972-490-6624

new epoch  http://www.turnkey.to

lead architect, tapestry cms   http://products.turnkey.to

tapestry api is opensource http://www.turnkey.to/tapi

certified advanced coldfusion 5 developer
http://www.macromedia.com/v1/handlers/index.cfm?ID=21816


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Get the mailserver that powers this list at 
http://www.coolfusion.com

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: Is there a good way to do this?

2003-06-10 Thread S . Isaac Dealey
  One word - CFSCRIPT

 Why?

 Speed and WhiteSpace

 I know CFMX levels the speed between CF tags and
 CFSCRIPT but it's
 easier to read and easier if the code is running on CF5
 and CFMX

 As for WhiteSpace, I know that CFSETTING can get rid of
 that, but most
 people tend to not use it...

Ahh... Whitespace I'd agree with... 

I was under the impression that differences in speed between cfscript and tags had 
been debunked in CF5.

Personally I don't find cfscript any easier to read. 

s. isaac dealey972-490-6624

new epoch  http://www.turnkey.to

lead architect, tapestry cms   http://products.turnkey.to

tapestry api is opensource http://www.turnkey.to/tapi

certified advanced coldfusion 5 developer
http://www.macromedia.com/v1/handlers/index.cfm?ID=21816


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: Is there a good way to do this?

2003-06-10 Thread Mosh Teitelbaum
Guess it needs to be taken with 4 grains of salt 8^).

--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 942-5378
Fax: (301) 933-3651
Email: [EMAIL PROTECTED]
WWW: http://www.evoch.com/


 -Original Message-
 From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 10, 2003 4:28 PM
 To: CF-Talk
 Subject: RE: Is there a good way to do this?


  I haven't tried it, so take this with a grain or three of
  salt, but 2 things
  stand out:

  1) Start x at 1, not 0, and
  2) You probably have to use the Evaluate() function around
  the i[x] bit as
  in:
  replace(Evaluate(getreg.#i#[#x#]),', '',all)

  Again, untested.

 This should work, but is probably not the best way to handle it.
 The # around x in this string aren't necessary, in other words
 evaluate(getreg.#i#[x]) would also work... x however is a
 duplication of the getreg.currentrow variable, so all the stuff
 to manipulate x can go away... and you can use array notation for
 both dimension of the query which makes the evaluate()
 unnecessary overhead, so getreg[i][currentrow] also works.

 hth

 s. isaac dealey972-490-6624

 new epoch  http://www.turnkey.to

 lead architect, tapestry cms   http://products.turnkey.to

 tapestry api is opensource http://www.turnkey.to/tapi

 certified advanced coldfusion 5 developer
 http://www.macromedia.com/v1/handlers/index.cfm?ID=21816


 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Host with the leader in ColdFusion hosting. 
Voted #1 ColdFusion host by CF Developers. 
Offering shared and dedicated hosting options. 
www.cfxhosting.com/default.cfm?redirect=10481

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: Is there a good way to do this?

2003-06-10 Thread Mosh Teitelbaum
When using a CFSET tag, you only need the variable part if you want to
capture the result of the function/expression.  So, if you were adding 2
numbers, you'd want to have the variable as in:

CFSET sum = 5 + 2

But if the function directly modifies one of its arguments and you don't
need to use the result of the function later in your code, you can leave out
the variable assignment as in:

CFSET QuerySetCell(...)

--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 942-5378
Fax: (301) 933-3651
Email: [EMAIL PROTECTED]
WWW: http://www.evoch.com/


 -Original Message-
 From: Mark W. Breneman [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 10, 2003 4:50 PM
 To: CF-Talk
 Subject: RE: Is there a good way to do this?


 To be honest, I was not sure if I needed to or not.  I thought
 about it for
 a sec and decided that I was sure it would work with the temp variable.

 Is there a rule of thumb to when you have to use a temp var for
 doing stuff
 like that.  I found some function last week that required me to
 make a temp
 var.  (Well maybe it was the version of CF server that forced that.)

 Mark W. Breneman
 -Macromedia Certified ColdFusion Developer
 -Network / Web Server Administrator
   Vivid Media
   [EMAIL PROTECTED]
   www.vividmedia.com
   608.270.9770

 -Original Message-
 From: Chris Kief [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 10, 2003 3:26 PM
 To: CF-Talk
 Subject: RE: Is there a good way to do this?


 Why even create the temp variable??

 cfset QuerySetCell(...)

 chris



 -Original Message-
 From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 10, 2003 1:14 PM
 To: CF-Talk
 Subject: Re: Is there a good way to do this?
 
 You weren't too far off...
 
 cfoutput query=getreg 
   cfloop index=i list=#columnlist#
 cfset temp= QuerySetCell(getreg,i,
 replace(getreg[i][currentrow],',
 '',all),currentrow)
   /cfloop
 /cfoutput
 
 Sorry for the wrap...
 
  I need to replace all single quotes with double single
  quotes in all of the
  fields of a query.  I know that I could do it in a query
  but in this case I
  am opting not to.
 
 
  I have come up with this idea of but I am having a problem
  with the i[x]
  part.  Any ideas?
 
  cfoutput query=getreg 
 cfset x=0 
 cfloop index=i list=#columnlist#
 cfset temp= QuerySetCell(getreg, i, replace(i[x],',
 '',all), x ) 
 cfset x=x+1 
 /cfloop
  /cfoutput
 
 
 
  Mark W. Breneman
  -Macromedia Certified ColdFusion Developer
  -Network / Web Server Administrator
Vivid Media
[EMAIL PROTECTED]
www.vividmedia.com
608.270.9770
 
  ~~
  ~~~|
  Archives:
  http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
  Subscription: http://www.houseoffusion.com/cf_lists/index.
  cfm?method=subscribeforumid=4
  FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
 
  This list and all House of Fusion resources hosted by
  CFHosting.com. The place for dependable ColdFusion
  Hosting.
  http://www.cfhosting.com
 
 Unsubscribe:
 http://www.houseoffusion.com/cf_lists/uns
 ubscribe.cfm?user=633.558.4
 
 
 
 
 s. isaac dealey972-490-6624
 
 new epoch  http://www.turnkey.to
 
 lead architect, tapestry cms   http://products.turnkey.to
 
 tapestry api is opensource http://www.turnkey.to/tapi
 
 certified advanced coldfusion 5 developer
 http://www.macromedia.com/v1/handlers/index.cfm?ID=21816
 
 
 

 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: Is there a good way to do this?

2003-06-10 Thread Mark W. Breneman
That seems too simple. :-)

Did it work that way in CF 3? (The ver I learned cf in) I seem to remember
needing the variable part regardless of what you were doing, just to be
valid syntax.

Mark W. Breneman
-Macromedia Certified ColdFusion Developer
-Network / Web Server Administrator
  Vivid Media
  [EMAIL PROTECTED]
  www.vividmedia.com
  608.270.9770

-Original Message-
From: Mosh Teitelbaum [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 10, 2003 4:19 PM
To: CF-Talk
Subject: RE: Is there a good way to do this?


When using a CFSET tag, you only need the variable part if you want to
capture the result of the function/expression.  So, if you were adding 2
numbers, you'd want to have the variable as in:

CFSET sum = 5 + 2

But if the function directly modifies one of its arguments and you don't
need to use the result of the function later in your code, you can leave out
the variable assignment as in:

CFSET QuerySetCell(...)

--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 942-5378
Fax: (301) 933-3651
Email: [EMAIL PROTECTED]
WWW: http://www.evoch.com/


 -Original Message-
 From: Mark W. Breneman [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 10, 2003 4:50 PM
 To: CF-Talk
 Subject: RE: Is there a good way to do this?


 To be honest, I was not sure if I needed to or not.  I thought
 about it for
 a sec and decided that I was sure it would work with the temp variable.

 Is there a rule of thumb to when you have to use a temp var for
 doing stuff
 like that.  I found some function last week that required me to
 make a temp
 var.  (Well maybe it was the version of CF server that forced that.)

 Mark W. Breneman
 -Macromedia Certified ColdFusion Developer
 -Network / Web Server Administrator
   Vivid Media
   [EMAIL PROTECTED]
   www.vividmedia.com
   608.270.9770

 -Original Message-
 From: Chris Kief [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 10, 2003 3:26 PM
 To: CF-Talk
 Subject: RE: Is there a good way to do this?


 Why even create the temp variable??

 cfset QuerySetCell(...)

 chris



 -Original Message-
 From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 10, 2003 1:14 PM
 To: CF-Talk
 Subject: Re: Is there a good way to do this?
 
 You weren't too far off...
 
 cfoutput query=getreg 
   cfloop index=i list=#columnlist#
 cfset temp= QuerySetCell(getreg,i,
 replace(getreg[i][currentrow],',
 '',all),currentrow)
   /cfloop
 /cfoutput
 
 Sorry for the wrap...
 
  I need to replace all single quotes with double single
  quotes in all of the
  fields of a query.  I know that I could do it in a query
  but in this case I
  am opting not to.
 
 
  I have come up with this idea of but I am having a problem
  with the i[x]
  part.  Any ideas?
 
  cfoutput query=getreg 
 cfset x=0 
 cfloop index=i list=#columnlist#
 cfset temp= QuerySetCell(getreg, i, replace(i[x],',
 '',all), x ) 
 cfset x=x+1 
 /cfloop
  /cfoutput
 
 
 
  Mark W. Breneman
  -Macromedia Certified ColdFusion Developer
  -Network / Web Server Administrator
Vivid Media
[EMAIL PROTECTED]
www.vividmedia.com
608.270.9770
 
  ~~
  ~~~|
  Archives:
  http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
  Subscription: http://www.houseoffusion.com/cf_lists/index.
  cfm?method=subscribeforumid=4
  FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
 
  This list and all House of Fusion resources hosted by
  CFHosting.com. The place for dependable ColdFusion
  Hosting.
  http://www.cfhosting.com
 
 Unsubscribe:
 http://www.houseoffusion.com/cf_lists/uns
 ubscribe.cfm?user=633.558.4
 
 
 
 
 s. isaac dealey972-490-6624
 
 new epoch  http://www.turnkey.to
 
 lead architect, tapestry cms   http://products.turnkey.to
 
 tapestry api is opensource http://www.turnkey.to/tapi
 
 certified advanced coldfusion 5 developer
 http://www.macromedia.com/v1/handlers/index.cfm?ID=21816
 
 
 



~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: Is there a good way to do this?

2003-06-10 Thread Douglas.Knudsen
IIRC, this was new to CF5. 

Doug
-Original Message-
From: Mark W. Breneman [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 10, 2003 5:34 PM
To: CF-Talk
Subject: RE: Is there a good way to do this?


That seems too simple. :-)

Did it work that way in CF 3? (The ver I learned cf in) I seem 
to remember
needing the variable part regardless of what you were doing, 
just to be
valid syntax.

Mark W. Breneman
-Macromedia Certified ColdFusion Developer
-Network / Web Server Administrator
  Vivid Media
  [EMAIL PROTECTED]
  www.vividmedia.com
  608.270.9770

-Original Message-
From: Mosh Teitelbaum [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 10, 2003 4:19 PM
To: CF-Talk
Subject: RE: Is there a good way to do this?


When using a CFSET tag, you only need the variable part if you want to
capture the result of the function/expression.  So, if you 
were adding 2
numbers, you'd want to have the variable as in:

   CFSET sum = 5 + 2

But if the function directly modifies one of its arguments and 
you don't
need to use the result of the function later in your code, you 
can leave out
the variable assignment as in:

   CFSET QuerySetCell(...)

--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 942-5378
Fax: (301) 933-3651
Email: [EMAIL PROTECTED]
WWW: http://www.evoch.com/


 -Original Message-
 From: Mark W. Breneman [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 10, 2003 4:50 PM
 To: CF-Talk
 Subject: RE: Is there a good way to do this?


 To be honest, I was not sure if I needed to or not.  I thought
 about it for
 a sec and decided that I was sure it would work with the 
temp variable.

 Is there a rule of thumb to when you have to use a temp var for
 doing stuff
 like that.  I found some function last week that required me to
 make a temp
 var.  (Well maybe it was the version of CF server that forced that.)

 Mark W. Breneman
 -Macromedia Certified ColdFusion Developer
 -Network / Web Server Administrator
   Vivid Media
   [EMAIL PROTECTED]
   www.vividmedia.com
   608.270.9770

 -Original Message-
 From: Chris Kief [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 10, 2003 3:26 PM
 To: CF-Talk
 Subject: RE: Is there a good way to do this?


 Why even create the temp variable??

 cfset QuerySetCell(...)

 chris



 -Original Message-
 From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 10, 2003 1:14 PM
 To: CF-Talk
 Subject: Re: Is there a good way to do this?
 
 You weren't too far off...
 
 cfoutput query=getreg 
   cfloop index=i list=#columnlist#
 cfset temp= QuerySetCell(getreg,i,
 replace(getreg[i][currentrow],',
 '',all),currentrow)
   /cfloop
 /cfoutput
 
 Sorry for the wrap...
 
  I need to replace all single quotes with double single
  quotes in all of the
  fields of a query.  I know that I could do it in a query
  but in this case I
  am opting not to.
 
 
  I have come up with this idea of but I am having a problem
  with the i[x]
  part.  Any ideas?
 
  cfoutput query=getreg 
cfset x=0 
cfloop index=i list=#columnlist#
cfset temp= QuerySetCell(getreg, i, replace(i[x],',
'',all), x ) 
cfset x=x+1 
/cfloop
  /cfoutput
 
 
 
  Mark W. Breneman
  -Macromedia Certified ColdFusion Developer
  -Network / Web Server Administrator
Vivid Media
[EMAIL PROTECTED]
www.vividmedia.com
608.270.9770
 
  ~~
  ~~~|
  Archives:
  http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
  Subscription: http://www.houseoffusion.com/cf_lists/index.
  cfm?method=subscribeforumid=4
  FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
 
  This list and all House of Fusion resources hosted by
  CFHosting.com. The place for dependable ColdFusion
  Hosting.
  http://www.cfhosting.com
 
Unsubscribe:
 http://www.houseoffusion.com/cf_lists/uns
ubscribe.cfm?user=633.558.4
 
 
 
 
 s. isaac dealey972-490-6624
 
 new epoch  http://www.turnkey.to
 
 lead architect, tapestry cms   http://products.turnkey.to
 
 tapestry api is opensource http://www.turnkey.to/tapi
 
 certified advanced coldfusion 5 developer
 http://www.macromedia.com/v1/handlers/index.cfm?ID=21816
 
 
 




~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Host with the leader in ColdFusion hosting. 
Voted #1 ColdFusion host by CF Developers. 
Offering shared and dedicated hosting options. 
www.cfxhosting.com/default.cfm?redirect=10481

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: Is there a good way to do this?

2003-06-10 Thread S . Isaac Dealey
I tend to salt everything to taste. heh. :)

 Guess it needs to be taken with 4 grains of salt 8^).

 --
 Mosh Teitelbaum
 evoch, LLC
 Tel: (301) 942-5378
 Fax: (301) 933-3651
 Email: [EMAIL PROTECTED]
 WWW: http://www.evoch.com/


 -Original Message-
 From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 10, 2003 4:28 PM
 To: CF-Talk
 Subject: RE: Is there a good way to do this?


  I haven't tried it, so take this with a grain or three
  of
  salt, but 2 things
  stand out:

  1) Start x at 1, not 0, and
  2) You probably have to use the Evaluate() function
  around
  the i[x] bit as
  in:
 replace(Evaluate(getreg.#i#[#x#]),', '',all)

  Again, untested.

 This should work, but is probably not the best way to
 handle it.
 The # around x in this string aren't necessary, in other
 words
 evaluate(getreg.#i#[x]) would also work... x however is
 a
 duplication of the getreg.currentrow variable, so all the
 stuff
 to manipulate x can go away... and you can use array
 notation for
 both dimension of the query which makes the evaluate()
 unnecessary overhead, so getreg[i][currentrow] also
 works.

 hth

 s. isaac dealey972-490-6624

 new epoch  http://www.turnkey.to

 lead architect, tapestry cms   http://products.turnkey.to

 tapestry api is opensource http://www.turnkey.to/tapi

 certified advanced coldfusion 5 developer
 http://www.macromedia.com/v1/handlers/index.cfm?ID=21816



 ~~
 ~~~|
 Archives:
 http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
 Subscription: http://www.houseoffusion.com/cf_lists/index.
 cfm?method=subscribeforumid=4
 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

 Host with the leader in ColdFusion hosting.
 Voted #1 ColdFusion host by CF Developers.
 Offering shared and dedicated hosting options.
 www.cfxhosting.com/default.cfm?redirect=10481

   Unsubscribe: http://www.houseoffusion.com/cf_lists/uns
   ubscribe.cfm?user=633.558.4




s. isaac dealey972-490-6624

new epoch  http://www.turnkey.to

lead architect, tapestry cms   http://products.turnkey.to

tapestry api is opensource http://www.turnkey.to/tapi

certified advanced coldfusion 5 developer
http://www.macromedia.com/v1/handlers/index.cfm?ID=21816


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: Is there a good way to do this?

2003-06-10 Thread Barney Boisvert
I'm pretty sure CF4 had it, because I recall doing
struct(Delete|Insert|Update) calls without a lvalue in the tag, but that
might have been CF4.5.

---
Barney Boisvert, Senior Development Engineer
AudienceCentral (formerly PIER System, Inc.)
[EMAIL PROTECTED]
voice : 360.756.8080 x12
fax   : 360.647.5351

www.audiencecentral.com

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 10, 2003 2:38 PM
 To: CF-Talk
 Subject: RE: Is there a good way to do this?


 IIRC, this was new to CF5.

 Doug
 -Original Message-
 From: Mark W. Breneman [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 10, 2003 5:34 PM
 To: CF-Talk
 Subject: RE: Is there a good way to do this?
 
 
 That seems too simple. :-)
 
 Did it work that way in CF 3? (The ver I learned cf in) I seem
 to remember
 needing the variable part regardless of what you were doing,
 just to be
 valid syntax.
 
 Mark W. Breneman
 -Macromedia Certified ColdFusion Developer
 -Network / Web Server Administrator
   Vivid Media
   [EMAIL PROTECTED]
   www.vividmedia.com
   608.270.9770
 
 -Original Message-
 From: Mosh Teitelbaum [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 10, 2003 4:19 PM
 To: CF-Talk
 Subject: RE: Is there a good way to do this?
 
 
 When using a CFSET tag, you only need the variable part if you want to
 capture the result of the function/expression.  So, if you
 were adding 2
 numbers, you'd want to have the variable as in:
 
  CFSET sum = 5 + 2
 
 But if the function directly modifies one of its arguments and
 you don't
 need to use the result of the function later in your code, you
 can leave out
 the variable assignment as in:
 
  CFSET QuerySetCell(...)
 
 --
 Mosh Teitelbaum
 evoch, LLC
 Tel: (301) 942-5378
 Fax: (301) 933-3651
 Email: [EMAIL PROTECTED]
 WWW: http://www.evoch.com/
 
 
  -Original Message-
  From: Mark W. Breneman [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, June 10, 2003 4:50 PM
  To: CF-Talk
  Subject: RE: Is there a good way to do this?
 
 
  To be honest, I was not sure if I needed to or not.  I thought
  about it for
  a sec and decided that I was sure it would work with the
 temp variable.
 
  Is there a rule of thumb to when you have to use a temp var for
  doing stuff
  like that.  I found some function last week that required me to
  make a temp
  var.  (Well maybe it was the version of CF server that forced that.)
 
  Mark W. Breneman
  -Macromedia Certified ColdFusion Developer
  -Network / Web Server Administrator
Vivid Media
[EMAIL PROTECTED]
www.vividmedia.com
608.270.9770
 
  -Original Message-
  From: Chris Kief [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, June 10, 2003 3:26 PM
  To: CF-Talk
  Subject: RE: Is there a good way to do this?
 
 
  Why even create the temp variable??
 
  cfset QuerySetCell(...)
 
  chris
 
 
 
  -Original Message-
  From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, June 10, 2003 1:14 PM
  To: CF-Talk
  Subject: Re: Is there a good way to do this?
  
  You weren't too far off...
  
  cfoutput query=getreg 
cfloop index=i list=#columnlist#
  cfset temp= QuerySetCell(getreg,i,
  replace(getreg[i][currentrow],',
  '',all),currentrow)
/cfloop
  /cfoutput
  
  Sorry for the wrap...
  
   I need to replace all single quotes with double single
   quotes in all of the
   fields of a query.  I know that I could do it in a query
   but in this case I
   am opting not to.
  
  
   I have come up with this idea of but I am having a problem
   with the i[x]
   part.  Any ideas?
  
   cfoutput query=getreg 
   cfset x=0 
   cfloop index=i list=#columnlist#
   cfset temp= QuerySetCell(getreg, i,
 replace(i[x],',
   '',all), x ) 
   cfset x=x+1 
   /cfloop
   /cfoutput
  
  
  
   Mark W. Breneman
   -Macromedia Certified ColdFusion Developer
   -Network / Web Server Administrator
 Vivid Media
 [EMAIL PROTECTED]
 www.vividmedia.com
 608.270.9770
  
   ~~
   ~~~|
   Archives:
   http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
   Subscription: http://www.houseoffusion.com/cf_lists/index.
   cfm?method=subscribeforumid=4
   FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
  
   This list and all House of Fusion resources hosted by
   CFHosting.com. The place for dependable ColdFusion
   Hosting.
   http://www.cfhosting.com
  
   Unsubscribe:
  http://www.houseoffusion.com/cf_lists/uns
   ubscribe.cfm?user=633.558.4
  
  
  
  
  s. isaac dealey972-490-6624
  
  new epoch  http://www.turnkey.to
  
  lead architect, tapestry cms   http://products.turnkey.to
  
  tapestry api is opensource http://www.turnkey.to/tapi
  
  certified advanced coldfusion 5 developer
  http://www.macromedia.com/v1/handlers

Is there a Better Way to do this?

2002-12-19 Thread Kelly Matthews
Ok here is what i am doing and I am just trying to find out if 1. there is a 
better way and 2. if it can be done on the SQL side (as a stored proc) 
instaed of the CF side. Just not all that familiar with looping outside of 
CF.

ANyway I have one table that is a dictionary with about 1500 words. THen I 
have another table that has dreams people have entered. THe idea is to take 
the list of words and see if any of them show up in the dream and then 
display those words to the user. What I built works and it's actually pretty 
speedy, but the dictionary is very small right now and it may be closer to 
1 by the time we are done which is a MUCH larger list of words to loop 
through.

So right now I am doing a query to get the words
CFQUERY name=wordS
SELECT word
from dictionary
/CFQUERY

THen we grab a dream
CFQUERY name=dream
SELECT dream
from dreams
where dream_id = 3
/CFQUERY

Then I Loop through like so:
CFLOOP list=#valuelist(words.word)# delimiters=, index=theword
Then I check to see if the dream contains the word.
CFIF dream.dream contains  #theword#  OR dream.dream contains  
#theword#s
Then I grab the definition if it found that word.
CFQUERY name=getdef
SELECT definition from dictionary
where word = '#theword#'
/CFQUERY
Then I display it #theword#BR#getdef.definition#P
/CFIF
/CFLOOP

This words fine and with a dream thats a few thousand words it completes in 
a few seconds.  I just wonder if there is a faster or better way to do this 
so down the road we don't run into problems as the word list grows. 
THoughts?




~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm



RE: Is there a Better Way to do this?

2002-12-19 Thread Ben Doom
I'm not a SQL wizard and am doing this off the top of my head, but I'd try
something along the lines of

select word from dictionary where
(select dream from dreams where dream_id = #dreamid#)
like ('%' + word + '%')

But, again, that's off the top of my head.



  --Ben Doom
Programmer  General Lackey
Moonbow Software

: -Original Message-
: From: Kelly Matthews [mailto:[EMAIL PROTECTED]]
: Sent: Thursday, December 19, 2002 11:38 AM
: To: CF-Talk
: Subject: Is there a Better Way to do this?
:
:
: Ok here is what i am doing and I am just trying to find out if 1.
: there is a
: better way and 2. if it can be done on the SQL side (as a stored proc)
: instaed of the CF side. Just not all that familiar with looping
: outside of
: CF.
:
: ANyway I have one table that is a dictionary with about 1500
: words. THen I
: have another table that has dreams people have entered. THe idea
: is to take
: the list of words and see if any of them show up in the dream and then
: display those words to the user. What I built works and it's
: actually pretty
: speedy, but the dictionary is very small right now and it may be
: closer to
: 1 by the time we are done which is a MUCH larger list of
: words to loop
: through.
:
: So right now I am doing a query to get the words
: CFQUERY name=wordS
: SELECT word
: from dictionary
: /CFQUERY
:
: THen we grab a dream
: CFQUERY name=dream
: SELECT dream
: from dreams
: where dream_id = 3
: /CFQUERY
:
: Then I Loop through like so:
: CFLOOP list=#valuelist(words.word)# delimiters=, index=theword
: Then I check to see if the dream contains the word.
: CFIF dream.dream contains  #theword#  OR dream.dream contains 
: #theword#s
: Then I grab the definition if it found that word.
: CFQUERY name=getdef
: SELECT definition from dictionary
: where word = '#theword#'
: /CFQUERY
: Then I display it #theword#BR#getdef.definition#P
: /CFIF
: /CFLOOP
:
: This words fine and with a dream thats a few thousand words it
: completes in
: a few seconds.  I just wonder if there is a faster or better way
: to do this
: so down the road we don't run into problems as the word list grows.
: THoughts?
:
:
:
:
: 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm



RE: Is there a Better Way to do this?

2002-12-19 Thread Tony Weeg
select word from dictionary where
(select dream from dreams where dream_id = #dreamid#)
like '%#word#%')

can be done like this, without the () around the %#word#%
part

..tony

Tony Weeg
Senior Web Developer
UnCertified Advanced ColdFusion Developer
Information System Design
Navtrak, Inc.
Mobile workforce monitoring, mapping  reporting
www.navtrak.net
410.548.2337 

-Original Message-
From: Ben Doom [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 19, 2002 12:06 PM
To: CF-Talk
Subject: RE: Is there a Better Way to do this?


I'm not a SQL wizard and am doing this off the top of my head, but I'd
try
something along the lines of

select word from dictionary where
(select dream from dreams where dream_id = #dreamid#)
like ('%' + word + '%')

But, again, that's off the top of my head.



  --Ben Doom
Programmer  General Lackey
Moonbow Software

: -Original Message-
: From: Kelly Matthews [mailto:[EMAIL PROTECTED]]
: Sent: Thursday, December 19, 2002 11:38 AM
: To: CF-Talk
: Subject: Is there a Better Way to do this?
:
:
: Ok here is what i am doing and I am just trying to find out if 1.
: there is a
: better way and 2. if it can be done on the SQL side (as a stored proc)
: instaed of the CF side. Just not all that familiar with looping
: outside of
: CF.
:
: ANyway I have one table that is a dictionary with about 1500
: words. THen I
: have another table that has dreams people have entered. THe idea
: is to take
: the list of words and see if any of them show up in the dream and then
: display those words to the user. What I built works and it's
: actually pretty
: speedy, but the dictionary is very small right now and it may be
: closer to
: 1 by the time we are done which is a MUCH larger list of
: words to loop
: through.
:
: So right now I am doing a query to get the words
: CFQUERY name=wordS
: SELECT word
: from dictionary
: /CFQUERY
:
: THen we grab a dream
: CFQUERY name=dream
: SELECT dream
: from dreams
: where dream_id = 3
: /CFQUERY
:
: Then I Loop through like so:
: CFLOOP list=#valuelist(words.word)# delimiters=, index=theword
: Then I check to see if the dream contains the word.
: CFIF dream.dream contains  #theword#  OR dream.dream contains 
: #theword#s
: Then I grab the definition if it found that word.
: CFQUERY name=getdef
: SELECT definition from dictionary
: where word = '#theword#'
: /CFQUERY
: Then I display it #theword#BR#getdef.definition#P
: /CFIF
: /CFLOOP
:
: This words fine and with a dream thats a few thousand words it
: completes in
: a few seconds.  I just wonder if there is a faster or better way
: to do this
: so down the road we don't run into problems as the word list grows.
: THoughts?
:
:
:
:
: 

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.



RE: Is there a Better Way to do this?

2002-12-19 Thread Tony Weeg
typo, without the ) at the very end.

..tony

Tony Weeg
Senior Web Developer
UnCertified Advanced ColdFusion Developer
Information System Design
Navtrak, Inc.
Mobile workforce monitoring, mapping  reporting
www.navtrak.net
410.548.2337 

-Original Message-
From: Tony Weeg [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 19, 2002 12:10 PM
To: CF-Talk
Subject: RE: Is there a Better Way to do this?


select word from dictionary where
(select dream from dreams where dream_id = #dreamid#)
like '%#word#%')

can be done like this, without the () around the %#word#%
part

.tony

Tony Weeg
Senior Web Developer
UnCertified Advanced ColdFusion Developer
Information System Design
Navtrak, Inc.
Mobile workforce monitoring, mapping  reporting
www.navtrak.net
410.548.2337 

-Original Message-
From: Ben Doom [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 19, 2002 12:06 PM
To: CF-Talk
Subject: RE: Is there a Better Way to do this?


I'm not a SQL wizard and am doing this off the top of my head, but I'd
try
something along the lines of

select word from dictionary where
(select dream from dreams where dream_id = #dreamid#)
like ('%' + word + '%')

But, again, that's off the top of my head.



  --Ben Doom
Programmer  General Lackey
Moonbow Software

: -Original Message-
: From: Kelly Matthews [mailto:[EMAIL PROTECTED]]
: Sent: Thursday, December 19, 2002 11:38 AM
: To: CF-Talk
: Subject: Is there a Better Way to do this?
:
:
: Ok here is what i am doing and I am just trying to find out if 1.
: there is a
: better way and 2. if it can be done on the SQL side (as a stored proc)
: instaed of the CF side. Just not all that familiar with looping
: outside of
: CF.
:
: ANyway I have one table that is a dictionary with about 1500
: words. THen I
: have another table that has dreams people have entered. THe idea
: is to take
: the list of words and see if any of them show up in the dream and then
: display those words to the user. What I built works and it's
: actually pretty
: speedy, but the dictionary is very small right now and it may be
: closer to
: 1 by the time we are done which is a MUCH larger list of
: words to loop
: through.
:
: So right now I am doing a query to get the words
: CFQUERY name=wordS
: SELECT word
: from dictionary
: /CFQUERY
:
: THen we grab a dream
: CFQUERY name=dream
: SELECT dream
: from dreams
: where dream_id = 3
: /CFQUERY
:
: Then I Loop through like so:
: CFLOOP list=#valuelist(words.word)# delimiters=, index=theword
: Then I check to see if the dream contains the word.
: CFIF dream.dream contains  #theword#  OR dream.dream contains 
: #theword#s
: Then I grab the definition if it found that word.
: CFQUERY name=getdef
: SELECT definition from dictionary
: where word = '#theword#'
: /CFQUERY
: Then I display it #theword#BR#getdef.definition#P
: /CFIF
: /CFLOOP
:
: This words fine and with a dream thats a few thousand words it
: completes in
: a few seconds.  I just wonder if there is a faster or better way
: to do this
: so down the road we don't run into problems as the word list grows.
: THoughts?
:
:
:
:
: 


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.



RE: Is there a Better Way to do this?

2002-12-19 Thread S . Isaac Dealey
I did this for an FAQ not long ago... something like this worked for me

select dictionary.word
from dictionary
inner join dreams on
dreams.dream like '%' + dictionary.word + '%'
order by dictionary.word

In the case of my faq the user was entering another question and the text of
the question was compared against the dictionary and then again compared to
other questions, so if you've got someone entering a new dream, you could
put this in a stored procedure like

CREATE PROCEDURE sp_DreamNewLookup
@txt_dream nvarchar(8000)
AS
select dictionary.word, dreams.dream from dictionary
inner join dreams on dreams.dream like '%' + dictionary.word + '%'
where @txt_dream like '%' + dictionary.word + '%'
order by dictionary.word
GO


hth


s. isaac dealey954-776-0046

new epoch  http://www.turnkey.to

lead architect, tapestry cms   http://products.turnkey.to

certified advanced coldfusion 5 developer
http://www.macromedia.com/v1/handlers/index.cfm?ID=21816



 I'm not a SQL wizard and am doing this off the top of my
 head, but I'd try
 something along the lines of

 select word from dictionary where
 (select dream from dreams where dream_id = #dreamid#)
 like ('%' + word + '%')

 But, again, that's off the top of my head.



   --Ben Doom
 Programmer  General Lackey
 Moonbow Software

 : -Original Message-
 : From: Kelly Matthews [mailto:[EMAIL PROTECTED]]
 : Sent: Thursday, December 19, 2002 11:38 AM
 : To: CF-Talk
 : Subject: Is there a Better Way to do this?
 :
 :
 : Ok here is what i am doing and I am just trying to find
 out if 1.
 : there is a
 : better way and 2. if it can be done on the SQL side (as
 a stored proc)
 : instaed of the CF side. Just not all that familiar with
 looping
 : outside of
 : CF.
 :
 : ANyway I have one table that is a dictionary with about
 1500
 : words. THen I
 : have another table that has dreams people have entered.
 THe idea
 : is to take
 : the list of words and see if any of them show up in the
 dream and then
 : display those words to the user. What I built works and
 it's
 : actually pretty
 : speedy, but the dictionary is very small right now and
 it may be
 : closer to
 : 1 by the time we are done which is a MUCH larger
 list of
 : words to loop
 : through.
 :
 : So right now I am doing a query to get the words
 : CFQUERY name=wordS
 : SELECT word
 : from dictionary
 : /CFQUERY
 :
 : THen we grab a dream
 : CFQUERY name=dream
 : SELECT dream
 : from dreams
 : where dream_id = 3
 : /CFQUERY
 :
 : Then I Loop through like so:
 : CFLOOP list=#valuelist(words.word)# delimiters=,
 index=theword
 : Then I check to see if the dream contains the word.
 : CFIF dream.dream contains  #theword#  OR dream.dream
 contains 
 : #theword#s
 : Then I grab the definition if it found that word.
 : CFQUERY name=getdef
 : SELECT definition from dictionary
 : where word = '#theword#'
 : /CFQUERY
 : Then I display it #theword#BR#getdef.definition#P
 : /CFIF
 : /CFLOOP
 :
 : This words fine and with a dream thats a few thousand
 words it
 : completes in
 : a few seconds.  I just wonder if there is a faster or
 better way
 : to do this
 : so down the road we don't run into problems as the word
 list grows.
 : THoughts?
 :
 :
 :
 :
 :
 ~~
 ~~~|
 Archives:
 http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
 Subscription: http://www.houseoffusion.com/cf_lists/index.
 cfm?method=subscribeforumid=4
 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
 Structure your ColdFusion code with Fusebox. Get the
 official book at http://www.fusionauthority.com/bkinfo.cfm



~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com



RE: Is there a Better Way to do this?

2002-12-19 Thread Ben Doom
If you pound the word like that, won't you get whatever is stored in a cf
variable named 'word' instead of the contents of the word column from the
outer select?  Or am I missing something?



  --Ben Doom
Programmer  General Lackey
Moonbow Software

: -Original Message-
: From: Tony Weeg [mailto:[EMAIL PROTECTED]]
: Sent: Thursday, December 19, 2002 12:10 PM
: To: CF-Talk
: Subject: RE: Is there a Better Way to do this?
:
:
: select word from dictionary where
: (select dream from dreams where dream_id = #dreamid#)
: like '%#word#%')
:
: can be done like this, without the () around the %#word#%
: part
:
: ..tony
:
: Tony Weeg
: Senior Web Developer
: UnCertified Advanced ColdFusion Developer
: Information System Design
: Navtrak, Inc.
: Mobile workforce monitoring, mapping  reporting
: www.navtrak.net
: 410.548.2337
:
: -Original Message-
: From: Ben Doom [mailto:[EMAIL PROTECTED]]
: Sent: Thursday, December 19, 2002 12:06 PM
: To: CF-Talk
: Subject: RE: Is there a Better Way to do this?
:
:
: I'm not a SQL wizard and am doing this off the top of my head, but I'd
: try
: something along the lines of
:
: select word from dictionary where
: (select dream from dreams where dream_id = #dreamid#)
: like ('%' + word + '%')
:
: But, again, that's off the top of my head.
:
:
:
:   --Ben Doom
: Programmer  General Lackey
: Moonbow Software
:
: : -Original Message-
: : From: Kelly Matthews [mailto:[EMAIL PROTECTED]]
: : Sent: Thursday, December 19, 2002 11:38 AM
: : To: CF-Talk
: : Subject: Is there a Better Way to do this?
: :
: :
: : Ok here is what i am doing and I am just trying to find out if 1.
: : there is a
: : better way and 2. if it can be done on the SQL side (as a stored proc)
: : instaed of the CF side. Just not all that familiar with looping
: : outside of
: : CF.
: :
: : ANyway I have one table that is a dictionary with about 1500
: : words. THen I
: : have another table that has dreams people have entered. THe idea
: : is to take
: : the list of words and see if any of them show up in the dream and then
: : display those words to the user. What I built works and it's
: : actually pretty
: : speedy, but the dictionary is very small right now and it may be
: : closer to
: : 1 by the time we are done which is a MUCH larger list of
: : words to loop
: : through.
: :
: : So right now I am doing a query to get the words
: : CFQUERY name=wordS
: : SELECT word
: : from dictionary
: : /CFQUERY
: :
: : THen we grab a dream
: : CFQUERY name=dream
: : SELECT dream
: : from dreams
: : where dream_id = 3
: : /CFQUERY
: :
: : Then I Loop through like so:
: : CFLOOP list=#valuelist(words.word)# delimiters=, index=theword
: : Then I check to see if the dream contains the word.
: : CFIF dream.dream contains  #theword#  OR dream.dream contains 
: : #theword#s
: : Then I grab the definition if it found that word.
: : CFQUERY name=getdef
: : SELECT definition from dictionary
: : where word = '#theword#'
: : /CFQUERY
: : Then I display it #theword#BR#getdef.definition#P
: : /CFIF
: : /CFLOOP
: :
: : This words fine and with a dream thats a few thousand words it
: : completes in
: : a few seconds.  I just wonder if there is a faster or better way
: : to do this
: : so down the road we don't run into problems as the word list grows.
: : THoughts?
: :
: :
: :
: :
: :
:
: 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm



RE: Is there a Better Way to do this?

2002-12-19 Thread Ben Doom
Aye, that's what I was trying to think of.  Too much blood in my caffiene
stream this morning.



  --Ben Doom
Programmer  General Lackey
Moonbow Software

: -Original Message-
: From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]]
: Sent: Thursday, December 19, 2002 12:28 PM
: To: CF-Talk
: Subject: RE: Is there a Better Way to do this?
:
:
: I did this for an FAQ not long ago... something like this worked for me
:
: select dictionary.word
: from dictionary
: inner join dreams on
: dreams.dream like '%' + dictionary.word + '%'
: order by dictionary.word
:
: In the case of my faq the user was entering another question and
: the text of
: the question was compared against the dictionary and then again
: compared to
: other questions, so if you've got someone entering a new dream, you could
: put this in a stored procedure like
:
: CREATE PROCEDURE sp_DreamNewLookup
:   @txt_dream nvarchar(8000)
: AS
:   select dictionary.word, dreams.dream from dictionary
:   inner join dreams on dreams.dream like '%' + dictionary.word + '%'
:   where @txt_dream like '%' + dictionary.word + '%'
:   order by dictionary.word
: GO
:
:
: hth
:
:
: s. isaac dealey954-776-0046
:
: new epoch  http://www.turnkey.to
:
: lead architect, tapestry cms   http://products.turnkey.to
:
: certified advanced coldfusion 5 developer
: http://www.macromedia.com/v1/handlers/index.cfm?ID=21816
:
:
:
:  I'm not a SQL wizard and am doing this off the top of my
:  head, but I'd try
:  something along the lines of
:
:  select word from dictionary where
:  (select dream from dreams where dream_id = #dreamid#)
:  like ('%' + word + '%')
:
:  But, again, that's off the top of my head.
:
:
:
:--Ben Doom
:  Programmer  General Lackey
:  Moonbow Software
:
:  : -Original Message-
:  : From: Kelly Matthews [mailto:[EMAIL PROTECTED]]
:  : Sent: Thursday, December 19, 2002 11:38 AM
:  : To: CF-Talk
:  : Subject: Is there a Better Way to do this?
:  :
:  :
:  : Ok here is what i am doing and I am just trying to find
:  out if 1.
:  : there is a
:  : better way and 2. if it can be done on the SQL side (as
:  a stored proc)
:  : instaed of the CF side. Just not all that familiar with
:  looping
:  : outside of
:  : CF.
:  :
:  : ANyway I have one table that is a dictionary with about
:  1500
:  : words. THen I
:  : have another table that has dreams people have entered.
:  THe idea
:  : is to take
:  : the list of words and see if any of them show up in the
:  dream and then
:  : display those words to the user. What I built works and
:  it's
:  : actually pretty
:  : speedy, but the dictionary is very small right now and
:  it may be
:  : closer to
:  : 1 by the time we are done which is a MUCH larger
:  list of
:  : words to loop
:  : through.
:  :
:  : So right now I am doing a query to get the words
:  : CFQUERY name=wordS
:  : SELECT word
:  : from dictionary
:  : /CFQUERY
:  :
:  : THen we grab a dream
:  : CFQUERY name=dream
:  : SELECT dream
:  : from dreams
:  : where dream_id = 3
:  : /CFQUERY
:  :
:  : Then I Loop through like so:
:  : CFLOOP list=#valuelist(words.word)# delimiters=,
:  index=theword
:  : Then I check to see if the dream contains the word.
:  : CFIF dream.dream contains  #theword#  OR dream.dream
:  contains 
:  : #theword#s
:  : Then I grab the definition if it found that word.
:  : CFQUERY name=getdef
:  : SELECT definition from dictionary
:  : where word = '#theword#'
:  : /CFQUERY
:  : Then I display it #theword#BR#getdef.definition#P
:  : /CFIF
:  : /CFLOOP
:  :
:  : This words fine and with a dream thats a few thousand
:  words it
:  : completes in
:  : a few seconds.  I just wonder if there is a faster or
:  better way
:  : to do this
:  : so down the road we don't run into problems as the word
:  list grows.
:  : THoughts?
:  :
:  :
:  :
:  :
:  :
:  ~~
:  ~~~|
:  Archives:
:  http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
:  Subscription: http://www.houseoffusion.com/cf_lists/index.
:  cfm?method=subscribeforumid=4
:  FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
:  Structure your ColdFusion code with Fusebox. Get the
:  official book at http://www.fusionauthority.com/bkinfo.cfm
:
:
:
: 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm



Re: Is there a Better Way to do this?

2002-12-19 Thread Stephen Moretti
 I'm not a SQL wizard and am doing this off the top of my head, but I'd try
 something along the lines of

 select word from dictionary where
 (select dream from dreams where dream_id = #dreamid#)
 like ('%' + word + '%')

 But, again, that's off the top of my head.


What you mean is :

SELECT dictionary.word, dictionary.definition
FROM dictionary LEFT JOIN dream
ON dreams.dream LIKE '%' + dictionary.word + '%'

Which is what Isaac's got in his stored proc... ;o)

Regards

Stephen


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.



RE: Is there a Better Way to do this?

2002-12-19 Thread S . Isaac Dealey
Nasty thing that blood... I say who needs it. ;)

 Aye, that's what I was trying to think of.  Too much blood
 in my caffiene stream this morning.



   --Ben Doom
 Programmer  General Lackey
 Moonbow Software

 : -Original Message-
 : From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]]
 : Sent: Thursday, December 19, 2002 12:28 PM
 : To: CF-Talk
 : Subject: RE: Is there a Better Way to do this?
 :
 :
 : I did this for an FAQ not long ago... something like
 this worked for me
 :
 : select dictionary.word
 : from dictionary
 : inner join dreams on
 : dreams.dream like '%' + dictionary.word + '%'
 : order by dictionary.word
 :
 : In the case of my faq the user was entering another
 question and
 : the text of
 : the question was compared against the dictionary and
 then again
 : compared to
 : other questions, so if you've got someone entering a new
 dream, you could
 : put this in a stored procedure like
 :
 : CREATE PROCEDURE sp_DreamNewLookup
 : @txt_dream nvarchar(8000)
 : AS
 : select dictionary.word, dreams.dream from dictionary
 : inner join dreams on dreams.dream like '%' +
 dictionary.word + '%'
 : where @txt_dream like '%' + dictionary.word + '%'
 : order by dictionary.word
 : GO
 :
 :
 : hth
 :
 :
 : s. isaac dealey954-776-0046
 :
 : new epoch  http://www.turnkey.to
 :
 : lead architect, tapestry cms
 http://products.turnkey.to
 :
 : certified advanced coldfusion 5 developer
 : http://www.macromedia.com/v1/handlers/index.cfm?ID=21816
 :
 :
 :
 :  I'm not a SQL wizard and am doing this off the top of
 my
 :  head, but I'd try
 :  something along the lines of
 :
 :  select word from dictionary where
 :  (select dream from dreams where dream_id = #dreamid#)
 :  like ('%' + word + '%')
 :
 :  But, again, that's off the top of my head.
 :
 :
 :
 :--Ben Doom
 :  Programmer  General Lackey
 :  Moonbow Software
 :
 :  : -Original Message-
 :  : From: Kelly Matthews
 [mailto:[EMAIL PROTECTED]]
 :  : Sent: Thursday, December 19, 2002 11:38 AM
 :  : To: CF-Talk
 :  : Subject: Is there a Better Way to do this?
 :  :
 :  :
 :  : Ok here is what i am doing and I am just trying to
 find
 :  out if 1.
 :  : there is a
 :  : better way and 2. if it can be done on the SQL side
 (as
 :  a stored proc)
 :  : instaed of the CF side. Just not all that familiar
 with
 :  looping
 :  : outside of
 :  : CF.
 :  :
 :  : ANyway I have one table that is a dictionary with
 about
 :  1500
 :  : words. THen I
 :  : have another table that has dreams people have
 entered.
 :  THe idea
 :  : is to take
 :  : the list of words and see if any of them show up in
 the
 :  dream and then
 :  : display those words to the user. What I built works
 and
 :  it's
 :  : actually pretty
 :  : speedy, but the dictionary is very small right now
 and
 :  it may be
 :  : closer to
 :  : 1 by the time we are done which is a MUCH larger
 :  list of
 :  : words to loop
 :  : through.
 :  :
 :  : So right now I am doing a query to get the words
 :  : CFQUERY name=wordS
 :  : SELECT word
 :  : from dictionary
 :  : /CFQUERY
 :  :
 :  : THen we grab a dream
 :  : CFQUERY name=dream
 :  : SELECT dream
 :  : from dreams
 :  : where dream_id = 3
 :  : /CFQUERY
 :  :
 :  : Then I Loop through like so:
 :  : CFLOOP list=#valuelist(words.word)#
 delimiters=,
 :  index=theword
 :  : Then I check to see if the dream contains the word.
 :  : CFIF dream.dream contains  #theword#  OR
 dream.dream
 :  contains 
 :  : #theword#s
 :  : Then I grab the definition if it found that word.
 :  : CFQUERY name=getdef
 :  : SELECT definition from dictionary
 :  : where word = '#theword#'
 :  : /CFQUERY
 :  : Then I display it
 #theword#BR#getdef.definition#P
 :  : /CFIF
 :  : /CFLOOP
 :  :
 :  : This words fine and with a dream thats a few
 thousand
 :  words it
 :  : completes in
 :  : a few seconds.  I just wonder if there is a faster
 or
 :  better way
 :  : to do this
 :  : so down the road we don't run into problems as the
 word
 :  list grows.
 :  : THoughts?
 :  :
 :  :
 :  :
 :  :
 :  :
 : 
 ~~
 :  ~~~|
 :  Archives:
 : 
 http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
 :  Subscription:
 http://www.houseoffusion.com/cf_lists/index.
 :  cfm?method=subscribeforumid=4
 :  FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
 :  Structure your ColdFusion code with Fusebox. Get the
 :  official book at
 http://www.fusionauthority.com/bkinfo.cfm
 :
 :
 :
 :
 ~~
 ~~~|
 Archives:
 http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
 Subscription: http://www.houseoffusion.com/cf_lists/index.
 cfm?method=subscribeforumid=4
 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
 Your ad could be here. Monies from ads go to support these
 lists and provide more resources for the community.
 http://www.fusionauthority.com/ads.cfm


s. isaac dealey

Re: Is there a Better Way to do this?

2002-12-19 Thread S . Isaac Dealey
 I'm not a SQL wizard and am doing this off the top of my
 head, but I'd try
 something along the lines of

 select word from dictionary where
 (select dream from dreams where dream_id = #dreamid#)
 like ('%' + word + '%')

 But, again, that's off the top of my head.


 What you mean is :

 SELECT dictionary.word, dictionary.definition
 FROM dictionary LEFT JOIN dream
 ON dreams.dream LIKE '%' + dictionary.word + '%'

 Which is what Isaac's got in his stored proc... ;o)

Accept that if you left join dream, you'll get every word from the
dictionary -- I was under the impression ( possibly mistaken ) he was
looking for only words appearing in the dream text ...

s. isaac dealey954-776-0046

new epoch  http://www.turnkey.to

lead architect, tapestry cms   http://products.turnkey.to

certified advanced coldfusion 5 developer
http://www.macromedia.com/v1/handlers/index.cfm?ID=21816


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm



Re: Is there a Better Way to do this?

2002-12-19 Thread Stephen Moretti
 
 Accept that if you left join dream, you'll get every word from the
 dictionary -- I was under the impression ( possibly mistaken ) he was
 looking for only words appearing in the dream text ...
 

~sigh~ Right! that does it  You are of course correct 

Too much darkness outside now... Time for me to quit and go home

Stephen

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm



Re: Is there a Better Way to do this?

2002-12-19 Thread Kelly Matthews
No you were correct I only want to pull the dictionary words that were found 
in the dream. The code you gave me worked great the only issue i see now for 
example let's say the word is FEEL then it pulls EEL out of the dictionary.  
IS there a way to avoid that?

  I'm not a SQL wizard and am doing this off the top of my
  head, but I'd try
  something along the lines of
 
  select word from dictionary where
  (select dream from dreams where dream_id = #dreamid#)
  like ('%' + word + '%')
 
  But, again, that's off the top of my head.
 

  What you mean is :

  SELECT dictionary.word, dictionary.definition
  FROM dictionary LEFT JOIN dream
  ON dreams.dream LIKE '%' + dictionary.word + '%'

  Which is what Isaac's got in his stored proc... ;o)

Accept that if you left join dream, you'll get every word from the
dictionary -- I was under the impression ( possibly mistaken ) he was
looking for only words appearing in the dream text ...

s. isaac dealey954-776-0046

new epoch  http://www.turnkey.to

lead architect, tapestry cms   http://products.turnkey.to

certified advanced coldfusion 5 developer
http://www.macromedia.com/v1/handlers/index.cfm?ID=21816



~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm



RE: Is there a Better Way to do this?

2002-12-19 Thread webguy
Quick guess, change

like ('%' + word + '%')

to

like (word)
??/

WG

 -Original Message-
 From: Kelly Matthews [mailto:[EMAIL PROTECTED]]
 Sent: 19 December 2002 17:52
 To: CF-Talk
 Subject: Re: Is there a Better Way to do this?


 No you were correct I only want to pull the dictionary words that
 were found
 in the dream. The code you gave me worked great the only issue i
 see now for
 example let's say the word is FEEL then it pulls EEL out of the
 dictionary.
 IS there a way to avoid that?

   I'm not a SQL wizard and am doing this off the top of my
   head, but I'd try
   something along the lines of
  
   select word from dictionary where
   (select dream from dreams where dream_id = #dreamid#)
   like ('%' + word + '%')
  
   But, again, that's off the top of my head.
  
 
   What you mean is :
 
   SELECT dictionary.word, dictionary.definition
   FROM dictionary LEFT JOIN dream
   ON dreams.dream LIKE '%' + dictionary.word + '%'
 
   Which is what Isaac's got in his stored proc... ;o)
 
 Accept that if you left join dream, you'll get every word from the
 dictionary -- I was under the impression ( possibly mistaken ) he was
 looking for only words appearing in the dream text ...
 
 s. isaac dealey954-776-0046
 
 new epoch  http://www.turnkey.to
 
 lead architect, tapestry cms   http://products.turnkey.to
 
 certified advanced coldfusion 5 developer
 http://www.macromedia.com/v1/handlers/index.cfm?ID=21816
 
 
 
 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm



  1   2   >