w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Omniauth error -- PG::Error: ERROR: duplicate key value violates
You have a unique constraint on the email field. Because this field is defined as not nullable and has a default value of "" (empty string). This means if you don't specify the email, your DBMS will set this field to "". Of course, because it has a unique constraint, you'll only be able to add two users without email, because only one can have the empty string email. If you didn't create the constraint manually, then I assume rails has created it for you (because there's an index on the email field too apparently) by assuming the first field is the table primary key, since you didn't specify any. This made it create both an index and a unique constraint on it.

Categories : Ruby On Rails

im getting this error in sql server 2008 : Error converting data type nvarchar to bigint
Your query is: SELECT @ResultValue = COUNT(id_tips) from tips,blood where blood_id = id_blood + @test ; You are adding a string value (@test) to whatever id_blood is. I imagine that it is a bigint and this is not allowed. It looks like you might be thinking dynamic SQL. But this is not how you code dynamic SQL. I would suggest that you talk to someone locally about the correct way to write stored procedures in SQL Server (or at least read the documentation on the select statement). Also, learn proper join syntax. Just say "no" to commas in the from clause.

Categories : SQL

I'm getting an error "Msg 8114, Level 16, State 5, Procedure sp_DRPL_MassChangeClient, Line 0 Error converting data type varchar to int."
This is what your passing EXEC sp_DRPL_MassChangeClient @DebtorsDebtID,@OldClient,@ClientID,@UserName,@DebtID the second @variable is @OldClient which is declared as varchar into @DebtorsDebtID AS uniqueidentifier, @DebtID AS int, The second variable is @DebtID declared as INT hence the error thrown

Categories : SQL

Duplicate error in transactions
Check if MachineNumber exists before attempting to update. You can use EXISTS or COUNT For instance: DECLARE @Exists INT SELECT @Exists = COUNT(MachineNumber) FROM TblProduces WHERE MachineNumber = @machinNum IF @Exists = 0 BEGIN -- Perform UPDATE END

Categories : SQL

Duplicate certificate error
I found the solution , you have to go to Certificates (Local Computer) > Personal > Certificates. Make sure you choose Computer Account when you use the Certicates mmc snap-in and youn will find the duplicate

Categories : Dotnet

Marking duplicate id gives error
You can 'fool' MySQL when using another subquery to cover that up that you can't select from a table that you are updating update event set repeated = 1 where eid in ( select * from ( SELECT eid FROM event group by eid HAVING count(eid) > 1 ) x )

Categories : Mysql

Doctrine2 Duplicate key name error
Not sure it is the cause of the Exception, but there is an error in your ORM mapping. $myFriends is the owning side, $friendsWithMe is the inverse side, so inversedBy attribute should be only present on $friendsWithMe. Try to rewrite $myFriendswith mappedBy attribute : /** * @ORM ManyToMany(targetEntity="User", mappedBy="friendsWithMe") * @ORM JoinTable(name="friends", * joinColumns={@ORM JoinColumn(name="user_id", referencedColumnName="id")}, * inverseJoinColumns={@ORM JoinColumn(name="friend_user_id", referencedColumnName="id")} * ) **/ protected $myFriends;

Categories : PHP

Error while converting PPT to PDF
Just use the specific libraries: using Excel = Microsoft.Office.Interop.Excel; using Word = Microsoft.Office.Interop.Word; using Power = Microsoft.Office.Interop.PowerPoint; They should have everything you need along with not having namespace isssues between interlocking dll's These are found as COM references EDIT: Also, are you using correct namespaces? If you could post some code it would be helpful.

Categories : C#

Duplicate class error with Groovlets
I could not go deep enough to resolve the strange behavior, but there was an easier solution. I added this to direct all the requests to a single script. <init-param> <param-name>resource.name.replacement</param-name> <param-value>CatchAll.groovy</param-value> </init-param> <init-param> <param-name>resource.name.regex</param-name> <param-value>/.*</param-value> </init-param>

Categories : Groovy

duplicate row.names (index) error in zoo
The issue is not so much with zoo as it is with the arguments to as.POSIXct Have a look at as.POSIXct(x$Index) and you will see that it is not giving the results you require. Giving as.POSIXct a time zone will help. Compare: as.POSIXct(x$Index) # [1] "2008-03-09 01:00:00 EST" "2008-03-09 01:00:00 EST" as.POSIXct(x$Index, tz = "GMT") # [1] "2008-03-09 01:00:00 GMT" "2008-03-09 02:00:00 GMT"

Categories : R

mongo _id field duplicate key error
Likely, it's because you have an index that requires a unique value for one of the fields as shown below: > db.servers.remove() > db.servers.ensureIndex({"name": 1}, { unique: 1}) > db.servers.insert({"_id": "1.2.3"}) > db.servers.insert({"_id": "1.2.4"}) E11000 duplicate key error index: test.servers.$name_1 dup key: { : null } You can see your indexes using getIndexes() on the collection: > db.servers.getIndexes() [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "test.servers", "name" : "_id_" }, { "v" : 1, "key" : { "name" : 1 }, "unique" : true, "ns" : "test.servers", "name" : "name_1" } ]

Categories : Mongodb

Maven duplicate tag "dependencies" error
Yes, the console is telling you what you need to do. just remove duplicated tag <dependencies>, if you want to add more dependency, just add new tag <dependency> in existing <dependencies> tag!

Categories : Java

Mongoose upsert duplicate key error
You're including level in the update query criteria parameter, so if that doesn't also match the existing record it will try and create a new doc which will fail the unique index which only spans skill and resource. Try changing your update to this: ResourceSkillLevel.update({ resource: self._id, skill: skill._id }, {$set: {level: level}}, {upsert: true}, cb);

Categories : Node Js

Duplicate error messages with validates_associated
Here: c.errors.full_message #=> ["Brands is invalid", "Brands is invalid"] It's return two error message for each, because one for object of brands and other for brand field validation error messaage. So, c.brands.last.errors.full_message is right way to validation.

Categories : Ruby On Rails

How to troubleshoot "Duplicate zip entry" error?
The Eclipse build process creates an intermediary jar C:workspaceMyMainLibinmymainlib.jar, which ProGuard subsequently reads as input jar. At that point, it spuriously seems to be truncated. Maybe there are problems with the file system? You can check if the intermediary jar isn't corrupt, after the build. If it is ok, the problem might be that the file hasn't been flushed to disk when ProGuard reads it. The only workaround I see is to use Ant to perform the release build.

Categories : Misc

Error: Duplicate entry '0' for key 'PRIMARY'
The problem in set ID = $ID Try removing it so the code should be $sql="UPDATE `dati` `title`= '$titletxt',`value1`='$value1',`value2`='$value2' WHERE 1"; Be sure to change this where cause it'll update ever row with these values

Categories : Mysql

Error: Duplicate entry for key 'PRIMARY'
Try like: $sql = "SELECT * FROM tbale_name WHERE ID='$id'"; $result = mysql_query($sql); $numRows = mysql_num_rows($result); if($numRows>0) { echo "This ID is already in use, please try another ID?"; } else { //Insert query here }

Categories : PHP

JSF with Primefaces Menu duplicate Id error?
I completely re-write the code and there was no error afterwords. I think that although I couldn't trace any duplicate Ids in previous time, there must have been one. This time also the same error occurred and I found that there is a duplication introduced by myself. If anyone get the same error, I think there is a very high possibility that it is caused by duplicates in manual insertion of duplicate ids.

Categories : JSF

Delegate error converting from VB6 to vb.net
You need to declare a delegate, like this: Delegate Sub DeviceStateChangedDelegate(ByVal param As Integer) Then inside of the SetupCallBacks method you need to create and invoke your delegate, like this: Public Sub SetupCallBacks() ' Declare and instantiate the delegate Dim MTUSCRADeviceStateChangedNotify As DeviceStateChangedDelegate MTUSCRADeviceStateChangedNotify = AddressOf OnEventDeviceStateChanged ' Invoke the delegate, passing it 10, which is obviously made up MTUSCRADeviceStateChangedNotify.Invoke(10) End Sub

Categories : Vb.Net

Converting an non ARC project to ARC error
If you are using 3rd party libraries that don't support ARC you should just add this flag to the files in question in your build phases/compile sources (prevents ARC on only those files). This should help you determine if your code is the issue or the library you are using (if that's the case). -fno-objc-arc

Categories : Iphone

Error in converting streams
Your code to save the picture is wrong. You're writing the result of image.ToString(), not the actual image. As a rule of thumb, remember that StreamWriter is used to write strings into a stream. Never try to use it to write binary data. using (var isolatedStorage = IsolatedStorageFile.GetUserStoreForApplication()) { using (var fileStream = new IsolatedStorageFileStream(filePath, FileMode.Create, isolatedStorage)) { var bitmap = new WriteableBitmap(image, null); bitmap.SaveJpeg(fileStream, bitmap.PixelWidth, bitmap.PixelHeight, 0, 100); } }

Categories : C#

