473,569 Members | 2,765 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 2141
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
4048
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 null ); create table if not exists nnet_produkt_farge ( nnet_produkt_farge_id int not null auto_increment, primary key(nnet_produkt_farge_id),
6
6563
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 about 100 records and a field.status=1 in a existing_table and i want to create a temp_table with all the recordse and values of the existing_table ...
4
4430
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 creates a table called "@NewTableName". Any ideas? CREATE PROCEDURE dbo.sp_FFProduction_CreateTable (
7
9668
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 PrjStructId, ProjectId, PrjStructName, ..., ParentId PrjStructParent contains a reference to the parent or to itselves if record is top-level-record...
1
3344
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, ============================================================================== A1 |A2 A3 A4 A5 A6 A7 A8 |A9 A10 ...
24
3077
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 (primary key) FirstName MiddleName LastName
6
7700
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 which reads and drops the same temporary table. My users are not able to create dbo tables (eg dbo.tblTest), but are permitted to create tables under...
27
3766
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 updates the same data in all other four tables in the right places. I know it would be possible by using the ForeignKeyConstraint object. I have created...
4
12422
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 this: can Access create the document and place it as an OLE object to the relevant table? Any help is greatly appreciated. Ricky
2
2423
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 value entered in the name column. Let's say a new column is entered with the value of name column as mickey. I want to create a table called mickey,...
0
7697
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8120
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7672
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6283
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
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 we have to send another system

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.