Unix Technical Forum

RE: How to transfer data from temporary table to permanent table

This is a discussion on RE: How to transfer data from temporary table to permanent table within the Informix forums, part of the Database Server Software category; --> Yes you got the thing nearly right If I commit each record then erro shows for for 4th[instead of ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-20-2008, 09:10 AM
debadatta_mishra
 
Posts: n/a
Default RE: How to transfer data from temporary table to permanent table


Yes you got the thing nearly right
If I commit each record then erro shows for for 4th[instead of 1st and
4th] and 15th which is proper
But my problem is I want error for 4th and 15th record which are
duplicate

And other thing is I have a input file for which I know that these lines
are duplicate[used for testing my appl] but my system does not know

It only throws error while loading into database


Do you know any other utility which can handle such errors





-----Original Message-----
From: owner-informix-list@iiug.org [mailtowner-informix-list@iiug.org]
On Behalf Of Jonathan Leffler
Sent: Tuesday, April 19, 2005 9:44 AM
To: informix-list@iiug.org
Subject: Re: How to transfer data from temporary table to permanent
table

debadatta_mishra wrote:
> 1. I have two tables with same schema one is temporary and another is
> permanent. How do we move all the data from temporary table to

permanent
> table at once.


As OTC said: INSERT INTO Permanent SELECT * FROM Temporary;

> 2.while using dbload command for a file if I have duplicate records in
> 1st and 4th , 10th and 15th then my error log is showing error in 1st

to
> 4th then 15th record. But I need only records those having error to be
> printed in my error file. If I commit dbload on each record the error
> comes properly but that would be like I am inserting each record

through
> insert command.


Your question is not clear - as OTC also commented. However, if I
understand correctly, then you have at least 15 records to insert. When

using DB-Load in a default mode, it is complaining about records 1, 2,
3, 4, 10 and 15, but when processing rows and committing each row
separately, it only complains about rows 1, 4, 10 and 15 - which agrees
with what you'd expect.

First question: if you know the records are duplicates, why are you
loading them anyway? (The probable answer is "I know they're dups
because I've loaded them so many times now - but I didn't know before I
started".)

Second: have you looked at START VIOLATIONS TABLE and STOP VIOLATIONS
TABLE? Perhaps you should.

Finally, for now (and I wonder if I'm mad, but I'll risk it), you might
care to look at SQLUPLOAD which comes with SQLCMD, and is available at
the IIUG Software Archive. It is ALPHA software - you were warned (and
that's why I doubt my sanity mentioning it). But it can insert new
records or update existing records in a table. And it has pretty good
error handling controls. However, there's at least one bug I know of,
related to handling nulls. One day, I'll get the coding done to fix it.

I know in general terms the problem, but coding it is not going to be
trivial...

(BTW: if you can reproduce the problem with DB-Load complaining unjustly

about records 2, 3, and 4 with a table schema, preloaded data, and new
data that generates the error, you could drop them to me and I'll see if

I can see what's up. But it should be the minimum data set you can get
away with - smallest number of rows, smallest number of columns. You
should also identify your platform - o/s version, and IDS version.)

--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2005.01 -- http://dbi.perl.org/

sending to informix-list
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-20-2008, 09:10 AM
Jonathan Leffler
 
Posts: n/a
Default Re: How to transfer data from temporary table to permanent table

debadatta_mishra wrote:
> Yes you got the thing nearly right
> If I commit each record then erro shows for for 4th[instead of 1st and
> 4th] and 15th which is proper
> But my problem is I want error for 4th and 15th record which are
> duplicate
>
> And other thing is I have a input file for which I know that these lines
> are duplicate[used for testing my appl] but my system does not know
>
> It only throws error while loading into database
>
> Do you know any other utility which can handle such errors


I previously wrote:
>> Second: have you looked at START VIOLATIONS TABLE and STOP VIOLATIONS
>> TABLE? Perhaps you should.


Did you take a look? There's an outside chance they're a feature of IDS
9.30 and not in 9.21, but I don't think so.

--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2005.01 -- http://dbi.perl.org/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:49 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com