Converting Haml to erb error
The problem seems to be you are using <%= on each call and end. Remove the equals sign = from both as follows: <% @movies.each do |movie| %> <tr> <td><%= movie.title %> </td> <td><%= movie.rating %> </td> <td><%= movie.release_date %> </td> <td><%= link_to "More about #{movie.title}", movie_path(movie) %> <td><%= link_to "Edit Movie", edit_movie_path(movie) %></td> </tr> <% end %> Note that <%= %> is used to print what you have in between them. Addition : Also when you are using one liner if statement like you have used i.e. <%= if ... you need to use if...then...end syntax like follows: <th class ='hilite'><%= if @sort ==

Categories : Ruby On Rails

ERROR converting json
UserListByBusinessAreaContextResult is not an Array. It's a JSONObject. tableData is your JSONArray. So you must have : try { JSONObject mainJson22 = new JSONObject(reply); JSONArray jsonResult = mainJson22.getJSONObject("UserListByBusinessAreaContextResult"); JSONArray jsonArray22 = jsonResult.getJSONArray("tableData"); Log.i("mainjson234","" + jsonArray22); for (int i2 = 0; i2 < jsonArray22.length(); i2++) { JSONObject objJson22 = jsonArray22.getJSONObject(i2); ...

Categories : Android

Bitmap error when converting it
If you get an exception on this line: Image<Gray, Byte> emguImg = new Image<Gray, byte>((int)frame.Width, (int)frame.Height, stride, frame.ImageBuffer); What are the values of frame.Width, frame.Height, and stride. Some systems use negative height or negative stride to differentiate top-down from bottom-up pixel order, and your library may be unhappy with that. Or it could be an alignment issue. Set a breakpoint in the debugger and see exactly what you're asking the library to do.

Categories : C#

Duplicate id error with primefaces dialog in template
The prolbem was binding attribute on datatable. See also: I'm getting 'Duplicate id error' after adding 'binding' attribute SessionScoped component was used in multiple views. I've used EL-table binding and then the problem was disappeared.

Categories : JSF

