473,503 Members | 2,150 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create table

13 New Member
Hi,
I have to create table from one sql but its taking long time for creating the table so please provide the solution ASAP

Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE DN_UNCOMMON NOLOGGING AS
  2. SELECT *
  3.   FROM DR_CONTRIBUTION_DN dn
  4.  WHERE NOT EXISTS (
  5.           SELECT *
  6.             FROM DR_CONTRIBUTION_PS ps
  7.            WHERE (dn.ID = ps.ri_donor_id
  8.                   AND dn.idtype = ps.ri_donor_type
  9.                   AND dn.giftseqnum = ps.doc_seq_nbr
  10.                   AND ROUND (dn.giftamt) = ROUND (ps.monetary_amount_up)
  11.                   AND TRUNC (dn.batchdt) = TRUNC (ps.accounting_dt))
  12.                   OR (dn.ID = ps.ri_donor_id
  13.                   AND dn.idtype = ps.ri_donor_type
  14.                   AND dn.psbusinessunit = ps.deposit_bu
  15.                   AND dn.psdepositid = ps.deposit_id
  16.                   AND dn.pspymntseqnum = ps.payment_seq_num
  17.                   AND dn.psdstseqnum = ps.dst_seq_num
  18.                   AND ROUND (dn.giftamt) = ROUND (ps.monetary_amount_up)
  19.                   AND TRUNC (dn.batchdt) = TRUNC (ps.accounting_dt)))
  20.  
This sql query contains two tables DR_CONTRIBUTION_DN(Records 7665067)
and second table contains DR_CONTRIBUTION_PS(Records 10025191)

Please provide me the solution for creating this table fast.

Best Regards,
Kiran
Apr 28 '10 #1
3 2129
magicwand
41 New Member
Kirian,

could you cut/paste the following code into a SQL*Plus session and post the result ?

Expand|Select|Wrap|Line Numbers
  1. set autotrace on
  2. SELECT * 
  3.   FROM DR_CONTRIBUTION_DN dn 
  4.  WHERE NOT EXISTS ( 
  5.           SELECT * 
  6.             FROM DR_CONTRIBUTION_PS ps 
  7.            WHERE (dn.ID = ps.ri_donor_id 
  8.                   AND dn.idtype = ps.ri_donor_type 
  9.                   AND dn.giftseqnum = ps.doc_seq_nbr 
  10.                   AND ROUND (dn.giftamt) = ROUND (ps.monetary_amount_up) 
  11.                   AND TRUNC (dn.batchdt) = TRUNC (ps.accounting_dt)) 
  12.                   OR (dn.ID = ps.ri_donor_id 
  13.                   AND dn.idtype = ps.ri_donor_type 
  14.                   AND dn.psbusinessunit = ps.deposit_bu 
  15.                   AND dn.psdepositid = ps.deposit_id 
  16.                   AND dn.pspymntseqnum = ps.payment_seq_num 
  17.                   AND dn.psdstseqnum = ps.dst_seq_num 
  18.                   AND ROUND (dn.giftamt) = ROUND (ps.monetary_amount_up) 
  19.                   AND TRUNC (dn.batchdt) = TRUNC (ps.accounting_dt))) 
  20. and rownum < 1;
  21.  
Apr 28 '10 #2
kiranrajenimbalkar
13 New Member
Hi
Above SQL giving no rows..
I want all records insert into that created table DN_UNCOMMON.

Please provide me the solution that how to create the above mentioned table.
Apr 28 '10 #3
magicwand
41 New Member
Hi,

I didn't want the rows (that's the reason for the rownum < 1).

The important part is the "set autotrace on" which should give you the execution plan ...
Apr 28 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
4044
by: Phil Powell | last post by:
create table if not exists nnet_produkt_varegruppe ( nnet_produkt_varegruppe_id int not null auto_increment, primary key(nnet_produkt_varegruppe_id), nnet_produkt_varegruppe_navn varchar(255) not...
6
6560
by: dev | last post by:
how create a temp table as a copy of a existing table and then update1 field and insert the hole temp table back in the existing table? please any help? if i have 10 fields in 1 record and...
4
4428
by: Michael Jackson | last post by:
I have a stored procedure to create a table. In my program I want the user to name the table to be created, therefore I pass a parameter to the SP for the table name. I cannot get it to work. It...
7
9664
by: Wolfgang Kreuzer | last post by:
Hello all, I have two tables - Projects and ProjectStruct Table Projects contains master records of the projects, ProjectStruct allows to define a project herarchie and contains the fields...
1
3338
by: poohnie08 | last post by:
i have a excel spreadsheet showing staff name, date,work hour, ot hour, slot1, slot2, slot3, slot4 and others). The "()" will keep repeating from day 1 until end of month. eg in excel spreadsheet,...
24
3073
by: flkeyman | last post by:
Work in legal office. Trying to create solid designed database structure. This is list of tables w/fields and primary keys. Any comments/advice greatly appreciated. tbl-Defendants CaseNumber...
6
7686
by: Peter Nurse | last post by:
For reasons that are not relevant (though I explain them below *), I want, for all my users whatever privelige level, an SP which creates and inserts into a temporary table and then another SP...
27
3740
by: max | last post by:
Hello, I am a newbye, and I'm trying to write a simple application. I have five tables with three columns; all tables are identical; I need to change some data in the first table and let VB...
4
12412
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
2
2418
by: lakuma | last post by:
Hi, I have a table called A (say) with columns called name, place, animal and thing. I would want to write an on insert trigger on this table, which would create a table with the name of the...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
4688
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3168
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
746
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
399
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.