Is it possible to do a query output loop in cfscript using something
other than WriteOutput?
--
Scott Stewart
ColdFusion Developer
Office of Research Information Systems
Research amp; Economic Development
University of North Carolina at Chapel Hill
Phone:(919)843-2408
Fax: (919)962-3600
On Tue, Aug 26, 2008 at 10:45 AM, Scott Stewart [EMAIL PROTECTED]wrote:
Is it possible to do a query output loop in cfscript using something
other than WriteOutput?
obvious question is... why? :)
for (i=1; i lt queryname.recordcount; i=i+1) { // you can pretty that up a
bit if you're on CF8
@houseoffusion.com
Sent: Tuesday, August 26, 2008 12:45 PM
Subject: cfscript question
Is it possible to do a query output loop in cfscript using something
other than WriteOutput?
~|
Adobe® ColdFusion® 8 software 8 is the most important
trying to make sense out of some screwy logic that someone else did
although I'm about ready to rewrite it with tags...
Charlie Griefer wrote:
On Tue, Aug 26, 2008 at 10:45 AM, Scott Stewart [EMAIL PROTECTED]wrote:
Is it possible to do a query output loop in cfscript using something
- Original Message -
From: Scott Stewart [EMAIL PROTECTED]
To: CF-Talk cf-talk@houseoffusion.com
Sent: Tuesday, August 26, 2008 12:45 PM
Subject: cfscript question
Is it possible to do a query output loop in cfscript using something
other than WriteOutput
Is it possible to do a query output loop in cfscript using
something other than WriteOutput?
The only way to write any output directly from CFSCRIPT is to use
WriteOutput. You can, of course, invoke functions written in CFML from
CFSCRIPT.
Dave Watts, CTO, Fig Leaf Software
lemme rephrase...
I'm trying to populate a function call, by looping over the record count
of a query
to end up with something like this:
function(sunday_0, mon_0, tues_0)
function(sunday_1, monday_1, tues_1)
etc.
the number is dynamic based on the record count of a query..
code:
yea but...function calls shouldn't have dynamic number of arguments.
perhaps u mean to create a list of arguments and pass it in as 1 argument?
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
yea but...function calls shouldn't have dynamic number of arguments.
Why not?
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern
I'm trying to populate a function call, by looping over the
record count of a query
What you have looks fine to me. What's the problem, exactly?
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our
:51
To: CF-Talk
Subject: RE: CFSCRIPT Question
I was under the impression that there was a performance gain
with cfscript, is that not the case? Is there no benefit to
using cfscript?
I haven't been able to determine any significant performance change one way
or the other with CFMX. There may
I was under the impression that there was a performance gain with cfscript,
is that not the case? Is there no benefit to using cfscript?
-Original Message-
From: Aaron Rouse [mailto:[EMAIL PROTECTED]
Sent: 30 December 2005 19:03
To: CF-Talk
Subject: Re: CFSCRIPT Question
Probably
the impression that there was a performance gain with cfscript,
is that not the case? Is there no benefit to using cfscript?
-Original Message-
From: Aaron Rouse [mailto:[EMAIL PROTECTED]
Sent: 30 December 2005 19:03
To: CF-Talk
Subject: Re: CFSCRIPT Question
Probably not, could be debated
?
-Original Message-
From: Aaron Rouse [mailto:[EMAIL PROTECTED]
Sent: 30 December 2005 19:03
To: CF-Talk
Subject: Re: CFSCRIPT Question
Probably not, could be debated that it was on older
versions of CF. I
personally am a cfscript nazi, use it a lot more than I
really should.
On 12/30
, Three Ravens Consulting
[mailto:[EMAIL PROTECTED]
Sent: Monday, January 02, 2006 1:07 PM
To: CF-Talk
Subject: Re: CFSCRIPT Question
I am not aware of any benefit other than personal
preference...
Eric
On Mon, 2 Jan 2006 11:38:27 -
Andy McShane [EMAIL PROTECTED] wrote:
I was under
I was under the impression that there was a performance gain
with cfscript, is that not the case? Is there no benefit to
using cfscript?
I haven't been able to determine any significant performance change one way
or the other with CFMX. There may have been performance differences in prior
I have a large block of cfscript that I now have to add a stored procedure call
into the middle of. I normally use cfstoredproc elsewhere but how do I call a
stored procedure from within cfscript?
~|
Logware (www.logware.us):
how do I call a stored procedure from within cfscript?
Wrap it in a cffunction tag and call it as a function.
Paul
~|
Find out how CFTicket can increase your company's customer support
efficiency by 100%
I was sure I read that tags were allowed inside cfscript blocks somewhere,
but it doesn't appear to work.
-Original Message-
From: Andy Mcshane [mailto:[EMAIL PROTECTED]
Sent: 30 December 2005 10:46
To: CF-Talk
Subject: CFSCRIPT Question
I have a large block of cfscript that I now have
how do I call a stored procedure from within cfscript?
Wrap it in a cffunction tag and call it as a function.
Paul
Now I feel stupid, knew it would be something simple! Thanks.
~|
Logware (www.logware.us): a new and
Sounds like you are using cfscript unnecessarily.
-Adam
On 12/30/05, Andy Mcshane [EMAIL PROTECTED] wrote:
how do I call a stored procedure from within cfscript?
Wrap it in a cffunction tag and call it as a function.
Paul
Now I feel stupid, knew it would be something simple! Thanks.
Is it ever actually necessary? :-)
--Ben
Adrocknaphobia wrote:
Sounds like you are using cfscript unnecessarily.
-Adam
On 12/30/05, Andy Mcshane [EMAIL PROTECTED] wrote:
how do I call a stored procedure from within cfscript?
Wrap it in a cffunction tag and call it as a function.
Paul
Probably not, could be debated that it was on older versions of CF. I
personally am a cfscript nazi, use it a lot more than I really should.
On 12/30/05, Ben Doom [EMAIL PROTECTED] wrote:
Is it ever actually necessary? :-)
--Ben
New here - Flash-guy, also new to ColdFusion and SQL (CF-Newbies doesn't
seem to be populated with anybody)
(...and before I ask the question, I'm also looking for a cleaner way to
write this, like not having to hard code the field column names)
How do I insert each subsequent record from a
If you don't *need* this done with cfscript, try this. This is a copy
and paste from something I'm putting together, with names changed to
protect the innocent...
cfquery name=qLessons datasource=coursesDB
SELECT ID, Lesson, Required, Time FROM Lessons
/cfquery
| icfconsulting.com
-Original Message-
From: Merrill, Jason [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 13, 2005 11:31 AM
To: CF-Talk
Subject: Simple XML cfscript question
New here - Flash-guy, also new to ColdFusion and SQL (CF-Newbies
doesn't
seem to be populated with anybody
Well, I got it working, didn't realize I could use the Array access
operator like I can in Actionscript and Javascript (ECMA praise here?).
Here is the script, but how can I make it cleaner so not as much is
hardcoded - i.e. get names of all the fields and then loop over those x
number of
| E-Learning Solutions | icfconsulting.com
-Original Message-
From: Merrill, Jason [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 13, 2005 11:31 AM
To: CF-Talk
Subject: Simple XML cfscript question
New here - Flash-guy, also new to ColdFusion and SQL (CF-Newbies
Thanks very much - could you shoot me an example of usage of both
columnlist and listlen() in this context? I'm new to ColdFusion and
can't quite wrap my head around it.
I tried:
for (i = 1; i LTE #qLessons.RecordCount#; i = i + 1){
lrXML.lData.XmlChildren[i] =
i'm a bit rusty on my syntax, i've been working on some asp projects
recently (yuk)
try this out
cfscript
lrXML = XmlNew();
lrXML.xmlRoot = XmlElemNew(lrXML,lData);
for (ii = 1; ii LTE qAllLessons.RecordCount; ii = ii + 1){
lrXML.lData.XmlChildren[ii] =
Nevermind, after some headaches, I figured it out on my own:
cfquery name=GetAll datasource=coursesDB
SELECT * FROM Lessons
/cfquery
!-- the following query used to dynamically get the table names !--
cfquery name=GetTables datasource=coursesDB
SELECT MSysObjects.Name
I think you need to escape (i.e. double up) the single quotes in any
CF vars you're using in the query, then use preservesinglequotes()
inside cfquery tag.
cfscript
mySQLstring = SELECT orders_id FROM Orders WHERE label =
'#Replace(This_Label, ', '', all)#';
/cfscript
cfquery name=qwe
I use preserveSingleQuotes with MySQL without any issue. You
shouldn't need to do anything special:
cfset sql = select * from mytable where name = 'barneyb' /
cfquery ...
#preserveSingleQuotes(sql)#
/cfquery
On Wed, 8 Dec 2004 18:08:02 -0500, C. Hatton Humphrey
[EMAIL PROTECTED] wrote:
If you're using CF variables in your SQL you may* need to escape any
single quotes when you're creating your SQL statement in the first
place:
cfset user = Barney O'Boivert
cfset sql = select * from mytable where name = '#Replace(user, ',
'', all))#' /
cfquery ...
#preserveSingleQuotes(sql)#
Okay, to try and make my life easier I decided to try changing a block
of code from CFSet to CFScript.
However, part of what I need to do in this code is run a query based
on a variable value... I'm pulling a label out of a record body and
need to get the id of a record where a certian field
What database are you using? preserveSingleQuotes() has always worked
for me, exactly as intended.
However, before you go too far down this road, I'd recommend not using
CFSCRIPT for this code, because there is a query inside. Sure, you
can make a wrapper, as you tried, but doing that will
Why not just double up the single quotes?
Okay, to try and make my life easier I decided to try changing a
block
of code from CFSet to CFScript.
However, part of what I need to do in this code is run a query based
on a variable value... I'm pulling a label out of a record body and
need
Why not just double up the single quotes?
Tried that - may be a NDA thing or just a MySQL thing - I got the same
error when sending the query.
To answer Barney's question - I'm using a MySQL database. That's what
the clent has and I haven't been able to dissuade him from using it.
When I sent
If the declaration of variables using var within cfscript isn't necessary,
what kind of variables are being created?Are they in the variables
scope?
For example, the variables 'sdatefmt' and 'edatefmt' in the cf function
shown below:
function DateRangeFormat(sdate, edate, mask, divider) {
if
-Original Message-
From: Jim McAtee [mailto:[EMAIL PROTECTED]
Sent: Friday, May 07, 2004 10:33 AM
To: CF-Talk
Subject: cfscript question
If the declaration of variables using var within cfscript
isn't necessary,
what kind of variables are being created?Are they in the variables
scope
/htmldocs/udfs12.htm
HTH
--Nathan
From: Jim McAtee [mailto:[EMAIL PROTECTED]
Sent: Friday, May 07, 2004 1:33 PM
To: CF-Talk
Subject: cfscript question
If the declaration of variables using var within cfscript isn't
necessary,
what kind of variables
What makes you think it is isn't necessary? Any variable created inside a
cfscript based function, or a cffunction based function, must be var scoped.
Period. (Well, ok, yea, it works w/o the var scope, but leaving them off is
very risky.)
[Todays Threads]
[This Message]
[Subscription]
- Original Message -
From: Raymond Camden [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Friday, May 07, 2004 11:49 AM
Subject: RE: cfscript question
What makes you think it is isn't necessary?
Because it isn't.Period.
Any variable created inside a
cfscript based function
What makes you think it is isn't necessary?
Because it isn't.Period.
I think I was very clear just a few words later that this was just my
opinion.
Any variable created inside a
cfscript based function, or a cffunction based function, must be var
scoped.
Period. (Well, ok, yea, it
What makes you think it is isn't necessary?
Because it isn't.Period.
Required and necessary are two different things.Using 'var' isn't
required, but it is definitely necessary, at least in anything approaching
normal circumstances.
Cheers,
barneyb
[Todays Threads]
[This Message]
Required and necessary are two different things.
In logic terms, they are not.
Using 'var' isn't required, but it is definitely necessary,
Let's say it's recommended, not required nor necessary, but highly recommended.
--
___
See some cool custom tags here:
:
Onderwerp: Re: Another cfscript question.
ListGetAt() returns a string, so what you are saying is essentially the
same as
some string goes here = ;
--Ben Doom
Che Vilnonis wrote:
// Loop through the list and define all default values.
for(i=1; i LTE listlen(ErrorFlags); i = i + 1
, November 06, 2003 3:46 PM
To: CF-Talk
Subject: RE: cfscript question...
Using CF5. The error is...
Parameter 1 of function IsDefined which is now
FORM[listgetat(FieldList,i)] must be a syntactically valid variable name.
-Original Message-
From: Tony Weeg [mailto:[EMAIL PROTECTED]
Sent
Hello again.
I'm in the process of converting a lot of my code over to cfscript blocks
and I can't get by this error.
cfscript
// Define error variables list.
ErrorFlags =
CreateAccountFlag,ExistingAccountFlag,EmailFlag,EmailInvalidFlag,PasswordFl
On Friday 07 Nov 2003 17:04 pm, Che Vilnonis wrote:
if (NOT isDefined(#listgetat(ErrorFlags,i)#)) {listgetat(ErrorFlags,i) =
You can't use listGetAt to set elements in arrays, it's only job is to return
the contents at a position.
--
Tom Chiverton
Advanced ColdFusion Programmer
Tel:
Try the 'setvariable'function.
ie..
if (NOT isDefined(#listgetat(ErrorFlags,i)#)) {
setvariable(listgetat(ErrorFlags,i),);}
-Original Message-
From: Che Vilnonis [mailto:[EMAIL PROTECTED]
Sent: 07 November 2003 17:04
To: CF-Talk
Subject: Another cfscript question.
Hello
ListGetAt() returns a string, so what you are saying is essentially the
same as
some string goes here = ;
which is not a legal command.If you had a structure predefined, let's
call it Errors, you could do somethinglike
Errors[listgetat(errorflags, i)] = ;
--Ben Doom
Che Vilnonis wrote:
Thomas, Craig...Thanks!
-Original Message-
From: Craig Dudley [mailto:[EMAIL PROTECTED]
Sent: Friday, November 07, 2003 12:04 PM
To: CF-Talk
Subject: RE: Another cfscript question.
Try the 'setvariable'function.
ie..
if (NOT isDefined(#listgetat(ErrorFlags,i)#)) {
setvariable(listgetat
My .02 agrees with your .02
- Calvin
- Original Message -
From: Mark A. Kruger - CFG
To: CF-Talk
Sent: Friday, November 07, 2003 9:43 AM
Subject: RE: cfscript question...
I like this better:
IF(StructKeyExists(form,Listgeat(fieldlist,i)) {
}
One of the reasons I like using
Does that make it .0004 cents?
-Original Message-
From: Calvin Ward [mailto:[EMAIL PROTECTED]
Sent: Friday, November 07, 2003 10:36 AM
To: CF-Talk
Subject: Re: cfscript question...
My .02 agrees with your .02
- Calvin
- Original Message -
From: Mark A. Kruger - CFG
To: CF-Talk
What am I doing wrong here?
cfscript
// Intialize List
FieldList =
CustEmail,CustPassword,CustPassword2,BillFirstName,BillLastName,BillAddress
,BillAddress2,BillCity,BillState,BillZip,BillPhone;
// Loop thru list and define all FORM variables
for(i=1; i LTE listlen(FieldList); i = i + 1)
if
: Thursday, November 06, 2003 4:26 PM
To: CF-Talk
Subject: cfscript question...
What am I doing wrong here?
cfscript
// Intialize List
FieldList =
CustEmail,CustPassword,CustPassword2,BillFirstName,BillLastName,BillAddress
,BillAddress2,BillCity,BillState,BillZip,BillPhone;
// Loop thru list
I assume you want to see if form[X] is defined, were X is from
fieldList. You are missing a # sign:
if(not isDefined(form.#listGetAt(fieldlist,i)#))
form[listGetAt(fieldList,i)] = ;
Also note I switched to dot notation for the isDefined check. If you
want to use brackets, switch to
What is it not doing right?
One thing, isDefined wants a simple string.Try:
if (NOT isDefined(FORM[#listgetat(FieldList,i)#]))
Jann
-Original Message-
From: Che Vilnonis [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 06, 2003 1:26 PM
To: CF-Talk
Subject: cfscript question...
What
]
Sent: Thursday, November 06, 2003 4:26 PM
To: CF-Talk
Subject: cfscript question...
What am I doing wrong here?
cfscript
// Intialize List
FieldList =
CustEmail,CustPassword,CustPassword2,BillFirstName,BillLastName,BillAddress
,BillAddress2,BillCity,BillState,BillZip,BillPhone;
// Loop thru
To: CF-Talk
Subject: cfscript question...
What am I doing wrong here?
cfscript
// Intialize List
FieldList =
CustEmail,CustPassword,CustPassword2,BillFirstName,BillLastName,BillAddress
,BillAddress2,BillCity,BillState,BillZip,BillPhone;
// Loop thru list and define all FORM variables
for(i=1; i
that was it Ray... btw, how do you know all of this stuff?
you must use more than 10% of your brain :)
-Original Message-
From: Raymond Camden [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 06, 2003 4:33 PM
To: CF-Talk
Subject: RE: cfscript question...
I assume you want to see
I was trying to use try/catch in cfscript and i couldn't get it to work.
i've checked all the documentation i can find (not much) and it doesn't say
if you can or cannot use try/catch inside of cfscript. has anyone used it
before? thanks for all the help.
david
I was trying to use try/catch in cfscript and i couldn't get
it to work. i've checked all the documentation i can find (not
much) and it doesn't say if you can or cannot use try/catch
inside of cfscript. has anyone used it before? thanks for all
the help.
CFSCRIPT doesn't support
I have the following as cfscript:
if (not(structKeyExists(session.cart, attributes.name)))
I would like to use it as a CFIF statement. Any ideas how to go about
constructing said cfif?
--
***
Jon Tillman
LINUX USER: #141163
ICQ: 4015362
cfif not structKeyExists(session.cart, attributes.name
blah
/cfif
- Original Message -
From: "Jon Tillman" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, August 24, 2000 07:27
Subject: CFSCRIPT question
I have the following as cfscript:
if (not(struc
Oops. Left off a )
Should be
cfif not structKeyExists(session.cart, attributes.name)
blah
/cfif
- Original Message -
From: "David E. Crawford" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, August 24, 2000 12:56
Subject: Re: CFSCRIPT question
cfif not struc
: David E. Crawford [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 24, 2000 9:00 AM
To: [EMAIL PROTECTED]
Subject: Re: CFSCRIPT question
Oops. Left off a )
Should be
cfif not structKeyExists(session.cart, attributes.name)
blah
/cfif
- Original Message -
From: "David E. Cra
man [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
Date: Friday, August 25, 2000 3:28 AM
Subject: CFSCRIPT question
I have the following as cfscript:
if (not(structKeyExists(session.cart, attributes.name)))
I would like to use it as a CFIF statement. Any ideas how to go about
constru
Date: Friday, August 25, 2000 10:05 AM
Subject: RE: CFSCRIPT question
How would you then check for a particular value of a key within the same
cfif? In other words I am doing something similar where I am checking for
the existence of a key but then how do I filter so I get only those whose
value
Can I use cflocation in a cfscript or it onlu does if then else and loops.
Robert Everland III
Web Developer
Dixon Ticonderoga
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
: CFSCRIPT Question
Can I use cflocation in a cfscript or it only does if then
else and loops.
Robert Everland III
Web Developer
Dixon Ticonderoga
-BEGIN PGP SIGNATURE-
Version: PGPfreeware 6.5.3 for non-commercial use http://www.pgp.com
Comment: Please use PGP!!!
iQA
that helps!
~
Rob Mulcahey
Programmer
James Tower
507-386-9380
[EMAIL PROTECTED]
~
-Original Message-
From: Bill Killillay [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 09, 2000 6:20 PM
To: Cf-Talk
Subject: CFSCRIPT Question??
When I pass this page the UR
E = URL.PAGE
-Original Message-
From: Bill Killillay [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 10, 2000 8:50 AM
To: Cf-Talk
Subject: CFSCRIPT Question??
When I pass this page the URL variable of 1 through what ever or nothing
they all return the default value. Why is that? There
74 matches
Mail list logo