MongoDB insert raises duplicate key error
You need to understand that your entries list has a bunch of references to one entry dict. So when PyMongo sets entries[0]['_id'], all the other entries get the same _id. (In fact, PyMongo will iterate through the list setting each entry's _id, so all the entries will have the final _id at the end.) A quick fix would be: entries.append(entry.copy()) This is merely a shallow copy, but in the code you shared I believe this is enough to fix your problem.

Categories : Python

Why is my app crashing? I can't duplicate the error, but received this crash log:
I'm no expert of this, but it looks like an exception was raised when you called compare on an NSNumber and used the incorrect format. My guess is that you tried to compare a number to something else, possibly a string.

Categories : IOS

Unexpected duplicate key error using @JsonTypeInfo property
Your code doesn't show it, but I bet you have a getter in your Document class for the documentType property. You should annotate this getter with @JsonIgnore like so: @JsonIgnore public String getDocumentType() { return documentType; } There is an implicit documentType property associated with each subclass, so having the same property in the parent class causes it to be serialized twice. Another option would be to remove the getter altogether, but I assume you might need it for some business logic, so the @JsonIgnore annotation might be the best option.

Categories : Json

Skip a record after a duplicate error (except IntegrityError)
What you are doing (especially if you have many records) is executing many queries and that is highly inefficient. Thus, it would be a better idea to build a query to detect duplicates. For the future you should still keep the unique constraint to avoid further conflicts, but for the transition (or whatever your are doing there) it is far more efficient to have such a query. You could even transform the results into a dictionary, because that is often more efficient if you need to look up stuff by a key. Furthermore, concerning speed, use a set instead of a list if you need to do something like value in duplicates because it is more efficient. Now if you'd like to keep your old way, use savepoints. The idea here is that you say "okay so far I am fine, let's keep this so when I roll back

Categories : Python

Mysql duplicate primary key error - but key does not exist in db
Your query is: INSERT INTO authorization_codes(book_id, auth_code, unpaid) SELECT edition_nid, 'FLT9950526', 1 FROM catapult.editions WHERE isbn_digital = '978-1-4533-2704-3'; This single statement is inserting one or more rows from editions into authorization_codes. If more than one row has the given isbn in editions, then query will attempt to insert multiple rows with the same auth_code, resulting in a violation of the uniqueness constraint. Because of the way that SQL works, either all the rows are inserted or none of them. To be safe, you can do: INSERT INTO authorization_codes(book_id, auth_code, unpaid) SELECT edition_nid, 'FLT9950526', 1 FROM catapult.editions WHERE isbn_digital = '978-1-4533-2704-3' limit 1; (This inserts one arbitrary row.

Categories : Mysql

MySQL default value error with ON DUPLICATE KEY UPDATE
You're getting error because The user_id column is defined as NOT NULL The user_id column doesn't have a default value specified You don't specify its value in your query either PS: the question is irrelevant to the ON DUPLICATE KEY UPDATE clause - it would be the same error if you didn't use it as well. PPS: regardless of if the ON DUPLICATE KEY UPDATE triggered - your insert should satisfy all the constraints

Categories : Mysql

Having error, Arithmetic overflow error converting numeric to data type numeric
Am column defined as decimal(n,m) holds n decimal digits, m of which are the fraction part. So decimal(2,2) is 2 digits long, both of which are the fraction part. This will only be able to take values in the range -0.99 to 0.99.

Categories : Sql Server

Error in Converting double to BigInteger
You must use BigInteger.Pow, not Math.Pow. With Math.Pow, the returned value is a double-precision floating point type whose precision is equivalent to roughly 15-17 significant decimal figures. Therefore only the first 15-17 figures will be correct.

Categories : C#

Getting an error while converting string to DateTime
Your format seems to be incorrect. Should be: "dd-MM-yyyy HH:mm:ss:ffff" Update. If number of digits representing fractions of a second varies, than the best bet is "dd-MM-yyyy HH:mm:ss:FFFFFFF" Refer to MSDN for other options for custom time and date formats.

Categories : C#

error converting varchar to float ms sql
your isnulls should be floats not '' empty strings (ISNULL(Height,0.0)+ 'x' + ISNULL(Width,0.0) + 'x' + ISNULL(Depth,0.0)) As Dimension I would check your other isnulls as well, make sure they are returning the value type you want.

Categories : SQL

Error on converting XML to object using LINQ
Try changing your LINQ query to: XDocument xdoc = XDocument.Load(xml); List<Customer> customers = (from customer in xdoc.Element("Packet").Element("Customers").Element("Customer") select new Customer { Name = customer.Element("Name").Value, Age = customer.Element("Age").Value }).ToList(); Because your Customers element is located inside your Packet element.

Categories : C#

how to handle mongodb's E11000 duplicate key error in ruby
The ruby block would look something like : begin # your operation rescue Mongo::OperationFailure => e if e.message =~ /^11000/ puts "Duplicate key error #{$!}" # do something to recover from duplicate else raise e end end # the rest of the exceptions follow .. # if you just care about the dup error # then ignore them #rescue Mongo::MongoRubyError # #Mongo::ConnectionError, Mongo::ConnectionTimeoutError, Mongo::GridError, Mongo::InvalidSortValueError, Mongo::MongoArgumentError, Mongo::NodeWithTagsNotFound # puts "Ruby Error : #{$!}" #rescue Mongo::MongoDBError # # Mongo::AuthenticationError, Mongo::ConnectionFailure, Mongo::InvalidOperation, Mongo::OperationFailure # puts "DB Error : #{$!}" #rescue Mongo::OperationTimeout # puts "Socket operation timeout Error

Categories : Ruby

Constants in Objective-C and "duplicate symbol" linker error
If you want to use constant only in one .m file then declare it as static. For example:static NSString * const CONSTANT_STRING = @"Constant I am". In case of NSInteger you can write in your every .m file: static const NSInteger my_const = 3; If you want globals (one constant with one value visible in every file) then write in your .h: extern const NSInteger my_global_const; and in your .m file you can add const NSInteger my_global_const = 5;

Categories : IOS

Block definition available throughout project without duplicate symbol error
Perhaps you defined the block in a .h file, so that it is defined in every .m file that imports this .h file? You have to declare it in a .h file: typedef NSComparisonResult(^UITagCompareBlock)(UIView*, UIView*); extern UITagCompareBlock uiTagCompareBlock; and define it in exactly one .m file: UITagCompareBlock uiTagCompareBlock = ^NSComparisonResult(UIView* a, UIView* b){ if (a.tag < b.tag) return NSOrderedAscending; else if (a.tag > b.tag) return NSOrderedDescending; else return NSOrderedSame; };

Categories : IOS

Duplicate key error with mongodb 2dsphere unique index
I can indeed reproduce this. Using a unique index for 2dsphere is not something that I think that ought to be supported. The resolution of the index is not high enough to see that your two points are not the same. Our implementation of the S2 index only uses "cells" with as minimum side 500m and your points are about 65 meters away from each other. There is a fascinating presentation at https://docs.google.com/presentation/d/1Hl4KapfAENAOf4gv-pSngKwvS_jwNVHRPZTTDzXXn6Q/view#slide=id.i0 that explains how the index works. For now however, I don't think there is a solution to your problem but I'll do some more investigation.

Categories : Mongodb



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.