If I use CFLOOP -- do I just keep appending to the string I am creating ...

Ie.,
<CFLOOP query="getcategory">
<CFSET myvar = myvar & "Category " & getcategory.currentrow &
getcategory.title>
</CFLOOP>

...or is there a more efficient append function to use with the variable?

Thanks for the help!

>
>
> Use CFLOOP instead of CFOUTPUT combined with your CFFILE operation.  Keep
in
> mind that the currentrow variable will be determined as an incrementing
> number from 1 to recordcount, and is only indicative of the physical order
> in which the query was returned to CF based on your SQL statement.
>
> DC
>
>   -----Original Message-----
>   From: PC [mailto:[EMAIL PROTECTED]]
>   Sent: Wednesday, September 20, 2000 14:40
>   To: [EMAIL PROTECTED]
>   Subject: Re: Current Row in SQL as opposed to CF? [CF-Talk]
>
>
>   I am using SQL Server 7.
>
>   I can use CFOUTPUT I suppose. What I need to do is set the results to a
>   variable and write that as part of a file.
>
>   I am a little unclear on how I would even use CFOUTPUT in this
fashion --
>   can I somehow
>   set the output to a variable?
>
>   <CFOUTPUT query="getcategories">
>   "Category"  #currentrow#  #Category_Title#
>   </cfoutput>
>
>   I need this in a variable that is part of a few variables concatenated
and
>   written to a file using CFFILE write ....
>
>   Thanks for anymore insight... :)
>
>
>
>
>   > Not in standard SQL. This operation would be at odds with
>   > the relational view of data, in which data is intrinsically
>   > not ordered.
>   >
>   > So if there is a way of doing it that would work in a single
>   > CFQUERY, it's going to be be DBMS-specific. If you happen
>   > to be using PostgreSQL you might be able to to create a
>   > user-defined function in 'C' to do it, but that would be
>   > crazy.
>   >
>   > But if you can't use CFOUTPUT, why does it matter what the
>   > results look like? What exactly are you trying to do?
>   >
>   > Nick
>   >
>   > -----Original Message-----
>   > From: PC [mailto:[EMAIL PROTECTED]]
>   > Sent: Wednesday, September 20, 2000 2:07 PM
>   > To: [EMAIL PROTECTED]
>   > Subject: Current Row in SQL as opposed to CF? [CF-Talk]
>   >
>   >
>   > IS there a way to do get the current row as part of a select statement
> in
>   a
>   > similar fashion as the coldfusion #queryname.currentrow# property
>   functions
>   > in a CFOUTPUT context?
>   >
>   > What I need are results that look like:
>   >
>   > Category  1   Sports
>   > Category  2   Languages
>   > Category  3   Reference
>   > Category  4   Politics
>   >
>   > from a query looking something like:
>   >
>   > SELECT TOP 4 Category + ?currentrow? + Category_title
>   >
>   > So what property exists, or technique for generating the ?currentrow?
> part
>   > of the statement  above????
>   >
>   > Now, I cannot use the indentity field .. I don't want values like
>   > Category 2  ...
>   > Category 19  ...
>   >
>   > And ... I cannot use a CFOUTPUT or CFLOOP -- I want to do it all in
the
>   SQL
>   > statement if possible!!
>   >
>   >
>
>
>
> --------------------------------------------------------------------------
>   --
>   > --
>   > Archives: http://www.mail-archive.com/[email protected]/
>   > To Unsubscribe visit
>   >
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
> or
>   > send a message to [EMAIL PROTECTED] with 'unsubscribe'
> in
>   > the body.
>   >
>   >
>   > **********************************************************************
>   > Information in this email is confidential and may be privileged.
>   > It is intended for the addressee only. If you have received it in
error,
>   > please notify the sender immediately and delete it from your system.
>   > You should not otherwise copy it, retransmit it or use or disclose its
>   > contents to anyone.
>   > Thank you for your co-operation.
>   > **********************************************************************
>
>
>
> --------------------------------------------------------------------------
>   ----
>   > Archives: http://www.mail-archive.com/[email protected]/
>   > To Unsubscribe visit
>   http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
or
>   send a message to [EMAIL PROTECTED] with 'unsubscribe'
in
>   the body.
>   >
>
>   ------------------------------------------------------------------------
--
> ----
>   Archives: http://www.mail-archive.com/[email protected]/
>   To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
> send a message to [EMAIL PROTECTED] with 'unsubscribe' in
> the body.
>
>
> ------=_NextPart_000_01B0_01C02310.14845680
> Content-Type: text/html;
> charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD><TITLE>Re: Current Row in SQL as opposed to CF? =
> [CF-Talk]</TITLE>
> <META content=3D"text/html; charset=3Diso-8859-1" =
> http-equiv=3DContent-Type>
> <META content=3D"MSHTML 5.00.3018.900" name=3DGENERATOR></HEAD>
> <BODY>
> <DIV>&nbsp;</DIV>
> <DIV>&nbsp;</DIV>
> <DIV>&nbsp;</DIV>
> <DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
> class=3D516313414-20092000>Use=20
> CFLOOP instead of CFOUTPUT combined with your CFFILE operation.&nbsp; =
> Keep in=20
> mind that the currentrow variable will be determined as an incrementing =
> number=20
> from 1 to recordcount, and is only indicative of the physical order in =
> which the=20
> query was returned to CF based on your SQL =
> statement.</SPAN></FONT></DIV>
> <DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
> class=3D516313414-20092000></SPAN></FONT>&nbsp;</DIV>
> <DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
> class=3D516313414-20092000>DC</SPAN></FONT></DIV>
> <DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
> class=3D516313414-20092000></SPAN></FONT>&nbsp;</DIV>
> <BLOCKQUOTE style=3D"MARGIN-RIGHT: 0px">
>   <DIV align=3Dleft class=3DOutlookMessageHeader dir=3Dltr><FONT =
> face=3DTahoma=20
>   size=3D2>-----Original Message-----<BR><B>From:</B> PC=20
>   [mailto:[EMAIL PROTECTED]]<BR><B>Sent:</B> Wednesday, September 20, 2000=20
>   14:40<BR><B>To:</B> [EMAIL PROTECTED]<BR><B>Subject:</B> Re: =
> Current=20
>   Row in SQL as opposed to CF? [CF-Talk]<BR><BR></DIV></FONT>
>   <P><FONT size=3D2>I am using SQL Server 7.</FONT> </P>
>   <P><FONT size=3D2>I can use CFOUTPUT I suppose. What I need to do is =
> set the=20
>   results to a</FONT> <BR><FONT size=3D2>variable and write that as part =
> of a=20
>   file.</FONT> </P>
>   <P><FONT size=3D2>I am a little unclear on how I would even use =
> CFOUTPUT in this=20
>   fashion --</FONT> <BR><FONT size=3D2>can I somehow</FONT> <BR><FONT =
> size=3D2>set=20
>   the output to a variable?</FONT> </P>
>   <P><FONT size=3D2>&lt;CFOUTPUT query=3D"getcategories"&gt;</FONT> =
> <BR><FONT=20
>   size=3D2>"Category"&nbsp; #currentrow#&nbsp; #Category_Title#</FONT> =
> <BR><FONT=20
>   size=3D2>&lt;/cfoutput&gt;</FONT> </P>
>   <P><FONT size=3D2>I need this in a variable that is part of a few =
> variables=20
>   concatenated and</FONT> <BR><FONT size=3D2>written to a file using =
> CFFILE write=20
>   ....</FONT> </P>
>   <P><FONT size=3D2>Thanks for anymore insight... :)</FONT> </P><BR><BR>
>   <P><FONT size=3D2>&gt; Not in standard SQL. This operation would be at =
> odds=20
>   with</FONT> <BR><FONT size=3D2>&gt; the relational view of data, in =
> which data=20
>   is intrinsically</FONT> <BR><FONT size=3D2>&gt; not ordered.</FONT> =
> <BR><FONT=20
>   size=3D2>&gt;</FONT> <BR><FONT size=3D2>&gt; So if there is a way of =
> doing it that=20
>   would work in a single</FONT> <BR><FONT size=3D2>&gt; CFQUERY, it's =
> going to be=20
>   be DBMS-specific. If you happen</FONT> <BR><FONT size=3D2>&gt; to be =
> using=20
>   PostgreSQL you might be able to to create a</FONT> <BR><FONT =
> size=3D2>&gt;=20
>   user-defined function in 'C' to do it, but that would be</FONT> =
> <BR><FONT=20
>   size=3D2>&gt; crazy.</FONT> <BR><FONT size=3D2>&gt;</FONT> <BR><FONT =
> size=3D2>&gt;=20
>   But if you can't use CFOUTPUT, why does it matter what the</FONT> =
> <BR><FONT=20
>   size=3D2>&gt; results look like? What exactly are you trying to =
> do?</FONT>=20
>   <BR><FONT size=3D2>&gt;</FONT> <BR><FONT size=3D2>&gt; Nick</FONT> =
> <BR><FONT=20
>   size=3D2>&gt;</FONT> <BR><FONT size=3D2>&gt; -----Original =
> Message-----</FONT>=20
>   <BR><FONT size=3D2>&gt; From: PC [<A=20
>   href=3D"mailto:[EMAIL PROTECTED]">mailto:[EMAIL PROTECTED]</A>]</FONT> =
> <BR><FONT=20
>   size=3D2>&gt; Sent: Wednesday, September 20, 2000 2:07 PM</FONT> =
> <BR><FONT=20
>   size=3D2>&gt; To: [EMAIL PROTECTED]</FONT> <BR><FONT =
> size=3D2>&gt;=20
>   Subject: Current Row in SQL as opposed to CF? [CF-Talk]</FONT> =
> <BR><FONT=20
>   size=3D2>&gt;</FONT> <BR><FONT size=3D2>&gt;</FONT> <BR><FONT =
> size=3D2>&gt; IS there=20
>   a way to do get the current row as part of a select statement =
> in</FONT>=20
>   <BR><FONT size=3D2>a</FONT> <BR><FONT size=3D2>&gt; similar fashion as =
> the=20
>   coldfusion #queryname.currentrow# property</FONT> <BR><FONT=20
>   size=3D2>functions</FONT> <BR><FONT size=3D2>&gt; in a CFOUTPUT =
> context?</FONT>=20
>   <BR><FONT size=3D2>&gt;</FONT> <BR><FONT size=3D2>&gt; What I need are =
> results=20
>   that look like:</FONT> <BR><FONT size=3D2>&gt;</FONT> <BR><FONT =
> size=3D2>&gt;=20
>   Category&nbsp; 1&nbsp;&nbsp; Sports</FONT> <BR><FONT size=3D2>&gt;=20
>   Category&nbsp; 2&nbsp;&nbsp; Languages</FONT> <BR><FONT size=3D2>&gt;=20
>   Category&nbsp; 3&nbsp;&nbsp; Reference</FONT> <BR><FONT size=3D2>&gt;=20
>   Category&nbsp; 4&nbsp;&nbsp; Politics</FONT> <BR><FONT =
> size=3D2>&gt;</FONT>=20
>   <BR><FONT size=3D2>&gt; from a query looking something like:</FONT> =
> <BR><FONT=20
>   size=3D2>&gt;</FONT> <BR><FONT size=3D2>&gt; SELECT TOP 4 Category + =
> ?currentrow?=20
>   + Category_title</FONT> <BR><FONT size=3D2>&gt;</FONT> <BR><FONT =
> size=3D2>&gt; So=20
>   what property exists, or technique for generating the ?currentrow? =
> part</FONT>=20
>   <BR><FONT size=3D2>&gt; of the statement&nbsp; above????</FONT> =
> <BR><FONT=20
>   size=3D2>&gt;</FONT> <BR><FONT size=3D2>&gt; Now, I cannot use the =
> indentity field=20
>   .. I don't want values like</FONT> <BR><FONT size=3D2>&gt; Category =
> 2&nbsp;=20
>   ...</FONT> <BR><FONT size=3D2>&gt; Category 19&nbsp; ...</FONT> =
> <BR><FONT=20
>   size=3D2>&gt;</FONT> <BR><FONT size=3D2>&gt; And ... I cannot use a =
> CFOUTPUT or=20
>   CFLOOP -- I want to do it all in the</FONT> <BR><FONT =
> size=3D2>SQL</FONT>=20
>   <BR><FONT size=3D2>&gt; statement if possible!!</FONT> <BR><FONT=20
>   size=3D2>&gt;</FONT> <BR><FONT size=3D2>&gt;</FONT> <BR><FONT =
> size=3D2>&gt;=20
>   =
> -------------------------------------------------------------------------=
> -</FONT>=20
>   <BR><FONT size=3D2>--</FONT> <BR><FONT size=3D2>&gt; --</FONT> =
> <BR><FONT=20
>   size=3D2>&gt; Archives: <A=20
>   href=3D"http://www.mail-archive.com/[email protected]/"=20
>   =
> target=3D_blank>http://www.mail-archive.com/[email protected]/</A=
> ></FONT>=20
>   <BR><FONT size=3D2>&gt; To Unsubscribe visit</FONT> <BR><FONT =
> size=3D2>&gt; <A=20
>   =
>
href=3D"http://www.houseoffusion.com/index.cfm?sidebar=3Dlists&amp;body=3D=
> lists/cf_talk"=20
>   =
> target=3D_blank>http://www.houseoffusion.com/index.cfm?sidebar=3Dlists&am=
> p;body=3Dlists/cf_talk</A>=20
>   or</FONT> <BR><FONT size=3D2>&gt; send a message to=20
>   [EMAIL PROTECTED] with 'unsubscribe' in</FONT> =
> <BR><FONT=20
>   size=3D2>&gt; the body.</FONT> <BR><FONT size=3D2>&gt;</FONT> =
> <BR><FONT=20
>   size=3D2>&gt;</FONT> <BR><FONT size=3D2>&gt;=20
>   =
> **********************************************************************</F=
> ONT>=20
>   <BR><FONT size=3D2>&gt; Information in this email is confidential and =
> may be=20
>   privileged.</FONT> <BR><FONT size=3D2>&gt; It is intended for the =
> addressee=20
>   only. If you have received it in error,</FONT> <BR><FONT size=3D2>&gt; =
> please=20
>   notify the sender immediately and delete it from your system.</FONT> =
> <BR><FONT=20
>   size=3D2>&gt; You should not otherwise copy it, retransmit it or use =
> or disclose=20
>   its</FONT> <BR><FONT size=3D2>&gt; contents to anyone.</FONT> =
> <BR><FONT=20
>   size=3D2>&gt; Thank you for your co-operation.</FONT> <BR><FONT =
> size=3D2>&gt;=20
>   =
> **********************************************************************</F=
> ONT>=20
>   <BR><FONT size=3D2>&gt;=20
>   =
> -------------------------------------------------------------------------=
> -</FONT>=20
>   <BR><FONT size=3D2>----</FONT> <BR><FONT size=3D2>&gt; Archives: <A=20
>   href=3D"http://www.mail-archive.com/[email protected]/"=20
>   =
> target=3D_blank>http://www.mail-archive.com/[email protected]/</A=
> ></FONT>=20
>   <BR><FONT size=3D2>&gt; To Unsubscribe visit</FONT> <BR><FONT =
> size=3D2><A=20
>   =
>
href=3D"http://www.houseoffusion.com/index.cfm?sidebar=3Dlists&amp;body=3D=
> lists/cf_talk"=20
>   =
> target=3D_blank>http://www.houseoffusion.com/index.cfm?sidebar=3Dlists&am=
> p;body=3Dlists/cf_talk</A>=20
>   or</FONT> <BR><FONT size=3D2>send a message to =
> [EMAIL PROTECTED]=20
>   with 'unsubscribe' in</FONT> <BR><FONT size=3D2>the body.</FONT> =
> <BR><FONT=20
>   size=3D2>&gt;</FONT> </P>
>   <P><FONT=20
>   =
> size=3D2>----------------------------------------------------------------=
> --------------</FONT>=20
>   <BR><FONT size=3D2>Archives: <A=20
>   href=3D"http://www.mail-archive.com/[email protected]/"=20
>   =
> target=3D_blank>http://www.mail-archive.com/[email protected]/</A=
> ></FONT>=20
>   <BR><FONT size=3D2>To Unsubscribe visit <A=20
>   =
>
href=3D"http://www.houseoffusion.com/index.cfm?sidebar=3Dlists&amp;body=3D=
> lists/cf_talk"=20
>   =
> target=3D_blank>http://www.houseoffusion.com/index.cfm?sidebar=3Dlists&am=
> p;body=3Dlists/cf_talk</A>=20
>   or send a message to [EMAIL PROTECTED] with =
> 'unsubscribe' in=20
>   the body.</FONT></P></BLOCKQUOTE></BODY></HTML>
>
> ------=_NextPart_000_01B0_01C02310.14845680--
>
> --------------------------------------------------------------------------
----
> Archives: http://www.mail-archive.com/[email protected]/
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to