CFUPDATE problem with field name beginning with a number

Advertisement
November 30

I have a form (actually several) that is gathering data for a survey. I tried to use cfupdate to update the data elements and got a string index out of range error. I tested again without the form fields that began with numbers and it worked just fine. I then tried to enclose the offending field names in () and []. Both times I got same error. Does anyone have a work around for this? The code and error are below.
Changing the field names is not really an option. This survey has almost 400 data points and most of the fields begin with the question number.
Thanks
DW
<cfupdate datasource="#application.fdp_datasource#" tablename="arra_survey1" dbtype="ODBC" formfields = "entry_no, 2_a_fy09, '2_a_fy10', '2_a_fy11', '2_a_fy12', '2_b_fy09', '2_b_fy10', '2_b_fy11', '2_b_fy12', '2_c_fy09', '2_c_fy10', '2_c_fy11', '2_c_fy12', '2_d_fy09', '2_d_fy10', '2_d_fy11', '2_d_fy12', '2_e_fy09', '2_e_fy10', '2_e_fy11', '2_e_fy12', '2_f_fy09', '2_f_fy10', '2_f_fy11', '2_f_fy12', '2_g_fy09', '2_g_fy10', '2_g_fy11', '2_g_fy12', '2_h_fy09', '2_h_fy10', '2_h_fy11', '2_h_fy12', '2_i_fy09', '2_i_fy10', '2_i_fy11', '2_i_fy12', '2_j_fy09', '2_j_fy10', '2_j_fy11', '2_j_fy12', '2_k_fy09', '2_k_fy10', '2_k_fy11', '2_k_fy12', '2_l_fy09', '2_l_fy10', '2_l_fy11', '2_l_fy12', central_office, dept_office, incl_other, 3_a_fy09, 3_a_fy10, 3_a_fy11, 3_a_fy12, 3_b_fy09, 3_b_fy10, 3_b_fy11, 3_b_fy12, 3_c_fy09, 3_c_fy10, 3_c_fy11, 3_c_fy12, 3_d_fy09, 3_d_fy10 3_d_fy11, 3_d_fy12, 3_e_fy09, 3_e_fy10, 3_e_fy11, 3_e_fy12, 3_f_fy09, 3_f_fy10, 3_f_fy11, 3_f_fy12, 3_g_fy09, 3_g_fy10, 3_g_fy11, 3_g_fy12, 3_h_fy09, 3_h_fy10, 3_h_fy11, 3_h_fy12, 3_i_fy09, 3_i_fy10, 3_i_fy11, 3_i_fy12, 3_j_fy09, 3_j_fy10, 3_j_fy11, 3_j_fy12, 3_k_fy09, 3_k_fy10, 3_k_fy11, 3_k_fy12, 3_l_fy09, 3_l_fy10, 3_l_fy11, 3_l_fy12">
String index out of range: -2
The error occurred in C:\Inetpub\wwwroot\directory\process_arra_suvey_2.cfm: line 12
12 : <cfupdate datasource="#application.fdp_datasource#" tablename="arra_survey1" dbtype="ODBC" formfields = "entry_no, 2_a_fy09, '2_a_fy10', '2_a_fy11', ...

Advertisement

Replay

I think you have run one of CFUPDATE's limitations.  I am not 100% certain, but I do not think cfupdate provides a way to escape invalid column names like yours.  In which case you may need to do a regular UPDATE within a  cfquery instead... or rename your columns.
fields that began with numbers
Most databases discourage creating column names that start with a number (or other restricted characters).  While many databases will allow you to escape invalid names, it is simpler all around to avoid them altogether.  Otherwise, you may have to escape the names in every single query. The recommendations vary, but usually object names that begin with a  letter, and contain only letters, numbers and underscores are considered  safe.
This survey has almost 400 data points and most of the fields begin with the question number.
Four-hundred (400) is a lot of columns for a single table.  The fact that they all them seem to contain the same type of information (ie response to a question) is an indication that data should probably be stored in a separate table, as rows, not columns.  For example questions could be stored in one table, possible answers in another, and the results of an individual test/survey stored in a third table.  A structure like that is much easier to query, can easily accommodate changes (add/remove questions, responses, etcetera) without having modify the table every time.

View 8 Replies

Save the PDF Form with Field Name

October 11

HI Guys, I have the Requirment in PDF Form.The PDF Form is generated with the Adobe Live Cycle Designer.After generating the PDF Form the user filled the details in the form and save the filled form.while clicking the Save button the default PDF name

View All Replies

Need infotype along with field name

November 30

Dear Experts, Can anyone please tell me the Infotype & Field name from where the following fields can be fetched. Location Designation Department Division company Date of joining date of confirmation gross salary(if yes which salary type i have to se

View All Replies

Connection failed SQL Server 2008 R2 with Instance Name but with IP connect

November 30

Hello, We have a server where SQL Server 2008 R2 is installed. Now from our local pc we connect to that database. I try to connect that database using instance name but cannot. If I put IP Address in the server name field, then it connect. my other c

View All Replies

Can two iPhones with same name sync with iTunes?

October 11

I've just got a new iPhone 4 and immediately synced it with iTunes, transferring all the data from my old 3Gs including the phone name. This means that I now have two iPhones with the same name(3Gs and 4). What are my chances of keeping my 3Gs as a b

View All Replies

Wlsc problem with package name

October 11

I am using wlsc ant task to generate my java code for a web service. Unlike the simplistic examples (HelloWorld and Complex) I have my complex types split into a separate .xsd file instead of putting them directly into the WSDL file. Is there a way t

View All Replies

Field names with spaces in target file using fcc

October 11

Hello Friends, My target structure fields: MT_Target ItemNo, ItemName, ItemQuantity, AmountValue, TotalAmount My requirement here is - In the target file - these fields should be generated with space. Shown as below: Item No, Item Name, Item Quantity

View All Replies

Spotlight search cannot begin with "a"

November 30

If I type a search in the Spotlight field which begins with "a" (or is simply that single letter), the progress icon (rotating lines) never stops spinning, and the mds process eats up all available physical memory, as well as writing gigabytes w

View All Replies

Only save queries if name starts with Y

November 30

Hello, How can security be configured so that users can only save queries whose Technical names start with Y? What authorizations are required and what values should be assigned? Thanks, NickHello Jin, We are on BW 3.5. Here is the complete set of au

View All Replies

Artists beginning with The arent displayed in "right" order

November 30

When using german as language setting, in iTunes 7+ groups beginning with "The" arent listed in the "right" order. That means The Beatles are shown with other Artists beginning with T instead of the ones with B. Instead, Artists beginn

View All Replies

Problem with Artists names on my Ipod

November 30

Hello, first, sorry for my english, but i'm french and young, so my english is pretty bad.. I've a problem with my ipod touch 16GB first gen. In "music" the names of the artists that begins with "The" are separated. For exemple : I've

View All Replies

Problem with field GL Account is that it shows concatenated Chart of Accoun

November 30

Hello . Please help me. We have sap BI olap universe . problem with field GL Account is that it shows concatenated Chart of Accounts. But user want to trim the chart of account and show only account in list of values in webi report. So What code I ca

View All Replies

!! Help for a looong script... begin with compare name of files, date...

October 11

Hello Everybody, and thank you very much if you can answer to my little problem So here is the beginning of my script. At the end it will be a script to batch convert Psd files to jpeg in different resolutions, in different folders. I wanted to under

View All Replies

We have problem with showing warnings "Inline with Field"s.

November 30

We have problem with showing error messages "Inline with Field"s. 1. We have a package ERROR, that collects all errors/warnings. It has a procedure PUT, that saves errors in the variables of the package. Package ERROR procedure put(ptable in var

View All Replies

Problem with field symbols in ecc 6.0

November 30

i have the following  code  written in 4.6 version   now i am executing the old report   in 6.0  but  i am facing with some unicode error.   FIELD-SYMBOLS:     <line_of_bs_table> LIKE tbl1024,    READ TABLE bs_table INDEX row_bst ASSIGNING  <line

View All Replies

Problem with field-length in sql-loader

November 30

Hello, (sorry I see it's the wrong forum -> SQL-Developer, I searched for SQL-Loader, is there a possibility to change the forum ?) I can't find an answer for my question at google, so I hope there is someone in this forum who can help me. I have a d

View All Replies

Problem with song names

November 30

Hey, I'm having this problem with song names. For example, instead of the song title being "Song Title" it will be like "Artist Name - Song Title". It's like this for half my files. I'm trying to organize my music files and every time

View All Replies

Selection screen with Parameter - field name not coming when made mandatory

October 11

Hi Experts, I have added a parameter in my selection screen which has other select options as well. I used below code in wd_initi to add parameter     create data LR_LIFNR type LIFNR.     WD_THIS->M_HANDLER->ADD_PARAMETER_FIELD(     I_ID         = '

View All Replies

Problem with flat file upload with ASCII file

October 11

Hi All, I am trying to load data into an ODS object via PSA using a text file (tab delimited). I have the following settings in my InfoPackage External Data tab: ASCII File Seperator for thousands: Character for decimal point: Currency Conversion: Nu

View All Replies

Problem using alias field names in a sql query

October 11

Hello, I have a question regarding a simple Oracle database SQL query writeup: In the following (badly written but properly working) SQL query: Query 1: select soe.field1, (soe.field2 + soe.field3) as field4, (soe.field5 - (soe.field2 + soe.field3))

View All Replies

Tags:

  1. illustrator cs3 initialization crash
  2. file: C:UsersHPDesktopmemeo.txt
  3. mac internet recovery mac mini2009
  4. fk09 mass confirmation of vendors
  5. using outline load utility
  6. cisco wlc dynamic interface
  7. W2AS
  8. stepa89
  9. swimmingxgn
  10. hurry94m
Copyrights 2019 Fcffair BigData Resource, All rights reserved