writing multi queries?

View: New views
9 Messages — Rating Filter:   Alert me  

writing multi queries?

by John Barrett-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a form that write a "single" entry to the db(date, tip topic, tip data). This creates a row in the db. Is it possible to write many rows to the db, maybe by attaching a xcel spreadsheet to the update script,and have that write to the db?

I am not sure if I am being clear about this, but I hope that I am.
Thanks so much,
John

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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-Newbie/message.cfm/messageid:3890
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.15

Re: writing multi queries?

by Greg Morphis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've had users upload .csv files.
You upload them, loop over them (delimited by comma or tab) and insert
the entries into the DB).

On Tue, Aug 5, 2008 at 8:35 PM, John Barrett <barrjohnm@...> wrote:
> I have a form that write a "single" entry to the db(date, tip topic, tip data). This creates a row in the db. Is it possible to write many rows to the db, maybe by attaching a xcel spreadsheet to the update script,and have that write to the db?
>
> I am not sure if I am being clear about this, but I hope that I am.
> Thanks so much,
> John
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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-Newbie/message.cfm/messageid:3891
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.15

Re: writing multi queries?

by John Barrett-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Greg,
Thanks so much for getting back to me.
I will have to look into how to create this. I think that I can  
figure out how to have an upload box for the form, then I think that  
I would just use a cfloop for the records??

Thanks for your help, at least now I know that this can be done.
I will let you know later today how this goes.
Thanks again,
John

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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-Newbie/message.cfm/messageid:3892
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.15

RE: writing multi queries?

by Paul Kukiel-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi John,

As Greg and yourself have mentioned that is basically what you would do.
Upload a file, read it in with cffile, loop over the csv rows inserting the
data to the db.

Regards,

Paul Kukiel  

-----Original Message-----
From: John Barrett [mailto:johnbarr@...]
Sent: Wednesday, 6 August 2008 1:04 PM
To: CF-Newbie
Subject: Re: writing multi queries?

Hi Greg,
Thanks so much for getting back to me.
I will have to look into how to create this. I think that I can  
figure out how to have an upload box for the form, then I think that  
I would just use a cfloop for the records??

Thanks for your help, at least now I know that this can be done.
I will let you know later today how this goes.
Thanks again,
John



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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-Newbie/message.cfm/messageid:3893
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.15

Re: writing multi queries?

by John Barrett-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Paul,
Thanks for getting back to me.
Can I ask is there something wrong here with cffile. I am trying this  
way first as I think that it will be easier than writing to the db.

<cfif isDefined("fileUpload")>
   <cffile action="upload"
      fileField="fileUpload"
      destination="/home/httpd/vhosts/cfhawaii.com/httpdocs/
GotNutrients/Files">
      <p>Thank you, your file has been uploaded.</p>
</cfif>
<cfform enctype="multipart/form-data" method="post">
   <cfinput type="file" name="fileUpload" /><br />
   <cfinput type="Submit" name="Upload File" value="Upload File">
</cfform>
On Aug 5, 2008, at 5:10 PM, Paul Kukiel wrote:

> Hi John,
>
> As Greg and yourself have mentioned that is basically what you  
> would do.
> Upload a file, read it in with cffile, loop over the csv rows  
> inserting the
> data to the db.
>
> Regards,
>
> Paul Kukiel
>
> -----Original Message-----
> From: John Barrett [mailto:johnbarr@...]
> Sent: Wednesday, 6 August 2008 1:04 PM
> To: CF-Newbie
> Subject: Re: writing multi queries?
>
> Hi Greg,
> Thanks so much for getting back to me.
> I will have to look into how to create this. I think that I can
> figure out how to have an upload box for the form, then I think that
> I would just use a cfloop for the records??
>
> Thanks for your help, at least now I know that this can be done.
> I will let you know later today how this goes.
> Thanks again,
> John
>
>
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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-Newbie/message.cfm/messageid:3894
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.15

RE: writing multi queries?

by Paul Kukiel-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Can you post your error as its looks fine I am guessing it's something with
the path and wether the user cf is running as has permission to write to the
location?

I ran the same code on windows and it worked.

Paul.

-----Original Message-----
From: John Barrett [mailto:johnbarr@...]
Sent: Wednesday, 6 August 2008 3:20 PM
To: CF-Newbie
Subject: Re: writing multi queries?

Hi Paul,
Thanks for getting back to me.
Can I ask is there something wrong here with cffile. I am trying this  
way first as I think that it will be easier than writing to the db.

<cfif isDefined("fileUpload")>
   <cffile action="upload"
      fileField="fileUpload"
      destination="/home/httpd/vhosts/cfhawaii.com/httpdocs/
GotNutrients/Files">
      <p>Thank you, your file has been uploaded.</p>
</cfif>
<cfform enctype="multipart/form-data" method="post">
   <cfinput type="file" name="fileUpload" /><br />
   <cfinput type="Submit" name="Upload File" value="Upload File">
</cfform>
On Aug 5, 2008, at 5:10 PM, Paul Kukiel wrote:

> Hi John,
>
> As Greg and yourself have mentioned that is basically what you  
> would do.
> Upload a file, read it in with cffile, loop over the csv rows  
> inserting the
> data to the db.
>
> Regards,
>
> Paul Kukiel
>
> -----Original Message-----
> From: John Barrett [mailto:johnbarr@...]
> Sent: Wednesday, 6 August 2008 1:04 PM
> To: CF-Newbie
> Subject: Re: writing multi queries?
>
> Hi Greg,
> Thanks so much for getting back to me.
> I will have to look into how to create this. I think that I can
> figure out how to have an upload box for the form, then I think that
> I would just use a cfloop for the records??
>
> Thanks for your help, at least now I know that this can be done.
> I will let you know later today how this goes.
> Thanks again,
> John
>
>
>
>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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-Newbie/message.cfm/messageid:3895
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.15

Re: writing multi queries?

by John Barrett-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

No error, it just does not upload the file.
I just ran it on my Mac at work, and it works(of course I changed the  
path, and yes it does upload the file.), but the host is a linux  
server, and I changed the permission to "777".

My thinking that once I can write the file, and loop through all the  
fields in the csv file, then I could use cfquery to write to the db.  
Is this the usual way to go about something like this?

I contacted the host to find out what is wrong, seems to me that it  
is something on their side. They told me that cffile is enabled.

Thanks so much for your help,
John

>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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-Newbie/message.cfm/messageid:3896
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.15

RE: writing multi queries?

by Paul Kukiel-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi John,

Yes once you have the cffile issue worked out its exactly as you say.  Read
in the file loop over it and inside the loop do the database insert.

Paul

-----Original Message-----
From: John Barrett [mailto:johnbarr@...]
Sent: Wednesday, 6 August 2008 3:45 PM
To: CF-Newbie
Subject: Re: writing multi queries?

No error, it just does not upload the file.
I just ran it on my Mac at work, and it works(of course I changed the  
path, and yes it does upload the file.), but the host is a linux  
server, and I changed the permission to "777".

My thinking that once I can write the file, and loop through all the  
fields in the csv file, then I could use cfquery to write to the db.  
Is this the usual way to go about something like this?

I contacted the host to find out what is wrong, seems to me that it  
is something on their side. They told me that cffile is enabled.

Thanks so much for your help,
John

>




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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-Newbie/message.cfm/messageid:3897
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.15

Parent Message unknown Re: writing multi queries?

by John Barrett-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Oh great, thanks so much for your help:) I actually feel I am starting to understand CF a little!
John


     

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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-Newbie/message.cfm/messageid:3898
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.15
LightInTheBox - Buy quality products at wholesale price!