Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 12th, 2013, 02:46 PM
jwcane jwcane is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2012
Posts: 22 jwcane User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 52 m 18 sec
Reputation Power: 0
Error on Update "unique index"

Please advise best way to correct this.

Complete message is EIB_ISCError with message 'ISC ERROR CODE:335544349.

ISC ERROR MESSAGE: attempt to store duplicate value (visible to active transactions) in unique index "IDX_USERNAME"

Reply With Quote
  #2  
Old February 12th, 2013, 03:34 PM
jwcane jwcane is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2012
Posts: 22 jwcane User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 52 m 18 sec
Reputation Power: 0
Unique Index Error in Delphi not IB_SQL

Opened the table in IB_SQL, and the desired update worked fine. Also noticed in Delphi that the identity of the client user seems to matter. A user can update her own data, but cannot update data of others. Some records are not subject to this error, and others are. Does this tell us anything about the source of the error?

Quote:
Originally Posted by jwcane
Please advise best way to correct this.

Complete message is EIB_ISCError with message 'ISC ERROR CODE:335544349.

ISC ERROR MESSAGE: attempt to store duplicate value (visible to active transactions) in unique index "IDX_USERNAME"

Reply With Quote
  #3  
Old February 13th, 2013, 02:10 AM
nagysz nagysz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 200 nagysz User rank is Sergeant (500 - 2000 Reputation Level)nagysz User rank is Sergeant (500 - 2000 Reputation Level)nagysz User rank is Sergeant (500 - 2000 Reputation Level)nagysz User rank is Sergeant (500 - 2000 Reputation Level)nagysz User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 11 h 19 m 28 sec
Reputation Power: 13
Quote:
Originally Posted by jwcane
Opened the table in IB_SQL, and the desired update worked fine. Also noticed in Delphi that the identity of the client user seems to matter. A user can update her own data, but cannot update data of others. Some records are not subject to this error, and others are. Does this tell us anything about the source of the error?



Quote:
Does this tell us anything about the source of the error?


It says that you have a UNIQUE INDEX defined in IDX_USERNAME (probably on the USERNAME field) and you entered a duplicate username. Take care of case sensitivity. Firebird is case sensitive so you might want to change all usernames to the same case first (upper or lower). I'd do that in a trigger like this:

CREATE OR ALTER TRIGGER users_biu0 FOR users
ACTIVE BEFORE INSERT OR UPDATE POSITION 1
AS
BEGIN
NEW.username = LOWER(NEW.username);
...

END


be aware to change "users" to your table name...


I saw some other similar posts from you in the forum...i'd advise to read more documentation on Firebird SQL. You'll find a lot of info on the official firebird page firebirdsql.org

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Error on Update "unique index"

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap