Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Is there any way to log failed insert row because of uniqu..

 
   Database Help (Home) -> Informix RSS
Next:  The ultimate firewall  
Author Message
chavan1

External


Since: Feb 27, 2009
Posts: 2



(Msg. 1) Posted: Fri Feb 27, 2009 1:22 pm
Post subject: Is there any way to log failed insert row because of unique index
Archived from groups: comp>databases>informix (more info?)

Hello,
When I am trying to insert a row into a table I am getting the
follwoing error. Is there any way to log this failed row ( row values)
because of unique index violation.

insert into t1
select * from t2 where col2 = 2 ;

239: Could not insert new row - duplicate value in a UNIQUE INDEX
column (Unique Index:idx1).
100: ISAM error: duplicate value for a record with unique key.

-- Chavan

 >> Stay informed about: Is there any way to log failed insert row because of uniqu.. 
Back to top
Login to vote
Everett Mills

External


Since: Feb 27, 2009
Posts: 1



(Msg. 2) Posted: Fri Feb 27, 2009 3:29 pm
Post subject: RE: Is there any way to log failed insert row because of unique index [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> -----Original Message-----
> From: informix-list-bounces RemoveThis @iiug.org [mailto:informix-list-
> bounces RemoveThis @iiug.org] On Behalf Of
> Sent: Friday, February 27, 2009 3:22 PM
> To: informix-list RemoveThis @iiug.org
> Subject: Is there any way to log failed insert row because of unique
index
> violation - Informix
>
> Hello,
> When I am trying to insert a row into a table I am getting the
> follwoing error. Is there any way to log this failed row ( row values)
> because of unique index violation.
>
> insert into t1
> select * from t2 where col2 = 2 ;
>
> 239: Could not insert new row - duplicate value in a UNIQUE INDEX
> column (Unique Index:idx1).
> 100: ISAM error: duplicate value for a record with unique key.

How about a trigger & stored procedure that checks if the record exists
and then writes it into an exception table if it's already there? You
could also record such things as the time and user ID, if you need it.

--EEM
>
> -- Chavan
> _______________________________________________
> Informix-list mailing list
> Informix-list RemoveThis @iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list

 >> Stay informed about: Is there any way to log failed insert row because of uniqu.. 
Back to top
Login to vote
Vagner

External


Since: Feb 28, 2009
Posts: 1



(Msg. 3) Posted: Sat Feb 28, 2009 4:51 pm
Post subject: Re: Is there any way to log failed insert row because of unique index [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 27 fev, 18:22, wrote:
> Hello,
>         When I am trying to insert a row into a table I am getting the
> follwoing error. Is there any way to log this failed row ( row values)
> because of unique index violation.
>
> insert into t1
> select * from t2 where col2 = 2 ;
>
>   239: Could not insert new row - duplicate value in a UNIQUE INDEX
> column (Unique Index:idx1).
>   100: ISAM error:  duplicate value for a record with unique key.
>
> -- Chavan

You can enable violations tables, for examplo:

start violations table for t1;
set contraints for table t1 filtering without error;

You application doesnt raise error -239, and the row with duplicate
will be insert on violations table.

Vagner
 >> Stay informed about: Is there any way to log failed insert row because of uniqu.. 
Back to top
Login to vote
Jonathan Leffler

External


Since: Feb 28, 2009
Posts: 1



(Msg. 4) Posted: Sat Feb 28, 2009 4:54 pm
Post subject: Re: Is there any way to log failed insert row because of unique index [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Fri, Feb 27, 2009 at 1:22 PM, wrote:
>        When I am trying to insert a row into a table I am getting the
> following error. Is there any way to log this failed row (row values)
> because of unique index violation.
>
> insert into t1
> select * from t2 where col2 = 2 ;
>
>  239: Could not insert new row - duplicate value in a UNIQUE INDEX
> column (Unique Index:idx1).
>  100: ISAM error:  duplicate value for a record with unique key.

Consider whether START VIOLATIONS TABLE provides what you need (SQL
Syntax Manual).

If you are trying to debug an immediate problem, then this will
probably get you the answer.
If you are trying to do this long term, I'd probably think twice -- it
will still work, of course, but you really shouldn't need it except in
extraordinary situations.

--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler.TakeThisOut@earthlink.net, jleffler.TakeThisOut@us.ibm.com
Guardian of DBD::Informix v2008.0513 -- http://dbi.perl.org/
"Blessed are we who can laugh at ourselves, for we shall never cease
to be amused."
NB: Please do not use this email for correspondence.
I don't necessarily read it every week, even.
 >> Stay informed about: Is there any way to log failed insert row because of uniqu.. 
Back to top
Login to vote
chavan1

External


Since: Feb 27, 2009
Posts: 2



(Msg. 5) Posted: Mon Mar 02, 2009 7:05 am
Post subject: Re: Is there any way to log failed insert row because of unique index [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Jonathan, Everett, Vagner - Thank you very much for the responses. I
was able to log the row with START VIOLATIONS with the following
statements.

START VIOLATIONS TABLE FOR t1 max rows 1;
SET CONSTRAINTS FOR t1 FILTERING WITHOUT ERROR;
insert into t1
select * from t2 ;
STOP VIOLATIONS TABLE FOR t1;
select * from t1_vio ;
select * from t1_dia ;
drop table t1_vio ;
drop table t1_dia ;

Thanks & Regards,
-- Chavan

On Feb 28, 6:54 pm, Jonathan Leffler wrote:
> On Fri, Feb 27, 2009 at 1:22 PM,   wrote:
> >        When I am trying to insert a row into a table I am getting the
> > following error. Is there any way to log this failed row (row values)
> > because of unique index violation.
>
> > insert into t1
> > select * from t2 where col2 = 2 ;
>
> >  239: Could not insert new row - duplicate value in a UNIQUE INDEX
> > column (Unique Index:idx1).
> >  100: ISAM error:  duplicate value for a record with unique key.
>
> Consider whether START VIOLATIONS TABLE provides what you need (SQL
> Syntax Manual).
>
> If you are trying to debug an immediate problem, then this will
> probably get you the answer.
> If you are trying to do this long term, I'd probably think twice -- it
> will still work, of course, but you really shouldn't need it except in
> extraordinary situations.
>
> --
> Jonathan Leffler                   #include <disclaimer..h>
> Email: jleff....RemoveThis@earthlink.net, jleff....RemoveThis@us.ibm.com
> Guardian of DBD::Informix v2008.0513 --http://dbi.perl.org/
> "Blessed are we who can laugh at ourselves, for we shall never cease
> to be amused."
> NB: Please do not use this email for correspondence.
> I don't necessarily read it every week, even.
 >> Stay informed about: Is there any way to log failed insert row because of uniqu.. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
7.31.UD8 migration to 10.00.UC4 failed with :Con/rev: Fail.. - Hi Gang, During a migration from 7.31.UD8 to 10.00.UC4 I ran into the following error during the conversion : Con/rev: Failed to convert for Component SQL. Then the engine crashed and had not been able to bring it backup due to corruption in sysmaster....

ontape -r failed. - Hello, I need help in restoring between different Versions of Informix. We updated one of our two identical datbases from IDS 9.21 to IDS 9.40. Now I need a restore of the 9.21 database into the 9.40 database. I did an ontape -s -L 0 and tried to restore...

sql_listener: ASF_LISTEN failed - Hi, I am giving oninit -ivy. I am using Informix 9.4. on HP Tru64. It is showing no error. After that I am using onstat -d command. It is showing "shared memory not initialized for INFORMIXSERVER ifmx_db" My online.log contains following: ...

Symbol resolution failed - hello, i'm trying to install ids11.10uc2 on aix 5.2 level6. i known it's not validate but did somebody succedeed with a patch or different os level? thanks oninit -V 0509-136 Symbol pollset_create (number 33) is not exported from ..

HDR: restore failed on secondary - Greetings, >From a colleague. Does anyone have any ideas on this one? Thanks in advance for your help. Mike Badar ESRI Professional Services 1 International Ct. Broomfield, CO 80021 mbadar@esri.com 303-449-7779 www.esri.com OS: Solaris 9 IDS:....
   Database Help (Home) -> Informix All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]