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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 [mailto 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 |
| ||||
| 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/ |