Unix Technical Forum

How to transfer data from temporary table to permanent table

This is a discussion on How to transfer data from temporary table to permanent table within the Informix forums, part of the Database Server Software category; --> Hi all, Need help. 1. I have two tables with same schema one is temporary and another is permanent. ...


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:09 AM
debadatta_mishra
 
Posts: n/a
Default How to transfer data from temporary table to permanent table


Hi all,

Need help.

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.

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.


Please suggest

Regards
Deba



sending to informix-list
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:
> 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/
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 09:13 AM.


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