Putting Duplicate Keys in a Hashtable.Please assist
Folks,
I wud like to put duplicate keys into a Hashtable,so that the Hashtable looks like:
Entertainment,Video;
Entertainment,Pictures;
Entertainment,Camera;
where Entertainment is the key:
So I am using the flwg code:
public class TestHashTable {
public static void main(String[] args){
Hashtable balance = new Hashtable();
HashMap hm = new HashMap();
Enumeration names;
String str;
balance.put("Entertainment",helperMethodAddToList(hm, "Entertainment", "Camera"));
balance.put("Entertainment",helperMethodAddToList(hm, "Entertainment", "Video"));
balance.put("Entertainment",helperMethodAddToList(hm, "Entertainment", "Pictures"));
names = balance.keys();
while(names.hasMoreElements()){
str = (String)names.nextElement();
System.out.println(str + ":" + balance.get(str));
} // End of main.
private static List helperMethodAddToList(Map m, String key, String value) {
List vals = (List)m.get(key);
if (vals == null) {
vals = new LinkedList();
m.put(key, vals);
vals.add(value);
return vals;
}The output comes this way:
Entertainment:[Camera, Video, Pictures]
I dont want it this way but as shown on 1st Line
Is this possible? Am I missing something?
import java.util.*;
public class X {
public static void main(String[] args) {
HashMap map = new HashMap();
map.put("a", toList(new String[] {"alabama", "arkansas", "alaska"}));
map.put("n", toList(new String[] {"nevada", "new mexico", "north dakota"}));
map.put("w", toList(new String[] {"wyoming", "west virgina"}));
dump(map);
static List toList(String[] strings) {
return new ArrayList(Arrays.asList(strings));
static void dump(Map map) {
for(Iterator i = map.entrySet().iterator(); i.hasNext(); ) {
Map.Entry entry = (Map.Entry) i.next();
System.out.print("key=" + entry.getKey() + ", values=");
List values = (List) entry.getValue();
for(Iterator j=values.iterator(); j.hasNext(); ) {
String state = (String) j.next();
System.out.print(state + ", ");
System.out.println();
}
Similar Messages
-
Hi,
I have a class I created, call it MyClass. It looks like this:
public String myString;
public final String toString() {
return myString;
public boolean equals(MyClass mc) {
return (mc != null && myString.equalsIgnoreCase(mc.toString()));
}When I use objects of type MyClass as the keys to a HashMap when doing a put(), duplicate keys seem to be allowed. And when I query, knowing that I have an entry for a key, I get null. However, when I change my get() and put() to use MyClass.toString() as the key, everything works fine.
It seems to me that the JVM must be assuming that different instances of objects of type MyClass are different and thus a new key+value is created when "putting" instead of the old value being overwritten. But MyClass has an equals() method, so when putting, why doesn't it tell the JVM that the key already exists?
Thanks,
JeffTrue, I missed that.
Were you thinking that the HashMap is going to use the equals you provide that takes MyClass as an arg? It won't. It uses the one that takes Object, which means you'll be using Object's equals, which compares references, so no MyClass can ever be equal to another.
You need to override equals (with the Object argument) and override hashCode. -
Dear All
The 'L' key on my macbook is still not functioning. I got a response from chrisfromhopewell and tried what he said, but its still not functioning. Can someone please assist me. I was using Universal Access before when I had visual problems so this might have caused the problem. but have turned universal access off, so I dont know what else to try. Can someone pleeeze help?
Thanks VeedeekayThanks King_Penguin for taking time to read and reply.
I just purchased this movie on Thursday, May 15, so just a few days ago. I have never had any trouble whatsoever since I have been in Vietnam. I have downloaded several movies and even music and they have all synced to my respected Apple products except for this purchase.
Sorry, I don't quite understand what you mean by studios and different versions. Could you please explain?
I checked my purchased list in my purchase history under my account and there are no hidden items. -
Duplicate message and Duplicate key error in Moni and RWB
Hi,
I am getting very frequent issues of Duplicate messages in production system moni and RWB.
Moni error: (IDOC to JMS) Errors are coming in call adapter step:
com.sap.engine.interfaces.messaging.api.exception.MessagingException: Could not insert message 005056aa-730e-1ed4-a6c9-a01ee2b86cb3(INBOUND) into duplicate check table. Reason: com.sap.sql.exception.OpenSQLException: Connection reset by peer: socket write error OpenSQLExceptionCategories: [RECOVERABLE]
RWB error: (File toIdoc) Errors are coming in sender channel.
MP: exception caught with cause com.sap.engine.interfaces.messaging.api.exception.DuplicateMessageException: Message Id a6d559cf-b00c-11e4-b786-00000daf354a(OUTBOUND) already exists in duplicate check table: com.sap.sql.exception.OpenSQLIntegrityConstraintViolationException: Violation of PRIMARY KEY constraint 'PK__BC_MSG_D__99C1915D3DE9247A'. Cannot insert duplicate key in object 'SAPPGXDB.BC_MSG_DUP_CHECK'. The duplicate key value is (a6d559cf-b00c-11e4-b786-00000daf354a, OUTBOUND). OpenSQLExceptionCategories: [NON_TRANSIENT, INTEGRITY_CONSTRAINT_VIOLATION
Moni errors are manually reprocessed and RWB are automatic.
Can you please let me know if there is any solution available for these issues?
Thanks
Navneet.I'm getting the same issue at my current client:-
Putting message into send queue failed, due to: com.sap.engine.interfaces.messaging.api.exception.DuplicateMessageException: Message Id e1d4a31b-f0cc-11e4-c7fb-0000029706f7(OUTBOUND) already exists in duplicate check table: com.sap.sql.exception.OpenSQLIntegrityConstraintViolationException: ORA-00001: unique constraint (SAPSR3DB.SYS_C00188646) violated OpenSQLExceptionCategories: [NON_TRANSIENT, INTEGRITY_CONSTRAINT_VIOLATION]
I've tried restarting the SOAP channel but this has not resolved the problem.
Just read on another thread that this may be a misleading error message (see last post on the link). It may be an idea to increase the trace level temporarily and look for any other issues that may be the cause.
So far I've not seen any post that describes the error on the SOAP channel - only seeing it for JDBC & File. However it seems to be a common problem across a number of sender channels. -
When we try to deploy a wsp to sharepoint containing code to generate quick launch menu we get the following error messages when running the last enable-spfeature command in powershell. The same code is working in the development environment, but when we
deploy to a test server the following error occurs:
Add-SPSolution "C:\temp\ImpactSharePoint.wsp"
Install-SPSolution -Identity impactsharepoint.wsp -GACDeployment
Enable-SPFeature impactsharepoint_branding -url http://im-sp1/sites/impact/
Enable-SPFeature impactsharepoint_pages -url http://im-sp1/sites/impact/
From UlsViewer.exe:
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
Database 880i
High System.Data.SqlClient.SqlException (0x80131904): Cannot insert duplicate key row in object 'dbo.NavNodes' with unique index 'NavNodes_PK'. The duplicate key value is (6323df8a-5c57-4d3e-a477-09aa8b66100a, 7ae114df-9d52-4b08-affa-8c544cbc27b6,
1000). The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj,
Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior
runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
behavior) at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock) ClientConnectionId:2bb4004c-aa75-470e-b11e-dbf1c476aaed
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
Database 880k
High at Microsoft.SharePoint.SPSqlClient.ExecuteQueryInternal(Boolean retryfordeadlock) at Microsoft.SharePoint.SPSqlClient.ExecuteQuery(Boolean retryfordeadlock) at Microsoft.SharePoint.Library.SPRequestInternalClass.AddNavigationNode(String
bstrUrl, String bstrName, String bstrNameResource, String bstrNodeUrl, Int32 lType, Int32 lParentId, Int32 lPreviousSiblingId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav, String& pbstrDateModified) at Microsoft.SharePoint.Library.SPRequestInternalClass.AddNavigationNode(String
bstrUrl, String bstrName, String bstrNameResource, String bstrNodeUrl, Int32 lType, Int32 lParentId, Int32 lPreviousSiblingId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav, String& pbstrDateModified) at Microsoft.SharePoint.Library.SPRequest.AddNavigationNode(String
bstrUrl, String bstrName, String bstrNameResource, String bstrNodeUrl, Int32 lType, Int32 lParentId, Int32 lPreviousSiblingId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav, String& pbstrDateModified) at Microsoft.SharePoint.Navigation.SPNavigationNode.AddInternal(Int32
iPreviousNodeId, Int32 iParentId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav) at Microsoft.SharePoint.Navigation.SPNavigationNodeCollection.AddInternal(SPNavigationNode node, Int32 iPreviousNodeId) at ImpactSharePoint.ConfigureSharePointInstance.NavigationConfig.<ConfigureQuickLaunchBar>b__0()
at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass5.<RunWithElevatedPrivileges>b__3() at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback
secureCode, Object param) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode) at ImpactSharePoint.ConfigureSharePointInstance.NavigationConfig.ConfigureQuickLaunchBar() at ImpactSharePoint.Features.Pages.PagesEventReceiver.FeatureActivated(SPFeatureReceiverProperties
properties) at Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce) at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, SPFeatureActivateFlags
activateFlags, Boolean fForce) at Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean fMarkOnly)
at Microsoft.SharePoint.SPFeature.ActivateDeactivateFeatureAtWeb(Boolean fActivate, Boolean fEnsure, Guid featid, SPFeatureDefinition featdef, String urlScope, String sProperties, Boolean fForce) at Microsoft.SharePoint.SPFeature.ActivateDeactivateFeatureAtScope(Boolean
fActivate, Guid featid, SPFeatureDefinition featdef, String urlScope, Boolean fForce) at Microsoft.SharePoint.PowerShell.SPCmdletEnableFeature.UpdateDataObject() at Microsoft.SharePoint.PowerShell.SPCmdlet.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord() at System.Management.Automation.CommandProcessorBase.DoExecute() at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object
input, Hashtable errorResults, Boolean enumerate) at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][]
commandRedirections, FunctionContext funcContext) at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0
arg0) at System.Management.Automation.DlrScriptCommandProcessor.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess) at System.Management.Automation.CommandProcessorBase.DoComplete() at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(CommandProcessorBase
commandRequestingUpstreamCommandsToStop) at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate) at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()
at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc() at System.Management.Automation.Runspaces.PipelineThread.WorkerProc() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,
ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
Database 880j
High SqlError: 'Cannot insert duplicate key row in object 'dbo.NavNodes' with unique index 'NavNodes_PK'. The duplicate key value is (6323df8a-5c57-4d3e-a477-09aa8b66100a, 7ae114df-9d52-4b08-affa-8c544cbc27b6, 1000).'
Source: '.Net SqlClient Data Provider' Number: 2601 State: 1 Class: 14 Procedure: 'proc_NavStructAddNewNode' LineNumber: 92 Server: 'IMPACTCLUSTER\IMPACTDB'
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
Database 880j
High SqlError: 'The statement has been terminated.' Source: '.Net SqlClient Data Provider' Number: 3621 State: 0 Class: 0 Procedure: 'proc_NavStructAddNewNode' LineNumber: 92 Server: 'IMPACTCLUSTER\IMPACTDB'
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
Database tzku
High ConnectionString: 'Data Source=IMPACTCLUSTER\IMPACTDB;Initial Catalog=WSS_Content;Integrated Security=True;Enlist=False;Pooling=True;Min Pool Size=0;Max Pool Size=100;Connect Timeout=15;Application Name=SharePoint[powershell][1][WSS_Content]'
Partition: 6323df8a-5c57-4d3e-a477-09aa8b66100a ConnectionState: Closed ConnectionTimeout: 15
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
Database tzkv
High SqlCommand: 'BEGIN TRAN DECLARE @abort int SET @abort = 0 DECLARE @EidBase int,@EidHome int SET @EidBase = 0 SET @EidHome = NULL IF @abort = 0 BEGIN EXEC @abort = proc_NavStructAllocateEidBlockWebId @wssp0, @wssp1,
@wssp2, @wssp3, @EidBase OUTPUT SELECT @wssp4 = @EidBase, @wssp5 = @abort END IF @abort = 0 BEGIN EXEC @abort = proc_NavStructAddNewNodeByUrl '6323DF8A-5C57-4D3E-A477-09AA8B66100A','7AE114DF-9D52-4B08-AFFA-8C544CBC27B6',1,2072,-1,0,N'sites/impact/default.aspx',N'PersonSøk',N'PersonSøk',NULL,0,0,0,NULL,@EidBase,@EidHome
OUTPUT SELECT @wssp6 = @abort END IF @abort = 0 BEGIN EXEC proc_NavStructLogChangesAndUpdateSiteChangedTime @wssp7, @wssp8, NULL END IF @abort <> 0 BEGIN ROLLBACK TRAN END ELSE BEGIN COMMIT TRAN END IF @abort = 0 BEGIN EXEC proc_UpdateDiskUsed
'6323DF8A-5C57-4D3E-A477-09AA8B66100A' END ' CommandType: Text CommandTimeout: 0 Parameter: '@wssp0' Type: UniqueIdentifier Size: 0 Direction: Input Value: '6323df8a-5c57-4d3e-a477-09aa8b66100a' Parameter: '@wssp1'
Type: UniqueIdentifier Size: 0 Direction: Input Value: '7ae114df-9d52-4b08-affa-8c544cbc27b6' Parameter: '@wssp2' Type: Int Size: 0 Direction: Input Value: '1' Parameter: '@wssp3' Type: Int Size: 0 Direction: Input Value: '2072'
Parameter: '@wssp4' Type: Int Size: 0 Direction: Output Value: '2072' Parameter: '@wssp5' Type: Int Size: 0 Direction: Output Value: '0' Parameter: '@wssp6' Type: Int Size: 0 Direction: Output Value: '10006'
Parameter: '@wssp7' Type: UniqueIdentifier Size: 0 Direction: Input Value: '6323df8a-5c57-4d3e-a477-09aa8b66100a' Parameter: '@wssp8' Type: UniqueIdentifier Size: 0 Direction: Input Value: '7ae114df-9d52-4b08-affa-8c544cbc27b6'
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
Database aek90
High SecurityOnOperationCheck = True
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
Database d0d6
High System.Data.SqlClient.SqlException (0x80131904): Cannot insert duplicate key row in object 'dbo.NavNodes' with unique index 'NavNodes_PK'. The duplicate key value is (6323df8a-5c57-4d3e-a477-09aa8b66100a, 7ae114df-9d52-4b08-affa-8c544cbc27b6,
1000). The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj,
Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior
runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
behavior) at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock) at Microsoft.SharePoint.SPSqlClient.ExecuteQueryInternal(Boolean
retryfordeadlock) at Microsoft.SharePoint.SPSqlClient.ExecuteQuery(Boolean retryfordeadlock) ClientConnectionId:2bb4004c-aa75-470e-b11e-dbf1c476aaed
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
Database ad194
High ExecuteQuery failed with original error 0x80131904
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
Database 8z23
Unexpected Unexpected query execution failure in navigation query, HResult -2146232060. Query text (if available): "BEGIN TRAN DECLARE @abort int SET @abort = 0 DECLARE @EidBase int,@EidHome int SET @EidBase
= 0 SET @EidHome = NULL IF @abort = 0 BEGIN EXEC @abort = proc_NavStructAllocateEidBlockWebId @wssp0, @wssp1, @wssp2, @wssp3, @EidBase OUTPUT SELECT @wssp4 = @EidBase, @wssp5 = @abort END IF @abort = 0 BEGIN EXEC @abort = proc_NavStructAddNewNodeByUrl '6323DF8A-5C57-4D3E-A477-09AA8B66100A','7AE114DF-9D52-4B08-AFFA-8C544CBC27B6',1,2072,-1,0,N'sites/impact/default.aspx',N'PersonSøk',N'PersonSøk',NULL,0,0,0,NULL,@EidBase,@EidHome
OUTPUT SELECT @wssp6 = @abort END IF @abort = 0 BEGIN EXEC proc_NavStructLogChangesAndUpdateSiteChangedTime @wssp7, @wssp8, NULL END IF @abort <> 0 BEGIN ROLLBACK TRAN END ELSE BEGIN COMMIT TRAN END IF @abort = 0 BEGIN EXEC proc_UpdateDiskUsed
'6323DF8A-5C57-4D3E-A477-09AA8B66100A' END "
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
General 8kh7
High <nativehr>0x8107140d</nativehr><nativestack></nativestack>An unexpected error occurred while manipulating the navigational structure of this Web.
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
General aix9j
High SPRequest.AddNavigationNode: UserPrincipalName=i:0).w|s-1-5-21-2030300366-1823906440-2562684930-2106, AppPrincipalName= ,bstrUrl=http://im-sp1/sites/impact ,bstrName=PersonSøk ,bstrNameResource=<null> ,bstrNodeUrl=/sites/impact/default.aspx
,lType=0 ,lParentId=2072 ,lPreviousSiblingId=-1 ,bAddToQuickLaunch=False ,bAddToSearchNav=False
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
General ai1wu
Medium System.Runtime.InteropServices.COMException: <nativehr>0x8107140d</nativehr><nativestack></nativestack>An unexpected error occurred while manipulating the navigational structure of this
Web., StackTrace: at Microsoft.SharePoint.Navigation.SPNavigationNode.AddInternal(Int32 iPreviousNodeId, Int32 iParentId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav) at Microsoft.SharePoint.Navigation.SPNavigationNodeCollection.AddInternal(SPNavigationNode
node, Int32 iPreviousNodeId) at ImpactSharePoint.ConfigureSharePointInstance.NavigationConfig.<ConfigureQuickLaunchBar>b__0() at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass5.<RunWithElevatedPrivileges>b__3()
at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated
secureCode) at ImpactSharePoint.ConfigureSharePointInstance.NavigationConfig.ConfigureQuickLaunchBar() at ImpactSharePoint.Features.Pages.PagesEventReceiver.FeatureActivated(SPFeatureReceiverProperties properties)
at Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce) at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, SPFeatureActivateFlags activateFlags, Boolean
fForce) at Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean fMarkOnly) at Microsoft.SharePoint.SPFeature.ActivateDeactivateFeatureAtWeb(Boolean
fActivate, Boolean fEnsure, Guid featid, SPFeatureDefinition featdef, String urlScope, String sProperties, Boolean fForce) at Microsoft.SharePoint.SPFeature.ActivateDeactivateFeatureAtScope(Boolean fActivate, Guid featid, SPFeatureDefinition
featdef, String urlScope, Boolean fForce) at Microsoft.SharePoint.PowerShell.SPCmdletEnableFeature.UpdateDataObject() at Microsoft.SharePoint.PowerShell.SPCmdlet.ProcessRecord() at System.Management.Automation.CommandProcessor.ProcessRecord()
at System.Management.Automation.CommandProcessorBase.DoExecute() at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate) at System.Management.Automation.PipelineOps.InvokePipeline(Object
input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext) at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame
frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0) at System.Management.Automation.DlrScriptCommandProcessor.RunClause(Action`1
clause, Object dollarUnderbar, Object inputToProcess) at System.Management.Automation.CommandProcessorBase.DoComplete() at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(CommandProcessorBase commandRequestingUpstreamCommandsToStop)
at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate) at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()
at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc() at System.Management.Automation.Runspaces.PipelineThread.WorkerProc() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,
ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
Feature Infrastructure 88jm
High Feature receiver assembly 'ImpactSharePoint, Version=1.1.0.0, Culture=neutral, PublicKeyToken=3f4d824fecc0071e', class 'ImpactSharePoint.Features.Pages.PagesEventReceiver', method 'FeatureActivated' for feature
'd8aabd95-076a-4650-a8a6-0aa5bd8ac8d1' threw an exception: Microsoft.SharePoint.SPException: An unexpected error occurred while manipulating the navigational structure of this Web. ---> System.Runtime.InteropServices.COMException: <nativehr>0x8107140d</nativehr><nativestack></nativestack>An
unexpected error occurred while manipulating the navigational structure of this Web. at Microsoft.SharePoint.Library.SPRequestInternalClass.AddNavigationNode(String bstrUrl, String bstrName, String bstrNameResource, String bstrNodeUrl, Int32
lType, Int32 lParentId, Int32 lPreviousSiblingId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav, String& pbstrDateModified) at Microsoft.SharePoint.Library.SPRequest.AddNavigationNode(String bstrUrl, String bstrName, String bstrNameResource,
String bstrNodeUrl, Int32 lType, Int32 lParentId, Int32 lPreviousSiblingId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav, String& pbstrDateModified) --- End of inner exception stack trace --- at Microsoft.SharePoint.SPGlobal.HandleComException(COMException
comEx) at Microsoft.SharePoint.Library.SPRequest.AddNavigationNode(String bstrUrl, String bstrName, String bstrNameResource, String bstrNodeUrl, Int32 lType, Int32 lParentId, Int32 lPreviousSiblingId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav,
String& pbstrDateModified) at Microsoft.SharePoint.Navigation.SPNavigationNode.AddInternal(Int32 iPreviousNodeId, Int32 iParentId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav) at Microsoft.SharePoint.Navigation.SPNavigationNodeCollection.AddInternal(SPNavigationNode
node, Int32 iPreviousNodeId) at ImpactSharePoint.ConfigureSharePointInstance.NavigationConfig.<ConfigureQuickLaunchBar>b__0() at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass5.<RunWithElevatedPrivileges>b__3()
at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated
secureCode) at ImpactSharePoint.ConfigureSharePointInstance.NavigationConfig.ConfigureQuickLaunchBar() at ImpactSharePoint.Features.Pages.PagesEventReceiver.FeatureActivated(SPFeatureReceiverProperties properties)
at Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce)
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
The code:
using System.Diagnostics;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Navigation;
namespace ImpactSharePoint.ConfigureSharePointInstance
public class NavigationConfig
public void ConfigureQuickLaunchBar(SPWeb web)
SPSecurity.RunWithElevatedPrivileges(delegate
//Delete All Links
web.AllowUnsafeUpdates = true;
for (int i = web.Navigation.QuickLaunch.Count - 1; i > -1; i--)
web.Navigation.QuickLaunch[i].Delete(); // -> Deleting all the links in quick launch
web.QuickLaunchEnabled = true;
EventLog.WriteEntry("Sharepointfeature","Starter");
//Adding Links
SPNavigationNodeCollection nodes = web.Navigation.QuickLaunch;
var sokNode = new SPNavigationNode("Søk", null, false);
nodes.AddAsFirst(sokNode);
sokNode.Update();
EventLog.WriteEntry("Sharepointfeature", "Lagt til søk");
// Personsøk
var personSokNode = new SPNavigationNode("Deltakere", "/sites/impact/default.aspx", false); //TODO: fix hardkoding
sokNode.Children.AddAsFirst(personSokNode);
personSokNode.Update();
EventLog.WriteEntry("Sharepointfeature", "Lagt til node personsøk");
// Udb-søk
var udbSokNode = new SPNavigationNode("UDB-Søk", "/sites/impact/udbsok.aspx", false); //TODO: fix hardkoding
sokNode.Children.AddAsLast(udbSokNode);
udbSokNode.Update();
EventLog.WriteEntry("Sharepointfeature", "Lagt til node udbsøk");
// Kommuner
var kommuneNode = new SPNavigationNode("Kommuner", "/sites/impact/kommunesearch.aspx", false); //TODO: fix hardkoding
sokNode.Children.AddAsFirst(kommuneNode);
kommuneNode.Update();
EventLog.WriteEntry("Sharepointfeature", "Lagt til node kommunesøk");
// Organisasjoner
var virksomhetNode = new SPNavigationNode("Organisasjoner", "/sites/impact/virksomhetsearch.aspx", false); //TODO: fix hardkoding
sokNode.Children.AddAsFirst(virksomhetNode);
virksomhetNode.Update();
EventLog.WriteEntry("Sharepointfeature", "Lagt til node kommunesøk");
// NIR
var nirNode = new SPNavigationNode("Nir", null, false); //TODO: fix hardkoding
nodes.AddAsLast(nirNode);
nirNode.Update();
EventLog.WriteEntry("Sharepointfeature", "Lagt til node Nir");
// Tilskudd
var tilskuddNode = new SPNavigationNode("Tilskudd", "/sites/impact/", false);
nodes.AddAsLast(tilskuddNode);
tilskuddNode.Update();
EventLog.WriteEntry("Sharepointfeature", "Lagt til node Tilskudd");
// Kjøringsoversikt
var showkjoringerNode = new SPNavigationNode("Kjøringsoversikt", "/sites/dev/kjoringoversikt.aspx", false); //TODO: fix hardkoding
tilskuddNode.Children.AddAsFirst(showkjoringerNode);
showkjoringerNode.Update();
EventLog.WriteEntry("Sharepointfeature", "Lagt til node showkjoringerNode");
web.Update();
EventLog.WriteEntry("Sharepointfeature", "Etter update");
//Setting homepage
SPFolder folder = web.RootFolder;
folder.WelcomePage = "default.aspx";
folder.Update();
EventLog.WriteEntry("Sharepointfeature", "Etter homepage");
web.AllowUnsafeUpdates = false;i think you need to debug your code, lookalike the values you trying insert already exist in the database.
these two IDs (6323df8a-5c57-4d3e-a477-09aa8b66100a, 7ae114df-9d52-4b08-affa-8c544cbc27b6).
i would try to run the select command against the content db.
SELECT TOP * FROM [DB Name].[dbo].[NavNodes] where id = '6323df8a-5c57-4d3e-a477-09aa8b66100a'
Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog -
I come across a problem when handling duplicate keys retrieved from query result.
It is not hard I believe, but I can not find solution
the problem is:
I have a query that will retrieve the rows like structure
product_A, aaa
product_A, bbb
product_A, ccc
product_A, ddd
product_A, eee
product_B, 111
product_B, 222
product_B, 33
product_B, 334
product_C, 212
product_C, 411
In jsp page, I can do iteratoring to get each element like product_x and number display row by row in table
Now the requirement is changed to get no duplicate key(product_X) displayed in page, but all the number that belongs to same product key should be displayed alongside product key display.
that means to display like this:
product_A aaa bbb ccc ddd eee
product_B 111 222 33 334
product_C 212 411
The condition is i can not change the original query, what i need to do reorganize the each row object and change the display like above
I was trying to add each elements include product key and number to the hashmap as key value pair
and then plan to do data structure change. But the hashmap does not support duplicate keys. Now i have no idea of implemeting this
Any of you has solution to it?
Appreciated!
Very junior programmerMy testing code according to what you guys suggest as below:
Hashtable map = new Hashtable();
String[] strArray1 = { "PRODUCT_A","PRODUCT_A","PRODUCT_A","PRODUCT_A","PRODUCT_A","PRODUCT_A",
"PRODUCT_B","PRODUCT_B","PRODUCT_B","PRODUCT_B","PRODUCT_B","PRODUCT_B",
"PRODUCT_C","PRODUCT_C","PRODUCT_C","PRODUCT_C","PRODUCT_C","PRODUCT_C",
String[] strArray2 = { "1000","1001","1002","1003","1004","1005",
"2000","2001","2002","2003","2004","2005",
"3000","3001","3002","3003","3004","3005"};
for (int i = 0; i < strArray1.length; i++) {
String productKey = strArray1;
String productNumber = strArray2[i];
List list = (ArrayList) map.get(productKey);
if (list == null)
map.put(productKey, list = new ArrayList());
list.add(productNumber);
System.out.println(" map.size(): " + map.size());
Enumeration emuKey = map.keys();
while(emuKey.hasMoreElements()){
String productKey = (String)emuKey.nextElement();
System.out.println("PRODUCT: " + productKey);
ArrayList list = (ArrayList)map.get(productKey);
for(int i=0; i<list.size();i++){
System.out.println("list["+i+"]: " + (String)list.get(i));
output:
map.size(): 3
PRODUCT: PRODUCT_C
list[0]: 3000
list[1]: 3001
list[2]: 3002
list[3]: 3003
list[4]: 3004
list[5]: 3005
PRODUCT: PRODUCT_B
list[0]: 2000
list[1]: 2001
list[2]: 2002
list[3]: 2003
list[4]: 2004
list[5]: 2005
PRODUCT: PRODUCT_A
list[0]: 1000
list[1]: 1001
list[2]: 1002
list[3]: 1003
list[4]: 1004
list[5]: 1005
With all your suggestion, it finally works. thanks! -
Dimension with more duplicate keys
Hi guys, I'm a little bit on trouble with a dimension. In this case I got something like: Country, Contract, State, Code
(USA) Limited1 Arizona 44707
(UK) Limited IT 2011-2013 Arizona 44707
(UK) Limited IT 2010-2011 Arizona 44707
I can put country as key because I got different countries, but I got even different Contract, State and Code. Pratically I got always a duplicate key...should I create a new field or I have another solution?
Any thoughts? ThanksYou can also use a surrogate key if you want which would be a autoincrementing identity column or based on sequence.
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
I am using SQL server 2008 R1 SP3. And when we are doing back up operations we are facing the below error
Msg 2601, Level 14, State 1, Procedure sp_flush_commit_table, Line 15
Cannot insert duplicate key row in object 'sys.syscommittab' with unique index 'si_xdes_id'. The
duplicate key value is (2238926153).
The statement has been terminated.
Please assist me with your inputs.
Thanks,
Rakesh.Hello,
Did you enable change tracking on the database? If so, please try to disable and re-enable the change tracking.
The following thread is about the similar issue, please refer to:
http://social.msdn.microsoft.com/forums/sqlserver/en-US/c2294c73-4fdf-46e9-be97-8fade702e331/backup-fails-after-installing-sql2012-sp1-cu1-build-3321
Regards,
Fanny Liu
Fanny Liu
TechNet Community Support -
Db adaptor for insert- SQLException: [SQL0803] Duplicate key value specified
While invoking db adaptor for insert on table 1 selecting values form another table, i am gtting error ; before3 insert i am updating table 2nd using db adaptor
QUERY insert into CRPDTA.F5504579 (SELECT * FROM CRPDTA.F5504571 WHERE PAHDC=#v_updatedRecord_HDC)
Error :
Non Recoverable System Fault :
<bpelFault><faultType>0</faultType><bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert_Ledger_F5504579' failed due to: Pure SQL Exception. Pure SQL Execute of insert into CRPDTA.F5504579 (SELECT * FROM CRPDTA.F5504571 WHERE PAHDC=?) failed. Caused by java.sql.SQLException: [SQL0803] Duplicate key value specified.. The Pure SQL option is for border use cases only and provides simple yet minimal functionality. Possibly try the "Perform an operation on a table" option instead. This exception is considered not retriable, likely due to a modelling mistake. To classify it as retriable instead add property nonRetriableErrorCodes with value "--803" to your deployment descriptor (i.e. weblogic-ra.xml). To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff. All properties are integers. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. </summary></part><part name="detail"><detail>[SQL0803] Duplicate key value specified.</detail></part><part name="code"><code>-803</code></part></bindingFault></bpelFault>
Please suggest....Easter1976 wrote:
Hi please can you help me. I think I am having problems with tranactions. I am deleting from a table and then inserting in the same table with the same key that I have just deleted. Simple then - don't do that. It suggests a flaw in the design. Either use a new key or do an update.
Note that you would get a duplicate key error if the table is set up such that it doesn't
actually delete but doesn't something such as creating a log entry with a delete flag set. -
We have been seeing the following 'warnings' in the event log of our BizTalk machine since upgrading to BTS 2006. They seem to occur randomly 6 or 8 times per day.
Does anyone know what this means and what needs to be done to clear it up? we have only one BizTalk server which is running on only one machine.
I am new to BizTalk, so I am unable to find how many tracking host instances running for BizTalk server. Also, can you please let me know that we can configure only one instance for one server/machine?
Source: BAM EventBus Service
Event: 5
Warning Details: Execute batch error. Exception information: TDDS failed to batch execution of streams. SQLServer: bizprod, Database: BizTalkDTADb.Cannot insert duplicate key row in object 'dta_MessageFieldValues'
with unique index 'IX_MessageFieldValues'. The statement has been terminated..Other than ensuring that there exists a separate and single tracking host instance, you're getting an error about duplicate keys.. which implies that you're trying to Create a BAM Activity twice with the same data.
I suggest you have a in-depth examination of the BAM (TPE or API) associated with the orchestration. In TPE ensure that the first binding you select is the "Instance Id" or "Message Id" before going ahead to map the ports or others.
Regards. -
Hello, I am trying to reset my macbook pro to its factory settings but I can't type the name of the formatted disk nor can I click on erase, as this feature is disabled. The 'type name' space and the 'erase' button are in light grey - Could you please assist?
Hello!
Did you boot to the Internet Recovery Partition?
Here’s how:
1/ Make sure your computer is completely shut down.
2/ You’ll have to be quick next: Press the Mac’s power button. As soon as you either hear the loud chime, or see the display light up - usually after a second or 2 - on your keyboard press [alt] + [cmd] + [r] Keep these keys on your keyboard pressed until you see a spinning globe with the text “starting Internet Recovery” You might have to connect to your Wi-Fi network before you can continue here.
After a few minutes, you’ll be presented with a Utilities screen. This is the Internet Recovery partition. If this step is already giving you problems, try using a USB-keyboard. It doesn’t have to be an Apple-keyboard. If you have a Windows-tailored keyboard laying around, use the “Windows-flag” key in stead of the [cmd]-key and it should also work.
3/ Choose Disk Utility and click [continue] -
I have migrated my SCCm 2007 environment to SCCM 2012 SP1 CU4.
I noticed in the System Status\Component Status\SMS_STATE_SYSTEM a lot of errors like the one below:
Microsoft SQL Server reported SQL message 2627, severity 14: [23000][2627][Microsoft][SQL Server Native Client 11.0][SQL Server]Violation of PRIMARY KEY constraint 'DeploymentSummary_PK'. Cannot insert duplicate key in object 'dbo.DeploymentSummary'. The duplicate key value is (1, 0, S0220438, 0). : spUpdateClassi
Please refer to your Configuration Manager documentation, SQL Server documentation, or the Microsoft Knowledge Base for further troubleshooting information.
When looking up the deployment ID and recreate the Deployment the problem is solved. But I have 700 packages and don't want to manually do this action on all packages. I think it is related to the migration i did and something went wrong there :-(
Besides it will retriggers the deployment to the clients which is also not preferred.
Is there another way to solve this by e.e.g do something directly in the SQL database tables ?Hi,
It is not supported by Microsoft that do something directly in SQL database.
If you want to do that, you could make a call to CSS.
Best Regards,
Joyce
We
are trying to better understand customer views on social support experience, so your participation in this
interview project would be greatly appreciated if you have time.
Thanks for helping make community forums a great place. -
Text update master data no more possible/ Not existing duplicate keys
Dear colleagues,
we cannot load any new text for master data info objects.
There are no duplicate keys in the delivered nor in psa.
If the key value is allready loaded and the PSA containes changed text
fields to this key, the DTP update fails and says: duplicate data record!.
If I switch on the "Handle duplicate record keys"-flag, the DTP deletes
the correct record with the changed texts from the delivered data.
So, it is no more possible to get changed texts into the system.
Attribute load has the same issue.
Please help fast.
Many regards,
Wolfgang TaagProblem seems to be solved!
Transfers start routine proceeds a "short dump" while selecting duplicate records from an differnt info object.
But there is no real short dump in in ST22.
DTP catches user's short dump and gives the message, that there are duplicate records in the loaded data.
If you check "handle duplicate records" at the DTP, no error is messaged, even though startroutine dumps!
Fattaly, in this case, DTP deletes rows from loaded data!
Thanks,
Wolfgang -
Hi,
i have a question: Because of same Problems with replication, i had to apply again some replicated trailfiles.
It worked fine, some duplicate have been written to the discardfile, but this has been the expected result.
My Question: In such a case where i EXPECT duplicate keys in the replicat process, it would be great to configure the replicat
so that it just skips duplicate entries without writing them to the discard file, because an 'abbend' happens if the discardfile becomes too
big.
So, is it possible to configure the replcat that it just ignores duplicate entries without writing them to the discard-file ?
Regards, FelixFelix,
you might use HANDLECOLLISIONS parameter. Please have a look at the Orcle Support note: What Does The HANDLECOLLISIONS Parameter Do? [ID 966207.1] for more details.
Thanks,
Klaus -
Sybase Error 2601 Attempt to insert duplicate key row in object with unique
RE: Sybase Error 2601 Attempt to insert duplicate key row in object with unique index.
Hi Folks,
I'm getting the following error whilst executing a stored procedure in Sybase.
ERROR: Sybase Error 2601 Attempt to insert duplicate key row in object with unique index.
I understand that duplicate values have been inserted into a column that has a unique constraint.
I just can't figure out how to rectify the problem.
Your help will be greatly appreciated!
Many thanks in advance.If the value I'm trying to insert (using update)
already exists in the unique-value field then the DB
refuses to update the field.
If the value is different it will update.Are you trying to insert or update in SQL (identified by the keyword INSERT or UPDATE respectively)?
Even in case of an UPDATE query, if you are going to update the values of some columns to violate the unique constraints, the update will not succeed and you will get the error message.
or is it?
it tries to create a new row, but can't because there
is another row with the same unique-values.
If this is the case, I am only trying to update and
not create a new item.To put it in simpler words, if you have a set of values defining the uniqueness of a record, you cannot insert another record with the same set of unique values. Similarly, you cannot update an existing record by modifying the set to conflict with another set of unique values which already exist in the database.
Suppose there are two columns A and B defining the uniqueness of the record and you have only two records at the moment like -
A B
========
1 1
2 1
If you try to insert a record with A = 1 and B = 1, it will fail because a record already exists. You cannot violate uniqueness because the database has already been told that there will be only one record for any given combination of A and B.
Similarly, if you try to update the second record from A = 2 to A = 1, the end result would be A =1 and B = 1. There is already a record with that set of values and this will result in a violation of the uniqueness. So, this update will also be disallowed. On the other hand, if you try to update B to some value, say 3, there is no problem in doing so.
For convenience, you can imagine an UPDATE operation to be equivalent to DELETE + INSERT operation, though it doesn't necessarily work the same way internally.
I hope I was clear enough.
Maybe you are looking for
-
i've got a problem with my creative zen ./firewire... every couple of weeks the bass goes very distorted. the only way i can fix this is by reinstalling the firmware which is startin 2 annoy me now. i don't think its a problem with the player itself
-
Brand new 5 gen. When I connect the iPod to my PC, the iPod's hard drive causes a high pitched noise on my PC speakers. As the hard drive spins up, the pitch goes higher, as it spins down, the pitch goes lower. You get the idea. The volume isn't part
-
I am trying to transfer idocs using an ABAP port (with a FM assigned) from R/3 to Partner system( APO 4.0). The idocs are successfully posted in SAP R/3 sender sytem(ERP2004) and passed to ABAP port. I receive a success message " IDOCs transferred to
-
Barcode on every second physical page
I'm trying to create a form letter report in 6i. The letter runs into several pages, but I need to print only the barcode on every second page. So when we do duplex printing, the barcode goes on the back of each page. All the components including the
-
I'm trying to export all of the images in my Aperture Library...
... but can't export with the original dates/times. I'd also like to keep my album structure. I DON'T want to change the filenames. Saving the other Aperture information (such as ratings, keywords) would be a bonus, but not a necessity. Any ideas