SEARCH YOUR SOLUTION HERE  

Conflict detection updates more than one row when I only want one!

IhaveaMySqldatabasesetwithaprimarykeyof: cust_code Thisprimarykeycannotbechangedtoautoincrement,itmustbeassignedbyandcorrelatetoaseparateprogram! WhenIperformtheupdatecomandeveryrowthathasdatainanyfieldthatisthesameastheentryIamtryingtoupdateisupdatedinsteadofjusttheonethatthecustomercodecorrespondsto. Itseamsasifitisupdatinganyrowthathasduplicationsuchassamelastnames. Isuspectithassomethingtodowiththeconflictdetection,butIamnotsureifitcanbefixed. WhenIeliminatetheconflictdetectionforupdatingoneveryfieldbuttheprimarykey,itupdates(onlytheselectedentry)perfectly. However,thatreallydefeatsthepurposeofconflictdetection. Iwouldliketobeabletodetectandoverwriteconflictsonlywithinthecust_codethatisselectedforediting. Iwillneverbeabletoavoidduplicatenames,dollars,etc. Besidestheweb.configfile,theprogramisthreefiles:UpdatePrefCustomers.aspx prefcust_edit.aspx prefcust_insert.aspx UpdatePrefCustomers.aspxisusedtoaccesstheothertwoedit&insertpages. prefcust_insert.aspxdoesnothaveanyproblems,it'sonlyprefcust_edit.aspxthatisaproblem. Anyhelpwouldbegreatlyappreciated. Thefollowingistheaccesspage,UpdatePrefCustomers.aspx: PreferredCustomersatLawrencevilleHondaYamaha! functionConfirmOnDelete() { if(confirm("AreyousuretodeletethisPreferredCustomer")==true) returntrue; else returnfalse; } .style1{ text-align:center; margin-left:auto; margin-right:auto; } .style2{ text-align:center; font-size:60pt; font-family:Mistral; color:#0000FF; } h1{color:#003366;font-size:24px;margin:0px00px0; line-height:6px;} .style3{ text-align:center; font-size:x-large; } .style4{ text-align:center; margin-top:0; margin-bottom:0; } .style5{ text-align:center; font-size:60pt; font-family:Mistral; } LawrencevilleHondaYamaha PREFERREDCUSTOMERS Tosort,clickoncolumnheader. Delete
This next one is the problem child! I cannot bold the code, so, lines 118 through 131are the linesthat makethe page work when I remove them. protected void DetailsView1_ModeChanging(Object sender, System.Web.UI.WebControls.DetailsViewModeEventArgs e) { if (e.CancelingEdit == true) { Response.Redirect("UpdatePrefCustomers.aspx"); } } protected void srcPrefCustomersEdit_Updated(object sender, SqlDataSourceStatusEventArgs e) { if (e.AffectedRows == 0) lblMessage.Text = "Could not update record because it has changed since you opened this page"; else Response.Redirect("UpdatePrefCustomers.aspx"); } Edit Preferred Customers

The following is prefcust_insert.aspx which is not causing a problem: protected void DetailsView1_ItemInserted(Object sender, System.Web.UI.WebControls.DetailsViewInsertedEventArgs e) { Response.Redirect("UpdatePrefCustomers.aspx"); } protected void DetailsView1_ModeChanging(Object sender, System.Web.UI.WebControls.DetailsViewModeEventArgs e) { if (e.CancelingEdit == true) { Response.Redirect("UpdatePrefCustomers.aspx"); } } Insert Preferred Customers

Posted On: Tuesday 20th of November 2012 04:29:19 AM Total Views:  348
View Complete with Replies




Related Messages:

Query conflicting results   (101 Views)
I am just puzzeled by the results from the following Queries I am checking for duplicates using a view. First query checks for duplicates on DW_BU_ID from March 2000 forward. The second query looks thoughout all the view. (about 5 years 1995 to present ). Why I is the results set for the whole view not including the results from the first. I was expecting 4 rows from the second query... Is there a problem with this shoud the result of the second query include all DW_BU_ID's 748866 755564 298978 306199 SQL> select cycle_eom_Date, dw_bu_id,count(*) from vw_tbl_risk_onus_unit_Oracle2n 2 where cycle_eom_date > '28-FEB-00' 3 having count(*) > 1 4 group by cycle_eom_date, dw_bu_Id 5 order by cycle_eom_date, dw_bu_Id; CYCLE_EOM DW_BU_ID COUNT(*) --------- ---------- ---------- 31-JAN-01 748866 2 31-JAN-01 755564 2 Elapsed: 00:08:521.69 SQL> SQL> select cycle_eom_Date, dw_bu_id, count(*) from vw_tbl_risk_onus_unit_Oracle2n 2 having count(*) > 1 3 group by cycle_eom_date, dw_bu_Id 4 order by cycle_eom_date, dw_bu_Id; CYCLE_EOM DW_BU_ID COUNT(*) --------- ---------- ---------- 31-JAN-98 298978 2 30-JUN-98 306199 2 Any suggestions will be appreciated>.. Thank you, Cristina
ORA-30372: fine grain access policy conflicts with materialized view   (539 Views)
Hi all, I'm trying to create materialized view with a query on two tables which are protected by RLS. In the Metalink note 158187.1 there is an explaination : "to solve this problem you must define the policy function to return a NULL policy during create and refresh operations on the materialized view". I've created two functions ,as they explained on both of the secured tables: SQL> create or replace FUNCTION FILTERS_TREE_sec (D1 VARCHAR2, D2 VARCHAR2) RETURN VARCHAR2 2 IS 3 d_predicate VARCHAR2 (2000); 4 BEGIN 5 IF USER = 'TRP' 6 THEN 7 RETURN ''; 8 END IF; 9 d_predicate := 'uname = SYS_CONTEXT(''FILTERS_TREE'', ''uname'')'; 10 RETURN D_predicate; 11 END FILTERS_TREE_sec; 12 / Function created. SQL> create or replace FUNCTION TBL_SUSPECTED_NUMBERS_sec (D1 VARCHAR2, D2 VARCHAR2) RETURN VARCHAR2 2 IS 3 d_predicate VARCHAR2 (2000); 4 BEGIN 5 IF USER = 'TRP' 6 THEN 7 RETURN ''; 8 END IF; 9 d_predicate := 'uname = SYS_CONTEXT(''TBL_SUSPECTED_NUMBERS'', ''uname'')'; 10 RETURN D_predicate; 11 END TBL_SUSPECTED_NUMBERS_sec; 12 / Function created. User TRP is the schema which own all the tables and suppose to create and refresh the snapshot. After createing the functions,i've been trying to create the snapshot and i've failed again: SQL> CREATE SNAPSHOT mw_general_alerts 2 STORAGE (INITIAL 1m NEXT 1m MINEXTENTS 1 MAXEXTENTS 999 PCTINCREASE 0) LOGGING 3 TABLESPACE general_alerts 4 BUILD IMMEDIATE 5 REFRESH FORCE 6 START WITH sysdate 7 NEXT sysdate + 6/24 8 as 9 select tsn.alert_id, 10 tsn.filter_id, 11 ft.TITLE as filter_name, 12 tsn.expire_time, 13 tsn.alert_time, 14 tsn.alert_virtual_time, 15 tsn.alert_open, 16 tsn.severity, 17 tsn.on_call, 18 tsn.number_of_cdrs, 19 tsn.call_id, 20 tsn.cdr_source, 21 tsn.lccore_id, 22 tsn.ring_id, 23 tsn.unique_num, 24 tsn.completed, 25 tsn.log_flag, 26 tsn.cdr_id_1, 27 tsn.cdr_source_1, 28 tsn.cdr_id_2, 29 tsn.cdr_source_2, 30 tsn.channel_key, 31 get_entity_name(tsn.filter_id,1) as entity_name_1, 32 get_entity_value(tsn.filter_id,1,alert_id) as entity_value_1, 33 get_entity_name(tsn.filter_id,2) as entity_name_2, 34 get_entity_value(tsn.filter_id,2,alert_id) as entity_value_2, 35 tsn.update_time 36 from tbl_suspected_numbers tsn,filters_tree ft 37 where tsn.filter_id=ft.filter_id; where tsn.filter_id=ft.filter_id * ERROR at line 37: ORA-30372: fine grain access policy conflicts with materialized view Any ideas
materialized view updates   (280 Views)
I'm having trouble with getting a materialized view with fast refresh to update. I'm working between two schemas and have the global query rewrite privilege for both users. I've run the catrep.sql script as system and as sys to make sure it had been run and find that it has a lot of packages that don't compile, which I guess is expected as I'm not using Advanced Replication, just mviews. I think the problem is that I can't get the dbms_snapshot package to compile so can't even update the view manually. Is there another script I need to run to make the materialized view updates to work Some other privilege or variable I've granted permissions on tables, views, materialized views, triggers, and snapshots to both users. The log does get entries but never sends them to the views. I have a base table and a log on the table in schema 1. I have a materialized view in schema 2: (this is in preparation for having the base table and view in two separate databases and versions of Oracle.) create materialized view log on schema1.document tablespace app_mview with primary key ( list columns needed); create materialized view schema2.doc_mv pctfree 0 tablespace app_mview storage (initial 128k next 128k pctincrease 0) refresh fast start with sysdate next sysdate + 1/1440 as select * from schema1.document Does anyone know where my problem might be
updates lost at snapshot site   (142 Views)
friends I configured a Advanced updateable snapshot site. Recently during Manual refresh what i observed is,even though the manual refresh able to complete with some errors for update,delete and insert.But the unusual thing is once the manual refresh is comlete all the changes made at Snapshot site lost and the data was there similar to Master site before update.Why this happend.Any one can able to give their remarks and sujjestions on this as early as possible as now i stopped the replicaton between snapshot site and Master site. regards akhadar
Query conflicting results   (102 Views)
I am just puzzeled by the results from the following Queries I am checking for duplicates using a view. First query checks for duplicates on DW_BU_ID from March 2000 forward. The second query looks thoughout all the view. (about 5 years 1995 to present ). Why I is the results set for the whole view not including the results from the first. I was expecting 4 rows from the second query... Is there a problem with this shoud the result of the second query include all DW_BU_ID's 748866 755564 298978 306199 SQL> select cycle_eom_Date, dw_bu_id,count(*) from vw_tbl_risk_onus_unit_Oracle2n 2 where cycle_eom_date > '28-FEB-00' 3 having count(*) > 1 4 group by cycle_eom_date, dw_bu_Id 5 order by cycle_eom_date, dw_bu_Id; CYCLE_EOM DW_BU_ID COUNT(*) --------- ---------- ---------- 31-JAN-01 748866 2 31-JAN-01 755564 2 Elapsed: 00:08:521.69 SQL> SQL> select cycle_eom_Date, dw_bu_id, count(*) from vw_tbl_risk_onus_unit_Oracle2n 2 having count(*) > 1 3 group by cycle_eom_date, dw_bu_Id 4 order by cycle_eom_date, dw_bu_Id; CYCLE_EOM DW_BU_ID COUNT(*) --------- ---------- ---------- 31-JAN-98 298978 2 30-JUN-98 306199 2 Any suggestions will be appreciated>.. Thank you, Cristina
updates causing loads of redo?   (198 Views)
We have an issue where the log switches every 4 minutes on a 'test' database, i.e. not doing much, just a few tests. I have checked the log miner and discovered that an unsupported procedure was doing 41,000+ updates every 4 minutes: SQL> @logmnr_results OPERATION SEG_OWNER SEG_NAME COUNT(*) ---------------------------------------- -------------------- UNSUPPORTED LIMARES ALLOCATION_HOLD_MAP 41024 UNSUPPORTED SYS SEQ$ 2 On checking the procedure ALLOCATION_HOLD_MAP it updates all 864 columns table to null every 5 seconds. Apparently this needs to be done this way, so we can ensure the data is refreshed for new data! Anyway, I am assuming that these 41000+ entries in the log file are related to these updates (updating 864 columns in the table, every 5 seconds within approx. 4 minutes. Here is the equation (60/5*4=45, 48*864=41,472). My question is, why is this update have 41000+ entries in the log file Does each column updated represent one entry Rgds. Sheryl
replication conflict resolution   (193 Views)
, I get the following error when i replicate. How can we solve this How the conflict resolution works here or how to implement conflict resolution. Mon Jul 23 08:52:42 2001 Errors in file e:\admin\prod\bdump\prodSNP4.TRC: ORA-12012: error on auto execute of job 116 ORA-23324: error ORA-02068: following severe error from DATA_HK_PROD ORA-00001: unique constraint (ACTSLAB.PK_TEST_STMNT) violated ORA-06512: at "ACTSLAB.TEST_STMNT$RP", line 98 ORA-01085: preceding errors in deferred rpc to "ACTSLAB.TEST_STMNT$RP.REP_INSERT" ORA-02063: preceding 3 lines from DATA_HK_PROD, while creating deferror entry at "DATA_HK_PROD.WORLD" with error -1 ORA-06512: at "SYS.DBMS_DEFER_SYS", line 901 ORA-06512: at line 1
Multiple updates or insertions   (238 Views)
everybody, I have an application which has been built on Asp.net with framwork 1.1 and Oracle 9i as database. I have a table named sequencetable which stores the serial numbers for the master tables. When the save button is clicked Iamfetching the maximum of the serial number for the particular master table from the sequence table and then updating the sequencetable as well assaving it into the mastertable with some other details . My problem is that sometimes two or more clients are saving the record at the same time. If this is the case then the same serial number is generated for those clients and they are getting an error like primary key voilated. How can I avoid or over this situation I would like to know if there is a way that only one client gets the access to that particular row in the table at a time and the other request should be under waiting state until the first client is finised with the updating part. I would be
conflict in program   (116 Views)
i have aspx page which works fine on one server that has microsoft excel installl and on other server it gives me error at the following line my program does the update in excel file when user use the page myCommand.ExecuteNonQuery() 'Execute the UPDATE query can anyone tell me the reason why same program works good on one server but does not on the other server only difference is again samething microsoft excel is install on server where it works and is not on where it does not work
Replication-unique conflict   (142 Views)
Dear friends When Iam resolving a Unique conflict by executing the following procedure i got the following error .Can any one help me out with this error SQL> BEGIN 2 DBMS_REPCAT.ADD_UNIQUE_RESOLUTIION( 3 SNAME => 'CIDOW01', 4 ONAME => 'GA_LISTDATA', 5 CONSTRAINT_NAME => 'CPK_LISTDATA', 6 SEQUENCE_NO => 1, 7 METHOD => 'APPEND SEQUENCE', 8 COMMENT => 'RESOLVE CONFLICT', 9 PARAMETER_COLUMN_NAME => 'LIST_ID'); 10 END; 11 / DBMS_REPCAT.ADD_UNIQUE_RESOLUTIION( * ERROR at line 2: ORA-06550: line 2, column 15: PLS-00302: component 'ADD_UNIQUE_RESOLUTIION' must be declared ORA-06550: line 2, column 3: PL/SQL: Statement regards akhadar
Dataset updates but not database?   (222 Views)
Any help with this problem would be much appreciated. I'm fairly certain my method of updating isn't best practice in any case so I'd be very grateful for any pointers on that as well. I basicallyhave just a simple edit form for updating 'events' in an Oracle DB. When the Update button is clicked from the form it callsUpdateEvent below and appears to successfully update the dataset itself (I also have a datagrid on the page for testing - in the updateevent function the dataset is rebound to the datagrid and correctly shows the changes to the dataset). The databaseitself, however, is an entirely different story and reflects no changes at all.... OleDbConnection oraConn; OleDbDataAdapter resAda; DataSet DataSet1; void Page_Load(Object o, EventArgs e) { oraConn = new OleDbConnection("Provider=MSDAORA;Data Source=xxxxxxxxx;User Id=xxxxxx;Password=xxxxxxx"); resAda = new OleDbDataAdapter("Select * from event_table where event_id="+Request.QueryString["eventid"], oraConn); DataSet1 = new DataSet(); resAda.Fill(DataSet1,"Events"); Results.DataSource = DataSet1; if (!IsPostBack) { DataBind(); } } void UpdateEvent(Object o, EventArgs e) { OleDbCommandBuilder temp = new OleDbCommandBuilder(resAda); resAda.UpdateCommand = temp.GetUpdateCommand(); DataSet1.Tables[0].Rows[0]["LOCATION"] = location.Text; DataSet1.AcceptChanges(); Results.DataSource = DataSet1; Results.DataBind(); resAda.Update(DataSet1,"Events"); }
user function for delete_conflict_resolution   (238 Views)
How to attach a user function with delete conflict resolution method. I prepared a function like the following create or replace function hims.delete_conflict_solution(old IN NUMBER, new IN OUT NUMBER, cur IN NUMBER,ignore_discard_flag OUT BOOLEAN) return boolean as begin ignore_discard_flag := TRUE ; RETURN TRUE ; end; / create public synonym delete_conflict_solution for hims.delete_conflict_solution ; Then issued the conflict resolution routine in the following way.. EXECUTE dbms_repcat.add_delete_resolution(sname=>'BILL',oname=>'BILLCATEGORY', Sequence_no=>1,parameter_column_name=>'*',function_name=>'DELETE_CONFLICT_RESOLUTION',method=>'USER FUNCTION'); statement was successfull and so I regenerated support for that object. But onething was not possible for me to generate replication support for function. but is it causes any problem as function is existing at both master sites I'm in need of a solution urgently as my piolot testing is in pending only becuase of that.. I would appreciate ur suggestions with samples Rgds Binu
Reverting updates done to database MS SqlServer   (228 Views)
Hi Friends, One of my friend did updates to database by directly running the update query to the web hosting server database and due to his misfortune he did mistake by executing wrong query ie not providing proper conditions in the where clause which bought database to an inconsistent state. I want to know that is there any method by which we can revert those changes. Hope anyone can help.
multiple updates   (264 Views)
I want to have a form on my site what will bring up a number of rows of data from the MySQL database including the unique key and a user editable quantity field. Users will be able to modify mutliple rows on the form before submitting the page back. I have the page working to be able to identify which lines the quantities have been altered on and now need to be able to go back to the DB and update the relevant rows. For a single row update it is obviously the easy and along the lines of: UPDATE tablename SET quantitycolumn = 'info from form' WHERE uniquekey = 'hidden info from form' Where visitors update multiple rows I am uncertain how to most efficiently deal with these.... is there a way of joining the update commands
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.   (275 Views)
Using Visual Studio with MySQL. In my XSD dataset I created a query. It runs perfect. I can preview the data fine. In my BLL I wrote code (see below) to retrieve the query results and I'm getting... Using db As New dsDemoTableAdapters.DemoTableAdapter Dim dt As New DataTable dt = db.GetDemo(DemoId) ' ERROR HAPPENS HERE Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. Why would previewing the data work but in code it fails Any ideas
No value given for one or more required parameters.   (330 Views)
, I am getting the "No value given for one or more required parameters."when importing an Excel 2003 spreadsheet into my web site. I have pinpointed the problem to be the last column in my SELECT statement. This column does not seem to be a reserved word and the the data in the column 'POS' and 'HMO' seems fine as well. The SELECT code is posted below as well as 4 other columns I am having the same problem (they are commented out for now). Any help solving this problem would be greatly appreciated. DimobjCommandAsNewOleDbCommand("SELECT[EmployeeName]asEmployee, "&_ "[ResidenceZipCode]asZipCode,"&_ "[Position]asEmpPos,"&_ "[FTExempt,FTNonExempt,PTExempt,PTNonExempt]asExempt,"&_ "[AnnualSalaryORHourlyRate]asRate,"&_ "[HoursPerPayCycle]asHoursPerPayCycle,"&_ "[DateofBirth]asDateOfBirth,"&_ "[Gender]asGender,"&_ "[Status:ActiveorCOBRA]asAorCStatus,"&_ "[PlanName]asPlnName"&_ "FROM[Census$]",objXConn) '"[WorkersCompCategory]asWorkersComp,"&_ '"[MedicalTier:EEOnly,EE&Child(ren),EE&Spouse,Family,Waived,NotEligible]asMedicalTier"&_ '"[#ofChildren]asNrChildren,"&_ '"[DentalTier:EEOnly,EE&Child(ren),EE&Spouse,Family,Waived,NotEligible]asDentalTier"&_
One or more errors occurred during processing of command. ORA-00936: missing expression   (388 Views)
Could SomeOne Help Me I got this error massage: One or more errors occurred during processing of command. ORA-00936: missing expression Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.OleDb.OleDbException: One or more errors occurred during processing of command. ORA-00936: missing expression Line 56: & " Order By CourseName" Line 57: Conncmd = New OleDbCommand(strSQL, dbConn) Line 58: dr = Conncmd.ExecuteReader() Line 59: ddlCourse.DataSource = dr Line 60: ddlCourse.DataBind() My Code If Not Page.IsPostBack Then Dim Conn As New ConnClss() Dim dbConn As OleDbConnection Dim strSQL As String Dim Conncmd As OleDbCommand Dim dr As OleDbDataReader dbConn = Conn.GetConn() dbConn.Open() strSQL = "Select Distinct(CourseID), CourseName" _ & " From Course Where CourseID In (Select CourseID From Section_tbl Where CollegeID=" & Session("CollegeID") & ")" _ & " Order By CourseName" Conncmd = New OleDbCommand(strSQL, dbConn) dr = Conncmd.ExecuteReader() ddlCourse.DataSource = dr ddlCourse.DataBind() dr.Close()
connect to remore oracle database from asp.net application   (365 Views)
I have visual stuido.net, oracle client 9.i on my machine. I am just trying to write an asp.net application to access data from remore oracle database. Could somebody direct me to right direction or any sample application regarding same. I would apprciate your help
taking more time to retreive data ?   (168 Views)
it taking more time to get retreive data from remote database.my sql query is select sum(b_date,e_date)*60*60*60 from t_table where b_date >='02-may-2001' and e_date
oracle clob datatype length more 32000   (249 Views)
Hi Friends i am using a microsoft enterprise library for oracle data base. we return an output value of clob datatype in oracle of character lengthmore thant 32000.How to handle this type problems in C#.net.if the passing a varible of string ,it chara cter limit is 32000.if than 32000 ,how to handle this in enterprise library.