looping through an insert statement
Is this the correct syntax for looping through an insert: Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( '#thisprojectid#', '#form['ProteinSequence' LoopCount]#', '#form['genename' LoopCount]#', '#form['NoAminoAcids' LoopCount]#' ) I am getting an error when I know the form field name is correct: [Macromedia][SQLServer JDBC Driver][SQLServer]Invalid object name 'ProteinSequence'. The error occurred in*C:\inetpub\wwwroot\sttr2\orders\neworder_main_confirm_action.cfm: line 77* 75 : '#form['ProteinSequence' LoopCount]#', 76 : '#form['genename' LoopCount]#', *77 : '#form['NoAminoAcids' LoopCount]#'* 78 : ) 79 :/cfquery Rick. ~| 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:338548 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
Maybe try this instead: Values( '#thisprojectid#', '#form[ProteinSequence LoopCount]#', '#form[genename LoopCount]#', '#form[NoAminoAcids LoopCount]#' ) ~| 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:338551 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
that did not work. what is funny is that the debug sql statement looks ok : Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( '20', 'sdalifsdaifasifsadi', 'g1', '15' ) On 10/26/2010 10:40 AM, Michael Grant wrote: Maybe try this instead: Values( '#thisprojectid#', '#form[ProteinSequence LoopCount]#', '#form[genename LoopCount]#', '#form[NoAminoAcids LoopCount]#' ) ~| 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:338553 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
Could you post your code? If you only loop a single time do you still get the error? On Tue, Oct 26, 2010 at 1:47 PM, Rick Colman rcol...@cox.net wrote: that did not work. what is funny is that the debug sql statement looks ok : Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( '20', 'sdalifsdaifasifsadi', 'g1', '15' ) On 10/26/2010 10:40 AM, Michael Grant wrote: Maybe try this instead: Values( '#thisprojectid#', '#form[ProteinSequence LoopCount]#', '#form[genename LoopCount]#', '#form[NoAminoAcids LoopCount]#' ) ~| 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:338554 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
1) can you expand on did not work? like provide the error message ;-) 2) I would assume the project ID is numeric and thus no need for the single quotes around '#thisprojectid#' (same goes for count) HTH Cheers On Tue, 2010-10-26 at 10:47 -0700, Rick Colman wrote: that did not work. what is funny is that the debug sql statement looks ok : Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( '20', 'sdalifsdaifasifsadi', 'g1', '15' ) On 10/26/2010 10:40 AM, Michael Grant wrote: Maybe try this instead: Values( '#thisprojectid#', '#form[ProteinSequence LoopCount]#', '#form[genename LoopCount]#', '#form[NoAminoAcids LoopCount]#' ) ~| 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:338557 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
It seems to die on the first loop because nothing gets inserted. Cfdump shows the proper form variables being passed. cfloop index = LoopCount from=1 to=#form.num_genes# step=1 cfquery datasource=#application.datasource# name=AddProject username=#request.dsn_username# password=#request.dsn_password# Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( '#thisprojectid#', '#form[ProteinSequence LoopCount]#', '#form[genename LoopCount]#', '#form[NoAminoAcids LoopCount]#' ) /cfquery /cfloop On 10/26/2010 10:51 AM, Michael Grant wrote: Could you post your code? If you only loop a single time do you still get the error? On Tue, Oct 26, 2010 at 1:47 PM, Rick Colmanrcol...@cox.net wrote: that did not work. what is funny is that the debug sql statement looks ok : Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( '20', 'sdalifsdaifasifsadi', 'g1', '15' ) On 10/26/2010 10:40 AM, Michael Grant wrote: Maybe try this instead: Values( '#thisprojectid#', '#form[ProteinSequence LoopCount]#', '#form[genename LoopCount]#', '#form[NoAminoAcids LoopCount]#' ) ~| 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:338558 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
And Project_ID, AA_Sequence, Gene_Name and Count are all string fields? On Tue, Oct 26, 2010 at 1:58 PM, Rick Colman rcol...@cox.net wrote: It seems to die on the first loop because nothing gets inserted. Cfdump shows the proper form variables being passed. cfloop index = LoopCount from=1 to=#form.num_genes# step=1 cfquery datasource=#application.datasource# name=AddProject username=#request.dsn_username# password=#request.dsn_password# Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( '#thisprojectid#', '#form[ProteinSequence LoopCount]#', '#form[genename LoopCount]#', '#form[NoAminoAcids LoopCount]#' ) /cfquery /cfloop On 10/26/2010 10:51 AM, Michael Grant wrote: Could you post your code? If you only loop a single time do you still get the error? On Tue, Oct 26, 2010 at 1:47 PM, Rick Colmanrcol...@cox.net wrote: that did not work. what is funny is that the debug sql statement looks ok : Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( '20', 'sdalifsdaifasifsadi', 'g1', '15' ) On 10/26/2010 10:40 AM, Michael Grant wrote: Maybe try this instead: Values( '#thisprojectid#', '#form[ProteinSequence LoopCount]#', '#form[genename LoopCount]#', '#form[NoAminoAcids LoopCount]#' ) ~| 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:338559 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
Those are all coming from a form so have you tried dumping the form scope? Make sure proteinsequence exists in the form On Oct 26, 2010 12:59 PM, Rick Colman rcol...@cox.net wrote: It seems to die on the first loop because nothing gets inserted. Cfdump shows the proper form variables being passed. cfloop index = LoopCount from=1 to=#form.num_genes# step=1 cfquery datasource=#application.datasource# name=AddProject username=#request.dsn_username# password=#request.dsn_password# Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( '#thisprojectid#', '#form[ProteinSequence LoopCount]#', '#form[genename LoopCount]#', '#form[NoAminoAcids LoopCount]#' ) /cfquery /cfloop On 10/26/2010 10:51 AM, Michael Grant wrote: Could you post your code? If you only loop a single time do you still get the error? On Tue, Oct 26, 2010 at 1:47 PM, Rick Colmanrcol...@cox.net wrote: that did not work. what is funny is that the debug sql statement looks ok : Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( '20', 'sdalifsdaifasifsadi', 'g1', '15' ) On 10/26/2010 10:40 AM, Michael Grant wrote: Maybe try this instead: Values( '#thisprojectid#', '#form[ProteinSequence LoopCount]#', '#form[genename LoopCount]#', '#form[NoAminoAcids LoopCount]#' ) ~| 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:338560 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
actually, two are int, so revised, but still did not work: Error Executing Database Query. [Macromedia][SQLServer JDBC Driver][SQLServer]Invalid object name 'ProteinSequence'. The error occurred in*C:\inetpub\wwwroot\sttr2\orders\neworder_main_confirm_action.cfm: line 77* 75 : '#form['ProteinSequence' LoopCount]#', 76 : '#form['genename' LoopCount]#', *77 : #form['NoAminoAcids' LoopCount]#* 78 : ) 79 :/cfquery VENDORERRORCODE 208 SQLSTATE 42S02 SQLInsert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( 22, 'sdalifsdaifasifsadi', 'g1', 15 ) DATASOURCEsttr2 code: cfloop index = LoopCount from=1 to=#form.num_genes# step=1 cfquery datasource=#application.datasource# name=AddProject username=#request.dsn_username# password=#request.dsn_password# Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( #thisprojectid#, '#form['ProteinSequence' LoopCount]#', '#form['genename' LoopCount]#', #form['NoAminoAcids' LoopCount]# ) /cfquery /cfloop cfdump: PROTEINSEQUENCE1sdalifsdaifasifsadi PROTEINSEQUENCE2sdafklfsaklfsdklaf On 10/26/2010 11:00 AM, Michael Grant wrote: And Project_ID, AA_Sequence, Gene_Name and Count are all string fields? On Tue, Oct 26, 2010 at 1:58 PM, Rick Colmanrcol...@cox.net wrote: It seems to die on the first loop because nothing gets inserted. Cfdump shows the proper form variables being passed. cfloop index = LoopCount from=1 to=#form.num_genes# step=1 cfquery datasource=#application.datasource# name=AddProject username=#request.dsn_username# password=#request.dsn_password# Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( '#thisprojectid#', '#form[ProteinSequence LoopCount]#', '#form[genename LoopCount]#', '#form[NoAminoAcids LoopCount]#' ) /cfquery /cfloop On 10/26/2010 10:51 AM, Michael Grant wrote: Could you post your code? If you only loop a single time do you still get the error? On Tue, Oct 26, 2010 at 1:47 PM, Rick Colmanrcol...@cox.net wrote: that did not work. what is funny is that the debug sql statement looks ok : Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( '20', 'sdalifsdaifasifsadi', 'g1', '15' ) On 10/26/2010 10:40 AM, Michael Grant wrote: Maybe try this instead: Values( '#thisprojectid#', '#form[ProteinSequenceLoopCount]#', '#form[genenameLoopCount]#', '#form[NoAminoAcidsLoopCount]#' ) ~| 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:338561 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
yes, thank you, the form variables are actually there. On 10/26/2010 11:05 AM, Greg Morphis wrote: Those are all coming from a form so have you tried dumping the form scope? Make sure proteinsequence exists in the form On Oct 26, 2010 12:59 PM, Rick Colmanrcol...@cox.net wrote: It seems to die on the first loop because nothing gets inserted. Cfdump shows the proper form variables being passed. cfloop index = LoopCount from=1 to=#form.num_genes# step=1 cfquery datasource=#application.datasource# name=AddProject username=#request.dsn_username# password=#request.dsn_password# Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( '#thisprojectid#', '#form[ProteinSequence LoopCount]#', '#form[genename LoopCount]#', '#form[NoAminoAcids LoopCount]#' ) /cfquery /cfloop On 10/26/2010 10:51 AM, Michael Grant wrote: Could you post your code? If you only loop a single time do you still get the error? On Tue, Oct 26, 2010 at 1:47 PM, Rick Colmanrcol...@cox.net wrote: that did not work. what is funny is that the debug sql statement looks ok : Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( '20', 'sdalifsdaifasifsadi', 'g1', '15' ) On 10/26/2010 10:40 AM, Michael Grant wrote: Maybe try this instead: Values( '#thisprojectid#', '#form[ProteinSequence LoopCount]#', '#form[genename LoopCount]#', '#form[NoAminoAcids LoopCount]#' ) ~| 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:338562 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
what happens if you put those into cfqueryparam's? On Tue, Oct 26, 2010 at 2:07 PM, Rick Colman rcol...@cox.net wrote: actually, two are int, so revised, but still did not work: Error Executing Database Query. [Macromedia][SQLServer JDBC Driver][SQLServer]Invalid object name 'ProteinSequence'. The error occurred in*C:\inetpub\wwwroot\sttr2\orders\neworder_main_confirm_action.cfm: line 77* 75 : '#form['ProteinSequence' LoopCount]#', 76 : '#form['genename' LoopCount]#', *77 : #form['NoAminoAcids' LoopCount]#* 78 : ) 79 :/cfquery VENDORERRORCODE 208 SQLSTATE 42S02 SQLInsert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( 22, 'sdalifsdaifasifsadi', 'g1', 15 ) DATASOURCEsttr2 code: cfloop index = LoopCount from=1 to=#form.num_genes# step=1 cfquery datasource=#application.datasource# name=AddProject username=#request.dsn_username# password=#request.dsn_password# Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( #thisprojectid#, '#form['ProteinSequence' LoopCount]#', '#form['genename' LoopCount]#', #form['NoAminoAcids' LoopCount]# ) /cfquery /cfloop cfdump: PROTEINSEQUENCE1sdalifsdaifasifsadi PROTEINSEQUENCE2sdafklfsaklfsdklaf On 10/26/2010 11:00 AM, Michael Grant wrote: And Project_ID, AA_Sequence, Gene_Name and Count are all string fields? On Tue, Oct 26, 2010 at 1:58 PM, Rick Colmanrcol...@cox.net wrote: It seems to die on the first loop because nothing gets inserted. Cfdump shows the proper form variables being passed. cfloop index = LoopCount from=1 to=#form.num_genes# step=1 cfquery datasource=#application.datasource# name=AddProject username=#request.dsn_username# password=#request.dsn_password# Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( '#thisprojectid#', '#form[ProteinSequence LoopCount]#', '#form[genename LoopCount]#', '#form[NoAminoAcids LoopCount]#' ) /cfquery /cfloop On 10/26/2010 10:51 AM, Michael Grant wrote: Could you post your code? If you only loop a single time do you still get the error? On Tue, Oct 26, 2010 at 1:47 PM, Rick Colmanrcol...@cox.net wrote: that did not work. what is funny is that the debug sql statement looks ok : Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( '20', 'sdalifsdaifasifsadi', 'g1', '15' ) On 10/26/2010 10:40 AM, Michael Grant wrote: Maybe try this instead: Values( '#thisprojectid#', '#form[ProteinSequenceLoopCount]#', '#form[genenameLoopCount]#', '#form[NoAminoAcidsLoopCount]#' ) ~| 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:338563 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
Well I know you said in another post that the form elements are all there, but this error disagrees with you ;-) So it's time to check variable spellingpossibly caseother obvious yet silly things ...and of course you want to make sure that the complete set of form elements exist for ALL values of the loop (if any of these come from checkboxes, an unchecked on would cause some chaos for sure (as it would be undefined) HTH Cheers On Tue, 2010-10-26 at 11:07 -0700, Rick Colman wrote: actually, two are int, so revised, but still did not work: Error Executing Database Query. [Macromedia][SQLServer JDBC Driver][SQLServer]Invalid object name 'ProteinSequence'. The error occurred in*C:\inetpub\wwwroot\sttr2\orders\neworder_main_confirm_action.cfm: line 77* 75 : '#form['ProteinSequence' LoopCount]#', 76 : '#form['genename' LoopCount]#', *77 : #form['NoAminoAcids' LoopCount]#* 78 : ) 79 :/cfquery VENDORERRORCODE 208 SQLSTATE42S02 SQL Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( 22, 'sdalifsdaifasifsadi', 'g1', 15 ) DATASOURCE sttr2 code: cfloop index = LoopCount from=1 to=#form.num_genes# step=1 cfquery datasource=#application.datasource# name=AddProject username=#request.dsn_username# password=#request.dsn_password# Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( #thisprojectid#, '#form['ProteinSequence' LoopCount]#', '#form['genename' LoopCount]#', #form['NoAminoAcids' LoopCount]# ) /cfquery /cfloop cfdump: PROTEINSEQUENCE1 sdalifsdaifasifsadi PROTEINSEQUENCE2 sdafklfsaklfsdklaf On 10/26/2010 11:00 AM, Michael Grant wrote: And Project_ID, AA_Sequence, Gene_Name and Count are all string fields? On Tue, Oct 26, 2010 at 1:58 PM, Rick Colmanrcol...@cox.net wrote: It seems to die on the first loop because nothing gets inserted. Cfdump shows the proper form variables being passed. cfloop index = LoopCount from=1 to=#form.num_genes# step=1 cfquery datasource=#application.datasource# name=AddProject username=#request.dsn_username# password=#request.dsn_password# Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( '#thisprojectid#', '#form[ProteinSequence LoopCount]#', '#form[genename LoopCount]#', '#form[NoAminoAcids LoopCount]#' ) /cfquery /cfloop On 10/26/2010 10:51 AM, Michael Grant wrote: Could you post your code? If you only loop a single time do you still get the error? On Tue, Oct 26, 2010 at 1:47 PM, Rick Colmanrcol...@cox.net wrote: that did not work. what is funny is that the debug sql statement looks ok : Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( '20', 'sdalifsdaifasifsadi', 'g1', '15' ) On 10/26/2010 10:40 AM, Michael Grant wrote: Maybe try this instead: Values( '#thisprojectid#', '#form[ProteinSequenceLoopCount]#', '#form[genenameLoopCount]#', '#form[NoAminoAcidsLoopCount]#' ) ~| 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:338564 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
ok, maybe I am cross-eyed and (tried matching cases), but: PROTEINSEQUENCE1sdalifsdaifasifsadi equals '#form['ProteinSequence' LoopCount]#', which is called AA_sequence in the data table as shown below Insert into ProteinSequence (Project_ID, AA_Sequence, ... this all seems to match up. ***Looping through an insert is certainly a very basic programming operation. Seems like it should not be so painful ... On 10/26/2010 11:15 AM, Bryan Stevenson wrote: Well I know you said in another post that the form elements are all there, but this error disagrees with you ;-) So it's time to check variable spellingpossibly caseother obvious yet silly things ...and of course you want to make sure that the complete set of form elements exist for ALL values of the loop (if any of these come from checkboxes, an unchecked on would cause some chaos for sure (as it would be undefined) HTH Cheers On Tue, 2010-10-26 at 11:07 -0700, Rick Colman wrote: actually, two are int, so revised, but still did not work: Error Executing Database Query. [Macromedia][SQLServer JDBC Driver][SQLServer]Invalid object name 'ProteinSequence'. The error occurred in*C:\inetpub\wwwroot\sttr2\orders\neworder_main_confirm_action.cfm: line 77* 75 : '#form['ProteinSequence' LoopCount]#', 76 : '#form['genename' LoopCount]#', *77 : #form['NoAminoAcids' LoopCount]#* 78 : ) 79 :/cfquery VENDORERRORCODE208 SQLSTATE 42S02 SQL Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( 22, 'sdalifsdaifasifsadi', 'g1', 15 ) DATASOURCE sttr2 code: cfloop index = LoopCount from=1 to=#form.num_genes# step=1 cfquery datasource=#application.datasource# name=AddProject username=#request.dsn_username# password=#request.dsn_password# Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( #thisprojectid#, '#form['ProteinSequence' LoopCount]#', '#form['genename' LoopCount]#', #form['NoAminoAcids' LoopCount]# ) /cfquery /cfloop cfdump: PROTEINSEQUENCE1 sdalifsdaifasifsadi PROTEINSEQUENCE2 sdafklfsaklfsdklaf ~| 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:338565 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
Rick, Can you provide a dump of the FORM scope? Thanks, Carl ok, maybe I am cross-eyed and (tried matching cases), but: PROTEINSEQUENCE1 sdalifsdaifasifsadi equals '#form['ProteinSequence' LoopCount]#', which is called AA_sequence in the data table as shown below Insert into ProteinSequence (Project_ID, AA_Sequence, ... this all seems to match up. ***Looping through an insert is certainly a very basic programming operation. Seems like it should not be so painful ... On 10/26/2010 11:15 AM, Bryan Stevenson wrote: ~| 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:338568 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
Diagnostics time. take the loop and the query right out of it, what happens when you add this at the top of your page: cfoutput#form['ProteinSequence'1]#/cfoutput On Tue, Oct 26, 2010 at 2:24 PM, Rick Colman rcol...@cox.net wrote: ok, maybe I am cross-eyed and (tried matching cases), but: PROTEINSEQUENCE1sdalifsdaifasifsadi equals '#form['ProteinSequence' LoopCount]#', which is called AA_sequence in the data table as shown below Insert into ProteinSequence (Project_ID, AA_Sequence, ... this all seems to match up. ***Looping through an insert is certainly a very basic programming operation. Seems like it should not be so painful ... On 10/26/2010 11:15 AM, Bryan Stevenson wrote: Well I know you said in another post that the form elements are all there, but this error disagrees with you ;-) So it's time to check variable spellingpossibly caseother obvious yet silly things ...and of course you want to make sure that the complete set of form elements exist for ALL values of the loop (if any of these come from checkboxes, an unchecked on would cause some chaos for sure (as it would be undefined) HTH Cheers On Tue, 2010-10-26 at 11:07 -0700, Rick Colman wrote: actually, two are int, so revised, but still did not work: Error Executing Database Query. [Macromedia][SQLServer JDBC Driver][SQLServer]Invalid object name 'ProteinSequence'. The error occurred in*C:\inetpub\wwwroot\sttr2\orders\neworder_main_confirm_action.cfm: line 77* 75 : '#form['ProteinSequence' LoopCount]#', 76 : '#form['genename' LoopCount]#', *77 : #form['NoAminoAcids' LoopCount]#* 78 : ) 79 :/cfquery VENDORERRORCODE208 SQLSTATE 42S02 SQL Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( 22, 'sdalifsdaifasifsadi', 'g1', 15 ) DATASOURCE sttr2 code: cfloop index = LoopCount from=1 to=#form.num_genes# step=1 cfquery datasource=#application.datasource# name=AddProject username=#request.dsn_username# password=#request.dsn_password# Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( #thisprojectid#, '#form['ProteinSequence' LoopCount]#', '#form['genename' LoopCount]#', #form['NoAminoAcids' LoopCount]# ) /cfquery /cfloop cfdump: PROTEINSEQUENCE1 sdalifsdaifasifsadi PROTEINSEQUENCE2 sdafklfsaklfsdklaf ~| 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:338571 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
...and you have verified that the table name is in fact ProteinSequence? and that your datasource is pointing at the correct DB? an invalid object error does seem to point to the DB/table On Tue, 2010-10-26 at 11:24 -0700, Rick Colman wrote: ok, maybe I am cross-eyed and (tried matching cases), but: PROTEINSEQUENCE1 sdalifsdaifasifsadi equals '#form['ProteinSequence' LoopCount]#', which is called AA_sequence in the data table as shown below Insert into ProteinSequence (Project_ID, AA_Sequence, ... this all seems to match up. ***Looping through an insert is certainly a very basic programming operation. Seems like it should not be so painful ... Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: br...@electricedgesystems.com web: www.electricedgesystems.com Notice: This message, including any attachments, is confidential and may contain information that is privileged or exempt from disclosure. It is intended only for the person to whom it is addressed unless expressly authorized otherwise by the sender. If you are not an authorized recipient, please notify the sender immediately and permanently destroy all copies of this message and attachments. Please consider the environment before printing this e-mail ~| 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:338583 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
Is it at all possible you've got the table name incorrect? On Tue, Oct 26, 2010 at 2:24 PM, Rick Colman rcol...@cox.net wrote: ok, maybe I am cross-eyed and (tried matching cases), but: PROTEINSEQUENCE1sdalifsdaifasifsadi equals '#form['ProteinSequence' LoopCount]#', which is called AA_sequence in the data table as shown below Insert into ProteinSequence (Project_ID, AA_Sequence, ... this all seems to match up. ***Looping through an insert is certainly a very basic programming operation. Seems like it should not be so painful ... On 10/26/2010 11:15 AM, Bryan Stevenson wrote: Well I know you said in another post that the form elements are all there, but this error disagrees with you ;-) So it's time to check variable spellingpossibly caseother obvious yet silly things ...and of course you want to make sure that the complete set of form elements exist for ALL values of the loop (if any of these come from checkboxes, an unchecked on would cause some chaos for sure (as it would be undefined) HTH Cheers On Tue, 2010-10-26 at 11:07 -0700, Rick Colman wrote: actually, two are int, so revised, but still did not work: Error Executing Database Query. [Macromedia][SQLServer JDBC Driver][SQLServer]Invalid object name 'ProteinSequence'. The error occurred in*C:\inetpub\wwwroot\sttr2\orders\neworder_main_confirm_action.cfm: line 77* 75 : '#form['ProteinSequence' LoopCount]#', 76 : '#form['genename' LoopCount]#', *77 : #form['NoAminoAcids' LoopCount]#* 78 : ) 79 :/cfquery VENDORERRORCODE208 SQLSTATE 42S02 SQL Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( 22, 'sdalifsdaifasifsadi', 'g1', 15 ) DATASOURCE sttr2 code: cfloop index = LoopCount from=1 to=#form.num_genes# step=1 cfquery datasource=#application.datasource# name=AddProject username=#request.dsn_username# password=#request.dsn_password# Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( #thisprojectid#, '#form['ProteinSequence' LoopCount]#', '#form['genename' LoopCount]#', #form['NoAminoAcids' LoopCount]# ) /cfquery /cfloop cfdump: PROTEINSEQUENCE1 sdalifsdaifasifsadi PROTEINSEQUENCE2 sdafklfsaklfsdklaf ~| 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:338587 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
here it is: struct COMMONNAME1 Bacillus subtilis EXPORG_ID1 314 FIELDNAMES NUM_GENES,PROJECTNAME,PURPOSE,GENENAME1,PROTEINSEQUENCE1,NOAMINOACIDS1,GENENAME2,PROTEINSEQUENCE2,NOAMINOACIDS2,EXPORG_ID1,COMMONNAME1,NOTES GENENAME1 g1 GENENAME2 g2 NOAMINOACIDS1 15 NOAMINOACIDS2 15 NOTES [empty string] NUM_GENES 2 PROJECTNAME t esting PROTEINSEQUENCE1sdalifsdaifasifsadi PROTEINSEQUENCE2sdafklfsaklfsdklaf PURPOSE testing On 10/26/2010 11:30 AM, Carl Von Stetten wrote: Rick, Can you provide a dump of the FORM scope? Thanks, Carl ok, maybe I am cross-eyed and (tried matching cases), but: PROTEINSEQUENCE1 sdalifsdaifasifsadi equals '#form['ProteinSequence'LoopCount]#', which is called AA_sequence in the data table as shown below Insert into ProteinSequence (Project_ID, AA_Sequence, ... this all seems to match up. ***Looping through an insert is certainly a very basic programming operation. Seems like it should not be so painful ... On 10/26/2010 11:15 AM, Bryan Stevenson wrote: ~| 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:338595 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
sdalifsdaifasifsadi which is what it should be ... On 10/26/2010 11:55 AM, Michael Grant wrote: cfoutput#form['ProteinSequence'1]#/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:338596 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
yes , yes (arghhh!!) On 10/26/2010 12:35 PM, Bryan Stevenson wrote: ...and you have verified that the table name is in fact ProteinSequence? and that your datasource is pointing at the correct DB? an invalid object error does seem to point to the DB/table On Tue, 2010-10-26 at 11:24 -0700, Rick Colman wrote: ok, maybe I am cross-eyed and (tried matching cases), but: PROTEINSEQUENCE1 sdalifsdaifasifsadi equals '#form['ProteinSequence'LoopCount]#', which is called AA_sequence in the data table as shown below Insert into ProteinSequence (Project_ID, AA_Sequence, ... this all seems to match up. ***Looping through an insert is certainly a very basic programming operation. Seems like it should not be so painful ... Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: br...@electricedgesystems.com web: www.electricedgesystems.com Notice: This message, including any attachments, is confidential and may contain information that is privileged or exempt from disclosure. It is intended only for the person to whom it is addressed unless expressly authorized otherwise by the sender. If you are not an authorized recipient, please notify the sender immediately and permanently destroy all copies of this message and attachments. Please consider the environment before printing this e-mail ~| 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:338597 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
Rickjust relax man.you want help you will have to answer questionsno matter how obvious they may be. Clearly you can't figure it out and you have the real codewe only have your pseudo code and are not inside your head 'nuff said On Tue, 2010-10-26 at 14:17 -0700, Rick Colman wrote: yes , yes (arghhh!!) On 10/26/2010 12:35 PM, Bryan Stevenson wrote: ...and you have verified that the table name is in fact ProteinSequence? and that your datasource is pointing at the correct DB? an invalid object error does seem to point to the DB/table On Tue, 2010-10-26 at 11:24 -0700, Rick Colman wrote: ok, maybe I am cross-eyed and (tried matching cases), but: PROTEINSEQUENCE1 sdalifsdaifasifsadi equals '#form['ProteinSequence'LoopCount]#', which is called AA_sequence in the data table as shown below Insert into ProteinSequence (Project_ID, AA_Sequence, ... this all seems to match up. ***Looping through an insert is certainly a very basic programming operation. Seems like it should not be so painful ... Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: br...@electricedgesystems.com web: www.electricedgesystems.com Notice: This message, including any attachments, is confidential and may contain information that is privileged or exempt from disclosure. It is intended only for the person to whom it is addressed unless expressly authorized otherwise by the sender. If you are not an authorized recipient, please notify the sender immediately and permanently destroy all copies of this message and attachments. Please consider the environment before printing this e-mail ~| 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:338599 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
It is more than possible, it is likely ... typo ... SORRY On 10/26/2010 12:38 PM, Michael Grant wrote: Is it at all possible you've got the table name incorrect? On Tue, Oct 26, 2010 at 2:24 PM, Rick Colmanrcol...@cox.net wrote: ok, maybe I am cross-eyed and (tried matching cases), but: PROTEINSEQUENCE1sdalifsdaifasifsadi equals '#form['ProteinSequence'LoopCount]#', which is called AA_sequence in the data table as shown below Insert into ProteinSequence (Project_ID, AA_Sequence, ... this all seems to match up. ***Looping through an insert is certainly a very basic programming operation. Seems like it should not be so painful ... On 10/26/2010 11:15 AM, Bryan Stevenson wrote: Well I know you said in another post that the form elements are all there, but this error disagrees with you ;-) So it's time to check variable spellingpossibly caseother obvious yet silly things ...and of course you want to make sure that the complete set of form elements exist for ALL values of the loop (if any of these come from checkboxes, an unchecked on would cause some chaos for sure (as it would be undefined) HTH Cheers On Tue, 2010-10-26 at 11:07 -0700, Rick Colman wrote: actually, two are int, so revised, but still did not work: Error Executing Database Query. [Macromedia][SQLServer JDBC Driver][SQLServer]Invalid object name 'ProteinSequence'. The error occurred in*C:\inetpub\wwwroot\sttr2\orders\neworder_main_confirm_action.cfm: line 77* 75 : '#form['ProteinSequence'LoopCount]#', 76 : '#form['genename'LoopCount]#', *77 : #form['NoAminoAcids'LoopCount]#* 78 : ) 79 :/cfquery VENDORERRORCODE208 SQLSTATE 42S02 SQL Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( 22, 'sdalifsdaifasifsadi', 'g1', 15 ) DATASOURCE sttr2 code: cfloop index = LoopCount from=1 to=#form.num_genes# step=1 cfquery datasource=#application.datasource# name=AddProject username=#request.dsn_username# password=#request.dsn_password# Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( #thisprojectid#, '#form['ProteinSequence' LoopCount]#', '#form['genename' LoopCount]#', #form['NoAminoAcids' LoopCount]# ) /cfquery /cfloop cfdump: PROTEINSEQUENCE1 sdalifsdaifasifsadi PROTEINSEQUENCE2 sdafklfsaklfsdklaf ~| 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:338600 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
BTW...I have seen invalid object when queries are malformedsee post your real query ;-) I'm not trying to be a tool by asking for it...all it takes is a comma out of place and things go wrong. There have been many occasions where I was a certain about the details of my real code that I didn't double checksure enough things were not as I thought. Cheers Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: br...@electricedgesystems.com web: www.electricedgesystems.com Notice: This message, including any attachments, is confidential and may contain information that is privileged or exempt from disclosure. It is intended only for the person to whom it is addressed unless expressly authorized otherwise by the sender. If you are not an authorized recipient, please notify the sender immediately and permanently destroy all copies of this message and attachments. Please consider the environment before printing this e-mail ~| 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:338602 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: looping through an insert statement
*big grin* ;-) On Tue, 2010-10-26 at 14:25 -0700, Rick Colman wrote: It is more than possible, it is likely ... typo ... SORRY On 10/26/2010 12:38 PM, Michael Grant wrote: Is it at all possible you've got the table name incorrect? On Tue, Oct 26, 2010 at 2:24 PM, Rick Colmanrcol...@cox.net wrote: ok, maybe I am cross-eyed and (tried matching cases), but: PROTEINSEQUENCE1sdalifsdaifasifsadi equals '#form['ProteinSequence'LoopCount]#', which is called AA_sequence in the data table as shown below Insert into ProteinSequence (Project_ID, AA_Sequence, ... this all seems to match up. ***Looping through an insert is certainly a very basic programming operation. Seems like it should not be so painful ... On 10/26/2010 11:15 AM, Bryan Stevenson wrote: Well I know you said in another post that the form elements are all there, but this error disagrees with you ;-) So it's time to check variable spellingpossibly caseother obvious yet silly things ...and of course you want to make sure that the complete set of form elements exist for ALL values of the loop (if any of these come from checkboxes, an unchecked on would cause some chaos for sure (as it would be undefined) HTH Cheers On Tue, 2010-10-26 at 11:07 -0700, Rick Colman wrote: actually, two are int, so revised, but still did not work: Error Executing Database Query. [Macromedia][SQLServer JDBC Driver][SQLServer]Invalid object name 'ProteinSequence'. The error occurred in*C:\inetpub\wwwroot\sttr2\orders\neworder_main_confirm_action.cfm: line 77* 75 : '#form['ProteinSequence'LoopCount]#', 76 : '#form['genename'LoopCount]#', *77 : #form['NoAminoAcids'LoopCount]#* 78 : ) 79 :/cfquery VENDORERRORCODE208 SQLSTATE 42S02 SQL Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( 22, 'sdalifsdaifasifsadi', 'g1', 15 ) DATASOURCE sttr2 code: cfloop index = LoopCount from=1 to=#form.num_genes# step=1 cfquery datasource=#application.datasource# name=AddProject username=#request.dsn_username# password=#request.dsn_password# Insert into ProteinSequence (Project_ID, AA_Sequence, Gene_Name, Count) Values( #thisprojectid#, '#form['ProteinSequence' LoopCount]#', '#form['genename' LoopCount]#', #form['NoAminoAcids' LoopCount]# ) /cfquery /cfloop cfdump: PROTEINSEQUENCE1 sdalifsdaifasifsadi PROTEINSEQUENCE2 sdafklfsaklfsdklaf ~| 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:338605 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm