Updating multiple fields at once

i have a form with a check box
<cfinput type="checkbox" name="update_friend" value="1"
checked="yes">
then on the action page my query reads
<cfparam name="FORM.update_friend" default="0">
<cfquery datasource="#application.datasource#">
UPDATE user_friend
SET update_friend = #FORM.update_friend#
WHERE id_friend =#FORM.id_friend# (THIS IS THE PRIMARY KEY
FOR THE TABLE I AM TRYING TO UPDATE)
</cfquery>
when i submit this, i am getting a mysql error message,
any help would be appreciated
thanks

ok let me explain a bit more...
i have a system which shows what your friends have been doing
on my website...what artists they have added into the database
etc(Updates)....what i am trying to do is allow people to choose
which friends they would like to recieve updates for...
so i have a column called update_friend which is set to
default 1 in the friends table...then I have a query on the updates
page which shows the activity of all of your friends with a 1 in
the update_friend column...
to allow people to control which friends they recieve updates
from I have a form which checkboxes
<a href="
http://www.musicexplained.co.uk/delete/updates_opt.cfm">click</a>
if you want to remove a friend from your updates list you
would decheck the checkbox next to their name and then submit...
what i would then like to happen.....is for the query to
update the checked check boxes with 1 so the user will still
recieve updates from those people, and update the unchecked check
boxes with 0 so they no longer recieve updates from them
if I have 4 checked check boxes out of the 7 i am getting a
list (1,1,1,1) as an output, which would suggest initially that the
<cfparam name="FORM.update_friend" default="0"> isnt working,
but regardless of this I would like if john was checked, dave was
checked, mary was checked and james was checked, and then hilary,
donny and gas was unchecked.......john, dave, mary and james would
be updated with 1 in their update_friend columns, and the rest
would be updated with 0 ..
so essentially the query would be
UPDATE user_friend
SET update_friend = 1,1,1,1,0,0,0
WHERE id_friend IN (12,13,14,15,16,17,18)
thanks

Similar Messages

  • Updating multiple fields ... need an advice.

    Hello all,
    I have a bit of a trouble with updating multiple fields in one table...
    Lets say we have two tables. Table one is called t_employe for example:
    create table t_employe (
    year number,
    line varchar2(1),
    counter number,
    value number)Lets set some random data into table:
    insert all
    into t_employe (year, line,counter, value)
    values(2011,'3','2946','3344')
    into t_employe (year, line,counter, value)
    values(2011,'3','2947','4433')
    into t_employe (year, line,counter, value)
    values(2011,'3','2948','4455')
    into t_employe (year, line,counter, value)
    values(2011,'3','2949','5544')
    select * from dualOk second table would be:
    create table to_update (
    year number,
    line varchar2(1),
    counter number,
    date_pos_1 date,
    value_pos_1 number,
    date_pos_2 date,
    value_pos_2 number,
    date_pos_3 date,
    value_pos_3 number,
    date_pos_4 date,
    value_pos_4 number,
    date_pos_5 date,
    value_pos_5 number)Data:
    insert all
    into to_update (year, line,counter, date_pos_1,value_pos_1,date_pos_2,value_pos_2,date_pos_3,value_pos_3,date_pos_4,value_pos_4,date_pos_5,value_pos_5)
    values(2011,'3','2946',sysdate,'5434',null,null,null,null,null,null,null,null)
    into to_update (year, line,counter, date_pos_1,value_pos_1,date_pos_2,value_pos_2,date_pos_3,value_pos_3,date_pos_4,value_pos_4,date_pos_5,value_pos_5)
    values(2011,'3','2947',sysdate,'11',sysdate,'123',null,null,null,null,null,null)
    into to_update (year, line,counter, date_pos_1,value_pos_1,date_pos_2,value_pos_2,date_pos_3,value_pos_3,date_pos_4,value_pos_4,date_pos_5,value_pos_5)
    values(2011,'3','2948',sysdate,'33',sysdate,'44',sysdate,'8908',null,null,null,null)
    into to_update (year, line,counter, date_pos_1,value_pos_1,date_pos_2,value_pos_2,date_pos_3,value_pos_3,date_pos_4,value_pos_4,date_pos_5,value_pos_5)
    values(2011,'3','2949',sysdate,'1',sysdate,'2',sysdate,'343',sysdate,'78',null,null)
    select * from dualOk now what i want to do is to update table to_update fields where value_pos is NULL. To explain it better imagine
    collums are from left to right in that order value_pos_1, value_pos_2, value_pos_3 .... Now i would want to check for each row
    if value_pos_1 is null ... if it is then update. Finist with this row and move to the next. If its not move to value_pos_2 in
    same row and again check if its null. If it is ... update, if not, again move forward. Each cullum value_pos_X has a cullom date_pos_x
    which has to be updated same as Value_pos_ cullums (if value_pos_X is null then coresponding date_pos_X will be null as well - thats
    a fact in my table).
    So is this doable by using only one update?
    I manage to write a select statment using case clause which does those things perfectly only for value_pos_X fields. I wonder if i can use it in my
    update statment?
    select
    case when a.value_pos_1 is  null then b.value else
         case when a.value_pos_2 is  null then b.value else
              case when a.value_pos_3 is  null then b.value else
                   case when a.value_pos_4 is  null then b.value else
                        case when a.value_pos_5 is  null then b.value else to_number('99999','9999,99')
    end
    end
    end
    end
    end  as value
    from to_update a,t_employe b
    where a.year = b.year
    and a.line= b.line
    and a.counter = b.counter Any suggestions how to pull this one of?
    Thank you!

    SQL> select  *
      2    from  to_update
      3  /
          YEAR L    COUNTER DATE_POS_ VALUE_POS_1 DATE_POS_ VALUE_POS_2 DATE_POS_ VALUE_POS_3 DATE_POS_ VALUE_POS_4 DATE_POS_ VALUE_POS_5
          2011 3       2946 27-AUG-11        5434
          2011 3       2947 27-AUG-11          11 27-AUG-11         123
          2011 3       2948 27-AUG-11          33 27-AUG-11          44 27-AUG-11        8908
          2011 3       2949 27-AUG-11           1 27-AUG-11           2 27-AUG-11         343 27-AUG-11          78
    SQL> merge
      2    into to_update a
      3    using (
      4           select  a.rowid rid,
      5                   b.value
      6             from  to_update a,
      7                   t_employe b
      8             where a.year = b.year
      9               and a.line= b.line
    10               and a.counter = b.counter
    11          ) b
    12     on (
    13         a.rowid = b.rid
    14        )
    15     when matched then update set value_pos_1 = nvl2(value_pos_1,value_pos_1,b.value),
    16                                  value_pos_2 = nvl2(value_pos_1,nvl2(value_pos_2,value_pos_2,b.value),value_pos_2),
    17                                  value_pos_3 = nvl2(value_pos_1 + value_pos_2,nvl2(value_pos_3,value_pos_3,b.value),value_pos_3),
    18                                  value_pos_4 = nvl2(value_pos_1 + value_pos_2 + value_pos_3,nvl2(value_pos_4,value_pos_4,b.value),value_pos_4),
    19                                  value_pos_5 = nvl2(value_pos_1 + value_pos_2 + value_pos_3 + value_pos_4,nvl2(value_pos_5,value_pos_5,b.value),value_pos_5)
    20  /
    4 rows merged.
    SQL> select  *
      2    from  to_update
      3  /
          YEAR L    COUNTER DATE_POS_ VALUE_POS_1 DATE_POS_ VALUE_POS_2 DATE_POS_ VALUE_POS_3 DATE_POS_ VALUE_POS_4 DATE_POS_ VALUE_POS_5
          2011 3       2946 27-AUG-11        5434                  3344
          2011 3       2947 27-AUG-11          11 27-AUG-11         123                  4433
          2011 3       2948 27-AUG-11          33 27-AUG-11          44 27-AUG-11        8908                  4455
          2011 3       2949 27-AUG-11           1 27-AUG-11           2 27-AUG-11         343 27-AUG-11          78                  5544
    SQL> Or yhis might be more readable:
    merge
      into to_update a
      using (
             select  a.rowid rid,
                     b.value
               from  to_update a,
                     t_employe b
               where a.year = b.year
                 and a.line= b.line
                 and a.counter = b.counter
            ) b
       on (
           a.rowid = b.rid
       when matched then update set value_pos_1 = case when value_pos_1 is null then b.value else value_pos_1 end,
                                    value_pos_2 = case when value_pos_1 is not null and value_pos_2 is null then b.value else value_pos_2 end,
                                    value_pos_3 = case when value_pos_1 + value_pos_2 is not null and value_pos_3 is null then b.value else value_pos_3 end,
                                    value_pos_4 = case when value_pos_1 + value_pos_2 + value_pos_3 is not null and value_pos_4 is null then b.value else value_pos_4 end,
                                    value_pos_5 = case when value_pos_1 + value_pos_2 + value_pos_3 + value_pos_4 is not null and value_pos_5 is null then b.value else value_pos_5 end
    /SY.

  • Import Format script required to update multiple fields

    Further to my previous post yesterday (Import Format script required to work across multiple fields I now need my import script to update multiple (two) fields at the same time, based on criteria set across multiple fields. So far, I can use DW.Utilities.fParseString to assess the values across multiple fields, but I now need to update not only the field in question, but also an additional field at the same time. For example:
    Function TBService(strField, strRecord)
    ' How do I update a second field at the same time?
    Dim strField2 As String
    If Left(strField, 1) = "S" Then
    If DW.Utilities.fParseString (strRecord, 3, 8, ",") = "B1110" Then
    strField2 = "N101"
    Else
    strField2 = "Network N/A"
    End If
    TBService = strField
    Else
    TBService = "Service N/A"
    End If
    End Function
    Is this even possible? Should I be looking at creating an event script which would work post-import? Or can this be done right here in the import script?

    All the logic you require can be encapsulated in the import script for the second field. You don't need to reference the second field in the first import script.
    Edited by: SH on May 2, 2012 5:39 PM

  • Updating multiple links at once in CS3

    Is there a way to add an extension or a script - so that I can update multiple image links at once.
    Theses images are in a catalogue and all the images are in the same folder, I am having to update one at at time.
    I know this is in CS5 but I am stuck here in CS3.
    Help!

    Moving the InDesign file wouldn't cause the links to go missing. Theyre just pointers to a file location, so evidently the folders containing the links have also been moved. Was there a server update that renamed a server? That's a very common scenario for this problem.
    There might be a script floating around that will deal with this. As I recall, exporting to .inx and editing the .inx in a text editor to change the path (if all the changes are the same, i.e. you need to change from Q:\ProjectFolder1\<filename> to X:\ProjectFolder1\<filename>) is a fast way to fix lots of links that were broken by renaming a server, but if the links are scattered, probably the best bet is close and reopen the file and let ID fiind as many links as possible in each folder you direct it to, as mentioned above.

  • Data merge - can you insert multiple fields at once?

    Hi,
    I'm using InDesign CS4.
    I'm automating a series of reports using Data Merge from a CSV file. Each row in the CSV file holds the data for each individual report - 135 reports in total.
    The thing is, each report contains a text comments from some research interviews - but some reports have maybe 10 or so comments, others have over 600! The fields are called comment001, comment002 ... right up to comment620 (or so).
    InDesign only seems to let me insert fields from the Data Merge one at a time - it won't let me Shift-select a range of fields ... the alternative is to manually insert about 620 fields one click at a time!! Ouch...
    Does anyone know of a way around this?
    (Hope I've explained the problem properly!)
    Cheers,
    F13

    We see a few Adobe employees from time to time, notably Dov Isaacs and occasionally Matthew Laun (from the InDesign development team), but they are here on their own time and in an unofficial capacity, though they are extremely helpful when they do drop in. Employees are encouraged, at least on the ID team, to monitor the forums, but not necessarily to participate, so they probably do see most of the reported problems, but their jobs are to do development, not provide tech support, and I for one would rather they spend their time fixing bugs and developing new features than have them actively engaging in these threads.
    And rest assured that Adobe appreciates the work that the user community is doing here. It's no secret that we are far better than the free telephone tech support, largely becasue we work with the programs every day while the suppot contractor only has relatively untrained folks reading from the knowledebase unless you can get escalated very high up the chain.
    As for the feature request, by all means file it. I think you are correct that it would be nice, though I can see some issues, too, like how do you decide how multiple fields will be strung together (one after another would be the same as your concatenation problem and using separate lines might not be approprtiate in all cases, either). The place to file is Adobe - Feature Request/Bug Report Form

  • Update multiple fields using select query efficiently – 9i

    I need to populate a table called prop_charact used for synching data to a legacy system.
    Prop_charact has fields that are found in a few other tables (no one field is found in more than one table outside of prop_charact). I want to pull the data from the corresponding fields in the source tables and put it into prop_charact. I only want to populate prop_charact with records that have been updated, but want to pull all fields for those records (whether or not that field has been updated). I am getting the list of updated records from a transaction history table.
    After getting that list, I was not sure what to do with it.
    I put what I want to do in terms of strictly SQL. I am thinking there are more efficient (less system resources) ways of doing this, but I am not sure what to pursue. I can use PL/SQL, but please keep in mind I am limited to using version 9i. Anyone have any hints about what I should look into using instead of just thes particular SQL statements?
    insert into eval.prop_charact (parcelno, propertyid)
    select distinct p.parcelno, p.propertyid
    from eval.transaction_history tr,
    admin.properties p
    where tr.propertyid = p.propertyid
    and trim(tr.tablename) in ('PROPERTIES', 'PROPERTYCHARACTERISTICS','EQID','NEWCHARACTERISTICS','DIMENSIONS', 'NON_RESIDENTIALS')
    and trim(tr.fieldname) in ('BLDGCODE', 'CATCODE', 'UNFINISHED', 'TOPOGRAPHY', 'GARAGETYPE', 'GARAGESPACES', 'OPENSPACES',
    'VIEW', 'GENERALCONSTRUCTION', 'YEARBUILT', 'ESTIMATEDYEAR', 'TOTALROOMS', 'TOTALBEDROOMS',
    'BASEMENTTYPE', 'NUMBEROFFIREPLACES', 'HEAT', 'CENTRALAIR','CONDITION','SITE_TYPE','TOTALDWELLINGAREA',
    'PLOTFRONT','PLOTDEPTH','PLOTSQFT','SHAPE','STORIES','FULLBATHROOMS','PARTBATHROOMS','MULTIPLE_BLDGS')
    and tr.trans_date >= to_date('01-01-2010', 'MM/DD/YYYY')
    and tr.trans_date < sysdate
    order by p.parcelno;
    update
    select p.BLDGCODE pBLDGCODE, epc.BLDGCODE epcBLDGCODE, p.CATCODE pCATCODE,epc.CATCODE epcCATCODE,
    p.UNFINISHED pUNFINISHED, epc.UNFINISHED epcUNFINISHED,
    pc.TOPOGRAPHY pcTOPOGRAPHY, epc.TOPOGRAPHY epcTOPOGRAPHY,
    pc.GARAGETYPE pcGARAGETYPE, epc.GARAGETYPE epcGARAGETYPE,
    pc.GARAGESPACES pcGARAGESPACES, epc.GARAGESPACES epcGARAGESPACES,
    pc.OPENSPACES pcOPENSPACES, epc.OPENSPACES epcOPENSPACES, pc.VIEW_ pcVIEW_, epc.VIEW_ epcVIEW_,
    pc.GENERALCONSTRUCTION pcGENERALCONSTRUCTION,
    epc.GENERALCONSTRUCTION epcGENERALCONSTRUCTION,
    pc.YEARBUILT pcYEARBUILT, epc.YEARBUILT epcYEARBUILT,
    pc.ESTIMATEDYEAR pcESTIMATEDYEAR, epc.ESTIMATEDYEAR epcESTIMATEDYEAR,
    pc.TOTALROOMS pcTOTALROOMS, epc.TOTALROOMS epcTOTALROOMS,
    pc.TOTALBEDROOMS pcTOTALBEDROOMS, epc.TOTALBEDROOMS epcTOTALBEDROOMS,
    pc.BASEMENTTYPE pcBASEMENTTYPE, epc.BASEMENTTYPE epcBASEMENTTYPE,
    pc.NUMBEROFFIREPLACES pcNUMBEROFFIREPLACES, epc.NUMBEROFFIREPLACES epcNUMBEROFFIREPLACES,
    pc.HEAT pcHEAT, epc.HEAT epcHEAT, pc.CENTRALAIR pcCENTRALAIR, epc.CENTRALAIR epcCENTRALAIR,
    e.CONDITION eCONDITION, epc.CONDITION epcCONDITION,
    n.SITE_TYPE nSITE_TYPE, epc.SITE_TYPE epcSITE_TYPE,
    d.TOTALDWELLINGAREA dTOTALDWELLINGAREA, epc.TOTALDWELLINGAREA epcTOTALDWELLINGAREA,
    d.PLOTFRONT dPLOTFRONT, epc.PLOTFRONT epcPLOTFRONT,
    d.PLOTDEPTH dPLOTDEPTH, epc.PLOTDEPTH epcPLOTDEPTH,
    d.PLOTSQFT dPLOTSQFT, epc.PLOTSQFT epcPLOTSQFT,d.SHAPE dSHAPE, epc.SHAPE epcSHAPE,
    pc.STORIES pcSTORIES, epc.STORIES epcSTORIES,
    n.FULLBATHROOMS nFULLBATHROOMS,epc.FULLBATHROOMS epcFULLBATHROOMS,
    n.PARTBATHROOMS nPARTBATHROOMS, epc.PARTBATHROOMS epcPARTBATHROOMS,
    nr.MULTIPLE_BLDGS nrMULTIPLE_BLDGS, epc.MULTIPLE_BLDGS epcMULTIPLE_BLDGS
    from eval.prop_charact epc, admin.properties p, admin.propertycharacteristics pc, admin.eqid e,
    admin.dimensions d, eval.newcharacteristics n, EVAL.non_residentials nr
    where epc.propertyid = p.propertyid and epc.propertyid = pc.propertyid and epc.propertyid = e.propertyid(+)
    and epc.propertyid = d.propertyid(+) and epc.propertyid = n.propertyid(+) and epc.propertyid = nr.propertyid(+)
    set epcBLDGCODE= pBLDGCODE, epcCATCODE= pCATCODE, epcUNFINISHED = pUNFINISHED,
    epcTOPOGRAPHY = pcTOPOGRAPHY, epcGARAGETYPE = pcGARAGETYPE, epcGARAGESPACES = pcGARAGESPACES,
    epcOPENSPACES = pcOPENSPACES, epcVIEW_ = pcVIEW_, epcGENERALCONSTRUCTION = pcGENERALCONSTRUCTION,
    epcYEARBUILT = pcYEARBUILT, epcESTIMATEDYEAR = pcESTIMATEDYEAR, epcTOTALROOMS = pcTOTALROOMS,
    epcTOTALBEDROOMS = pcTOTALBEDROOMS, epcBASEMENTTYPE = pcBASEMENTTYPE,
    epcNUMBEROFFIREPLACES = pcNUMBEROFFIREPLACES, epcHEAT = pcHEAT, epcCENTRALAIR = pcCENTRALAIR,
    epcCONDITION = eCONDITION, epcSITE_TYPE = nSITE_TYPE, epcTOTALDWELLINGAREA = dTOTALDWELLINGAREA,
    epcPLOTFRONT = dPLOTFRONT, epcPLOTDEPTH = dPLOTDEPTH, epcPLOTSQFT = dPLOTSQFT,
    epcSHAPE = dSHAPE, epcSTORIES = pcSTORIES, epcFULLBATHROOMS = nFULLBATHROOMS,
    epcPARTBATHROOMS = nPARTBATHROOMS, epcMULTIPLE_BLDGS = nrMULTIPLE_BLDGS;

    The following example may be of help.
    SQL> create table mytable(col1 number(1),
      2  col2 date);
    Table created.
    SQL> insert into mytable values(1,sysdate);
    1 row created.
    SQL> select * from mytable;
          COL1 COL2
             1 20-AUG-04
    SQL> update mytable
      2  set (col1,col2) = (select 2, sysdate-1 from dual);
    1 row updated.
    SQL> select * from mytable;
          COL1 COL2
             2 19-AUG-04

  • Update multiple fields with same/diffrent name

    I have the form is displayed  order no, message and sent_date. Mesage and Date sent are editable.  I can change value from both colums in diffrent values then hit submit for update.  My code below is loop thur message and date sent field then update them based on the pk ID.  Unfortunately, it didn't work as the expected.  Can you please help?
    Oder NO
    Message
    Date Sent
    5463
    first message
    12-10-12
    5463
    second message
    10-13-12
    <cfset myIds = ArrayNew(1)>
    <cfform name="update" method="post">
    <cfloop query="qMesg">
       <cfscript>
            ArrayAppend(myIds, "#id#");
            </cfscript>
         <cfinput type="text" value="#mesg#" name="mesg">
         <cfinput type="text" value="#dateformat(sent_date, 'mm-dd-yy')#" name="sent_date" validate="date" />
         <cfinput type="submit" name="submit" value="Update">
    </cfloop>
      <cfset myIdsList = #ArrayToList(myIds, ",")#>
       <cfinput type="hidden" name="ids" value="#myIdsList#">
    </cfform>
    <!---update--->
    <cfif isDefined("form.submit")>
    <cfloop index="idIdx" list="#newsids#" delimiters=",">
    <cfloop list="#form.mesg#" index="x">
    <cfloop list="#form.sent_date#" index="y">
          update [tblMessg]
         set mesg = <cfqueryparam value="#x#" cfsqltype="cf_sql_varchar">,
               sent_date = <cfqueryparam value="#y#" cfsqltype="cf_sql_date">
       where id = <cfqueryparam value="#idIdx#" cfsqltype="cf_sql_integer">
      </cfloop>
    </cfloop>
    </cfloop>
    </cfif>

    I am with Dan on this (identifying the field names with IDs), but prefer cfloop to cfoutput within cfform. Furthermore, I would put the submit button outside the loop.
    <cfloop query="qMesg">
        <cfscript>
        ArrayAppend(myIds, "#id#");
        </cfscript>
        <cfinput type="text" value="#mesg#" name="mesg#id#">
        <cfinput type="text" value="#dateformat(sent_date, 'mm-dd-yy')#" name="sent_date#id#" validate="date" />
    </cfloop>
    <cfinput type="submit" name="submit" value="Update">
    With proper handling, one loop should be sufficient on the action page.
    <cfloop index="idIdx" list="#form.ids#" delimiters=",">
        <cfset current_message = form["mesg" & idIdx]>
        <cfset current_date_sent = form["sent_date" & idIdx]>
        <cfquery>
        UPDATE tblMessg
        SET mesg = <cfqueryparam value="#current_message#" cfsqltype="cf_sql_varchar">,
        sent_date = <cfqueryparam value="#current_date_sent#" cfsqltype="cf_sql_date">
        WHERE id = <cfqueryparam value="#idIdx#" cfsqltype="cf_sql_integer">
        </cfquery>
    </cfloop>

  • How do I update multiple addresses at once?

    I have a about 2 dozen entries in my address book for a particular company. Is there a way to update the address for all of the employees of that company at one time? It is very time consuming to go to each entry and type the address over and over again. The same would go for the fax number

    If you are not familiar with Applescript the simplest is probably to select them all (eg by putting the company name in the search box and selecting all found) export the selection as a vCard then delete the selection. Open the vCard in a text editor, do a global find/replace on the affected data, then import the vCard again.
    AK

  • Update multiple graphs at once

    Hi, I have a VI containing multiple graphs (on a page of a tab control, to be precise) like these:
    Now, I'd like when the VI starts to initialize all of these graphs in the same manner:
    Basically, removing all the plot names and making them all not visible.
    Later, as my VI executes, I want to populate each graph with its relevant data and decide programatially on the number of plots in each graph, on the names of the plots etc.
    Now, it is OK to do it like above when one has a few graphs, but I am going to have some 16 of them and it is a real pain to add the wires as in the above screenshot every time I decide to add a graph to the front panel or if I decide some additional initialization is needed.
    Can this be done in some sort of a loop? I visialize some sort of loop going thru all the graphs belonging to some LabView object and somehow setting all those properties, while retaining the ability to reference each individual graph later in the program (by it name).
    Thanks in advance for your help.
    Solved!
    Go to Solution.

    Create an array of references for each of those graphs.  Unlink the property notes from the graph and feed it the array of references from outside the loop.  Now the loop will autoindex over the array and setting the properties on each of those graph references.

  • Change text size font in multiple fields at once

    I'm trying to edit an existing pdf form and I want to make the setting for the font smaller in all fields (the auto font before it's altered by rich text formatting) all at the same time rather than each one at a time. How do I do this?

    See whether this movie will help: FormFormatting.mp4 - Google Drive
    Note the other items  that can be adjusted.

  • Updating multiple fields using a single update statement.

    Hi All,
    I am a beginner to Oracle. I have used the following Hint in an update query that is executed in Oracle 10G. We recently updated the Oracle to version 11g and when executing the query getting the following Error: ORA-01779: cannot modify a column which maps to a non key-preserved table. PFB the query. Please suggest me some ways that I can do to avoid this error.
    UPDATE /*+ bypass_ujvc */
    (SELECT t1.STG_DEL_CONDITION, t2.condition
    FROM stg_reports_membenft_latest T1 JOIN (select ods_ssn_grp,sys_id, first_value(STG_DEL_CONDITION) over(PARTITION BY ods_ssn_grp,sys_id
    ORDER BY STG_DEL_CONDITION DESC) AS
    condition from stg_reports_membenft_latest) T2
    ON T1.ods_ssn_grp = T2.ods_ssn_grp AND T1.SYS_ID=T2.SYS_ID ) x
    SET x.STG_DEL_CONDITION = x.condition;
    Thanks and Regards,
    Karthik Sivakumar.

    I used the below query and got the Result.
    Thank You all
    MERGE INTO stg_reports_membenft_latest x1
    USING (SELECT distinct ods_ssn_grp,
    sys_id,
    First_value(STG_DEL_CONDITION) OVER(partition BY ods_ssn_grp,sys_id
    ORDER BY STG_DEL_CONDITION DESC)
    AS condition
    FROM stg_reports_membenft_latest) x2
    ON ( x1.ods_ssn_grp = x2.ods_ssn_grp
    AND x1.SYS_ID = x2.sys_id )
    WHEN matched THEN
    UPDATE SET x1.STG_DEL_CONDITION=x2.condition;

  • Updating multiple pages at once

    I am in the process of changing my site from mostly text to text, pictures, a menu bar, etc.
    Do I have to change the pages one at a time or is there an easier way to do this? I found a site that said DW had a proprietary system that would allow me to do this, but I can't find this system in the program. Any help would be greatly appreciated. Thanks!

    There's no magic button to set things up in a single process as you are planning.
    Dreamweaver has Templates and Library Items.
    You create your Template including all repetitive elements such as navbars then create child pages from that Template. There's plenty of info in DW's Help system and online tutorials about DW Templates.

  • Update Multiple Columns when concerned about redo/undo log sizes.

    Hi ,
    I have update statements that updates multiple columns at once if any of them is changed. What I see that even though the value of column is not changed it still increases the redo size.
    Below is a sample code similar to the ones in my code. Basically I check whether there is a difference in any of the columns to be updated and update all of them.
    Is there a way to improve redo log size without splitting the update statement for every column that I will be updating. Redo/Undo log size is a concern for us..
      For i In 1.rec.Count Loop
        Update employees e
           Set e.first_name = rec(i).first_name, e.last_name = rec(i).last_name
         Where e.first_name != rec(i).first_name
            Or e.last_name != rec(i).last_name;
      End Loop;My database is 10g.

    Muhammed Soyer wrote:
    Redo/Undo log size is a concern for us..You are worried about the wrong thing.
    If you are concerned about the amount of undo and redo, you should be less concerned about the small diffrence between updating 1 or 3 columns and remove the loop that is contributing to a massive increase in both undo and redo.
    Re: global temporary table row order
    Name                                  Run1        Run2        Diff
    STAT...undo change vector size     240,500   6,802,736   6,562,236
    STAT...redo size                 1,566,136  24,504,020  22,937,884Run2 shows what adding a loop to a regular SQL statement will do to undo and redo. It made the redo used 15 times greater and the undo almost 30 times greater.

  • Update multiple records with update button???

    I was wondering if someone could explain how I can use the developer tool box to update multiple records at once.
    I have a repeat region with a title and a check box if the item is active. I would like to update all records of the table at once. I have see folks state the developer tool box can do this. However I am not sure how..
    I am using php with mysql dreamweaver cs3

    Hi Chris,
    that can be done with first creating an ADDT "dynamic list", means to apply ADDT´s "Dynamic List Wizard" to an empty page -- this list will provide checkboxes for all displayed records, and here´s where you can select the to-be-updated (or deleted) records.
    Besides creating the list, this wizard will also be creating a blank "form" php page in the same directory, which is by default "tied" to the created list -- you´ll just need to open this blank document with DW and apply ADDT´s "Create Dynamic Form Wizard" to it. However, this form will contain all required routines for single and multiple updates, depending on how many records you select in the list.
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • Update a field multiple times, but only if the field is empty

    I am having trouble updating a field in my table based upon a set of 7 different rules. I have been scratching my head at this for a few days, and am not sure what exactly is wrong, but am sure there is something small causing me problems. My current code
    is:
    BEGIN TRANSACTION
    UPDATE MyTable
    SET Field1 = 'Value1'
    WHERE svc = 'Y' AND Field1 = '' ;
    COMMIT TRANSACTION
    BEGIN TRANSACTION
    UPDATE MyTable
    SET Field1 = 'Value2'
    WHERE Dlv Is Null AND Cat = 'svc' AND Field1 = '';
    COMMIT TRANSACTION
    BEGIN TRANSACTION
    UPDATE MyTable
    SET Field1 = 'Value2'
    WHERE (prod LIKE 'ABC%') OR (prod LIKE 'ABB%') AND Field1 = '';
    COMMIT TRANSACTION
    BEGIN TRANSACTION
    UPDATE MyTable
    SET Field1 = 'Value3'
    WHERE Dlv = 'Elec' AND Field1 = '';
    COMMIT TRANSACTION
    BEGIN TRANSACTION
    UPDATE MyTable
    SET Field1 = 'Value4'
    WHERE Ord = '0' AND Cat = 'Hdw' OR Cat = 'Bnd' AND Field1 = '';
    COMMIT TRANSACTION
    BEGIN TRANSACTION
    UPDATE MyTable
    SET Field1 = 'Value5'
    WHERE Ord = '0' AND (NOT (Cat = 'Hdw')) AND (NOT (Cat = 'Bnd')) AND Field1 = '';
    COMMIT TRANSACTION
    BEGIN TRANSACTION
    UPDATE MyTable
    SET Field1 = 'Value4'
    WHERE (Ind = '1' AND Cat = 'Hdw') OR (Cat = 'Bnd') AND Field1 = '';
    COMMIT TRANSACTION
    BEGIN TRANSACTION
    UPDATE MyTable
    SET Field1 = 'Value5'
    WHERE (Ind = '1' AND NOT (Cat = 'Hdw')) AND (NOT (Cat = 'Bnd')) AND Field1 = '';
    COMMIT TRANSACTION
    BEGIN TRANSACTION
    UPDATE MyTable
    SET Field1 = 'Value6'
    WHERE Ind = '0' AND Cat = 'Hdw' OR Cat = 'Bnd' AND Field1 = '';
    COMMIT TRANSACTION
    BEGIN TRANSACTION
    UPDATE MyTable
    SET Field1 = 'Value7'
    WHERE (Ind = '0' AND NOT (Cat = 'Hdw')) AND (NOT (Cat = 'Bnd')) AND Field1 = '';
    COMMIT TRANSACTION
    My biggest problem seems to be that between the piece that updates Field1 as either Value4 or Value5 is that something is not right. I initially had this set up in MS Access, and so am using that as a comparison
    to check my final values once the field has been udpated. When I run in Access I get a total of 9,802 for Value6 and 14,107 for Value4, yet when I run the SQL code I get 19,548 for Value 6 and 4,478 for Value4.
    I also get some differences for the other values, but nowhere near as large of a difference as with the 2 values above. I feel fairly confident that I have something not quite right with my syntax, but I cannot
    figure out exactly what it is. Field1 at the beginning of the query is inserted into the table as a blank value.
    Thanks.

    Combining OR and AND may be tricky, so I think your problem lies here:
    UPDATE MyTable
    SET Field1 = 'Value4'
    WHERE Ord = '0' AND Cat = 'Hdw' OR Cat = 'Bnd' AND Field1 = '';
    You can change this to
    UPDATE MyTable
    SET Field1 = 'Value4'
    WHERE (Ord ='0' AND Cat IN ('Hdw','Bnd')) AND Field1 = '';
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

Maybe you are looking for

  • All music gone, won't reload!

    I recently plugged my ipod mini into my computer to do some updating, adding music and so on. Then a message came up that said," iTunes can not read the contents of ipod "Mal's ipod". Use the ipod software updater application to restore the iPod to f

  • Photoshop CS6 crashed in OSX 10.8

    The splash screen stuck at "Measuring Memory..." and there were a lot of crash reports generated for dynamiclinkmanager Aug 22 18:32:22 PoPPaP-MBP com.apple.launchd.peruser.502[211] ([0x0-0xcd0cd].com.adobe.dynamiclinkmanager[1297]): Job appears to h

  • About RFC Adapter

    hi Expert's when i am configure sender RFC ADAPTER i am facing problem so plz help me in comm channel Rfc:server parameters application server gatway: it host name of sender system(sap abap) application server service: it..........................? w

  • BINTOHEX causing error "attribute type is invalid

    Hi Colleagues,   Just noticed one interesting CREATE COLUMN TABLE A_COLUMN( PK INTEGER PRIMARY KEY, F9 BLOB DEFAULT NULL SELECT   BINTOHEX("F9") FROM A_COLUMN; CREATE ROW TABLE A_ROW( PK INTEGER PRIMARY KEY, F9 BLOB DEFAULT NULL SELECT   BINTOHEX("F9

  • Why can't i add any app on ios to wish list?

    Many apps r big to download via 3G so i would like to add that app in my wish list to download later