OK, different approach:

<cfquery datasource="#DataSource#">
        SELECT *
        FROM MyTable
</cfquery>

<!--- Create file and insert column headers. --->
<cffile action="WRITE"
        file="full_path_name.txt"
        output="ColHdr1,ColHdr2,ColHdr3">

<!--- Append each record on a new line. --->
<cfloop query="MyQuery">
        <cffile action="APPEND"
                file="full_path_name.txt"
                output="#Col1#,Col2#,#Col3#">

</cfloop>


-----Original Message-----
From: Eyad Makhoul [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 03, 2001 8:45 AM
To: CF-Community
Subject: RE: How we could get data from database to text file


Thx for uyour Concernity...,
But how you could replace the(CFHTTP.FileContent) whith the query 
which will load the data in to text file.


MR.Eyad Makhoul
TelNo/Home:+96265359801
Mobile:+96277304797



---------- Original Message ----------------------------------
From: "Daye, Marianne" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Date: Tue, 03 Apr 2001 07:59:36 -0400

>Sorry, I just realized I understood the question backwards.  What 
I did
>below will get the data from a text file to a database.  However, 
I've also
>seen a case where the contents of cfhttp were used to enter data 
into a text
>file as follows:
>
><cffile action="WRITE" file="full_path_name.txt"
>output="#CFHTTP.FileContent#">
>
>Since the cfhttp is a query of sorts, I wonder if you can't do 
something
>similar with a regular query.
>
>Marianne Daye
>
>-----Original Message-----
>From: Daye, Marianne [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, April 03, 2001 7:45 AM
>To: CF-Community
>Subject: RE: How we could get data from database to text file
>
>
><CFHTTP> seems to read a delimited file into a query and use the 
column
>headers as field names.  This has worked for me:
>
><cfhttp URL="http://localhost/path/file.htm method="GET"
>       name="MyQuery"
>       textqualifier=""""
>       delimiter=",">
>               
>       <!--- Update database table with file contents. --->
>       <cfloop query="MyQuery">
>               <cfquery datasource="#DataSource#">
>                       UPDATE MyTable
>                       SET Field1 = '#Col1#',
>                           Field2 = '#Col2#'
>               </cfquery>
>       </cfloop>
>
>Marianne Daye
>Programmer/Analyst
>Information Delivery Systems (IDS)
>http://ids.rti.org
>
>
>-----Original Message-----
>From: Derek Hamilton [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, April 03, 2001 3:04 AM
>To: CF-Community
>Subject: Re: How we could get data from database to text file
>
>
>Some more info on what/how you are trying to do would be helpful.
>
>Derek
>----- Original Message -----
>From: "Eyad Makhoul" <[EMAIL PROTECTED]>
>To: "CF-Community" <[EMAIL PROTECTED]>
>Sent: Monday, April 02, 2001 11:47 PM
>Subject: How we could get data from database to text file
>
>
>> Dear all..,
>> I face a problem in how to get data from database to a text file
>> through coldfusion ...and i used CFFILE but it seems it does not
>> perform the job perfectly, because i want the data with thier
>> columns to be inserted in to file.
>>
>> any Help...?
>>
>>
>>
>> MR.Eyad Makhoul
>> TelNo/Home:+96265359801
>> Mobile:+96277304797
>>

>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to