Drop parent table with disabled child constraints?
I have a table I would like to drop and recreate. I do not want to have to recreate all the foreign key constraints again. Can I disable the foreign key constraints, drop the table and then recreate the table and enable the foreign key constraints?
Thanks,
John E.
No.
The Triggers,Indexes,Constraints etc, assocated with a table are bound to the table they are defined for.
They owe their existance to the existance of the table.
If the table goes, so do the constraints.
If you have Oracle9i, can use DBMS_METADATA to generate the DDL script of the table before dropping it.
Similar Messages
-
Join a Parent Table with 2 Child table based on a value
Dear Guru's
We have a Parent Table and 2 Child table . The Parent Table has a column like seqtype with only 2 possible values C and S . If the Value is C , then the details are available in Child 1 table and if the Value is S then the Details are in Child 2 table
How can we query the Data from this type of arrangement ? I am little bit confused and hit a road block
Will the following query will work ?
Select
from Parent P , Child C1, Child C2
where P.seqtype = C1.Seqtype
and P.seqtype = C2.Seqtype
With Warm Regards
ssrYou didn't mention the column names in two child tables. Whether the columns are same in 2 tables of these are different.
If the columns are same better to go and change your design to have only one child table. However if stiil business stops you having one table you can use UNION ALL (Assuming you want to fetch same column information from two child tables) like below:
SELECT p.col1
,c1.col2
,c1.col3
,c1.col4
FROM parent p
,child c1
WHERE p.seqtype = c1.seqtype
UNION ALL
SELECT p.col1
,c2.col2
,c2.col3
,c2.col4
FROM parent p
,child c2
WHERE p.seqtype = c2.seqtype Regards
Arun -
ORA 2266 -- Drop parent partition with no child records exists
Hi Team ,
Here I have a parent partitioned table and child refrenced non-partition table .
To drop parent partition I am doing
1)delete from child
2)delete from parent partition
3)alter table drop parent partition
---and its working fine .
I am trying to do below which is not working , Could you please guide me why it is not
1)delete from child
2)alter table drop parent partition -- throwing below error
Summarizing ,
Why I am not able to drop/trunc a parent partition(no corresponding rows exists in child tables) where as able to do after deleting the rows from parent partition .
From Doc :
Error: ORA 2266
Text: table has some unique/primary keys that are referenced by some foreign k
eys
Cause: Attempt to drop the table while the table still has some unique/
primary keys that are referenced by some foreign keys.
Action: Remove all such references to the keys before dropping the table
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - ProductionOracle decides what the rules are & you must conform to them
bcm@bcm-laptop:~$ oerr ora 2266
02266, 00000, "unique/primary keys in table referenced by enabled foreign keys"
// *Cause: An attempt was made to truncate a table with unique or
// primary keys referenced by foreign keys enabled in another table.
// Other operations not allowed are dropping/truncating a partition of a
// partitioned table or an ALTER TABLE EXCHANGE PARTITION.
// *Action: Before performing the above operations the table, disable the
// foreign key constraints in other tables. You can see what
// constraints are referencing a table by issuing the following
// command:
// SELECT * FROM USER_CONSTRAINTS WHERE TABLE_NAME = "tabnam"; -
Hi all,
Long time ago, I manually created a Database (APGriMMRP) and 3 Tables (dbo.Table_1_XYcoordinates, dbo.Table_2_Soil, and dbo.Table_3_Water) in my SQL Server 2012 Management Studio (SSMS2012). The dbo.Table_1_XYcoordinates has the following columns: file_id,
Pt_ID, X, Y, Z, sample_id, Boring. The dbo.Table_2_Soil has the following columns: Boring, sample_date, sample_id, Unit, Arsenic, Chromium, Lead. The dbo.Table_3_Water has the following columns: Boring, sample_date, sample_id, Unit, Benzene, Ethylbenzene,
Pyrene. The dbo.Table_1_XYcoordinates is a Parent Table. The dbo.Table_2_Soil and the dbo.Table_3_Water are 2 Child Tables. The sample_id is key link for the relationship between the Parent Table and the Child Tables.
Problem #1) How can I print out or export these 3 dbo Tables?
Problem #2) If I right-click on the dbo Table, I see "Start PowerShell" and click on it. I get the following error messages: Warning: Failed to load the 'SQLAS' extension: An exception occurred in SMO while trying to manage a service.
--> Failed to retrieve data for this request. --> Invalid class. Warning: Could not obtain SQL Server Service information. An attemp to connect to WMI on 'NAB-WK-02657306' failed with the following error: An exception occurred in SMO while trying
to manage a service. --> Failed to retrieve data for this request. --> Invalid class. .... PS SQLSERVER:\SQL\NAB-WK-02657306\SQLEXPRESS\Databases\APGriMMRP\Table_1_XYcoordinates> What causes this set of error messages? How can
I get this problem fixed in my PC that is an end user of the Windows 7 LAN System? Note: I don't have the regular version of Microsoft Visual Studio 2012 in my PC. I just have the Microsoft 2012 Shell (Integrated) program in my PC.
Problem #3: I plan to create an XML Schema Collection in the "APGriMMRP" database for the Parent Table and the Child Tables. How can I handle the relationship between the Parent Table and the Child Table in the XML Schema Collection?
Problem #4: I plan to extract some results/data from the Parent Table and the Child Table by using XQuery. What kind of JOIN (Left or Right JOIN) should I use in the XQuerying?
Please kindly help, answer my questions, and advise me how to resolve these 4 problems.
Thanks in advance,
Scott ChangIn the future, I would recommend you to post your questions one by one, and to the appropriate forum. Of your questions it is really only #3 that fits into this forum. (And that is the one I will not answer, because I have worked very little with XSD.)
1) Not sure what you mean with "print" or "export", but when you right-click a database, you can select Tasks from the context menu and in this submenu you find "Export data".
2) I don't know why you get that error, but any particular reason you want to run PowerShell?
4) If you have tables, you query them with SQL, not XQuery. XQuery is when you query XML documents, but left and right joins are SQL things. There are no joins in XQuery.
As for left/right join, notice that these two are equivalent:
SELECT ...
FROM a LEFT JOIN b ON a.col = b.col
SELECT ...
FROM b RIGHT JOIN a ON a.col = b.col
But please never use RIGHT JOIN - it gives me a headache!
There is nothing that says that you should use any of the other. In fact, if you are returning rows from parent and child, I would expect an inner join, unless you want to cater for parents without children.
Here is an example where you can study the different join types and how they behave:
CREATE TABLE apple (a int NOT NULL PRIMARY KEY,
b varchar(23) NOT NULL)
INSERT apple(a, b)
VALUES(1, 'Granny Smith'),
(2, 'Gloster'),
(4, 'Ingrid-Marie'),
(5, 'Milenga')
CREATE TABLE orange(c int NOT NULL PRIMARY KEY,
d varchar(23) NOT NULL)
INSERT orange(c, d)
VALUES(1, 'Agent'),
(3, 'Netherlands'),
(4, 'Revolution')
SELECT a, b, c, d
FROM apple
CROSS JOIN orange
SELECT a, b, c, d
FROM apple
INNER JOIN orange ON apple.a = orange.c
SELECT a, b, c, d
FROM apple
LEFT OUTER JOIN orange ON apple.a = orange.c
SELECT a, b, c, d
FROM apple
RIGHT OUTER JOIN orange ON apple.a = orange.c
SELECT a, b, c, d
FROM apple
FULL OUTER JOIN orange ON apple.a = orange.c
go
DROP TABLE apple, orange
Erland Sommarskog, SQL Server MVP, [email protected] -
I am using a child table 'CHILD_T' and in this table the column 'CHILD_FK' is the foreign key and it is pointing to some parent table. In my oracle editor I can see only synonyms but not actual tables. Is there any way to find out the parent table for this child table. Why I am asking this is because , I am getting below error while trying to execute the below script.
Here I think my question is pretty simple but I would like to know how to find a parent table of a child table as I can see only synonyms instead actual tables.
Script :
INSERT INTO CHILD_T ( EM_ID, DFLT_COST_CNTR_TXT, ACCT_TYP_ID, DFLT_ORD_TYP_ID ) VALUES ('abcd', 'NA', '1', '1' );
Error:
SQL Error: ORA-02291: integrity constraint (AFM.USR_PROF_EM_ID) violated - parent key not found.
Any one have any idea your help is well appreciated.select table_name from user_constraints where constraint_name in
(select r_constraint_name from user_constraints where constraint_name='YOUR_CONSTARINT_NAME'); -
how to drop a parent table???
if there is hundreds of child table,then it is not possible to disable all the Foreign key one by one...810045 wrote:
how to drop a parent table???
if there is hundreds of child table,then it is not possible to disable all the Foreign key one by one...Why not?
Assuming you need 30 sec to disable a FK manually. And you have like 200 child tables (I doubt that you have that much, but lets just check the maximum amount).
Then you would need like 1 h 40 min of concentrated disableing. I think this is very well possible. -
Master table with two child tables in ADF Framework
Hi,
I'm trying to implement single master with two detail tables using oracle adf framework of Jdev 11.1.1.4.0. I'm able to do single master-detail by using view link but unable to achieve nested details block i.e., master with nested child blocks.
I created Query based view object of Master and two query based view objects as details. Then I created two view link for master with first child and another view link for master with second child. Even then in my data controls I see as two different components which is incorrect.
Please let me know how to create a data control for an example shown below:
Fruits [MASTER]
--- Details of Fruits as adf table
-- Apples [FIRST CHILD]
---- Details of Apples as adf table
-- Oranges [SECOND CHILD]
---- Details of Oranges as adf table
Regards,
Amar.You need two viewLinks
Fruits->Apples
Fruits->Oranges
Then in the data model you pick the Fruits entry that has:
Fruits
|--->Apples
You stand on Fruits and you shuttle the Oranges to be under it from the left.
If you'll use the default HR schema you'll see this type of relation for Employees:
https://blogs.oracle.com/shay/entry/master_with_two_details_on_the -
Expdp table with grants indexes constraints etc
hi
i need to export table/sometime table partitions including grants, constraints, indexes
this is what im using..
expdp parfile=par.exp directory=expdir dumpfile=exp1.dmp tables=hr.employee
parfile.exp is:
userid="/ as sysdba"
JOB_NAME=dbajob
do i need to include more options?
thanks in advanceHi. As i know the indexes and the constraints need to be created with a different name.
Try DBMS_METADATA.get_ddl to export your constraints and indexes. -
Dear All,
I have a script which creates tables and triggers and drop the tables.
I want to know if the triggers are dropped automatically when we drop the tables and when we create the tables what is the name of the tablespace that they are created in ?
thank you in advance for your replyTriggers are dropped automatically when you drop the associated table.
SQL> create table a (id number);
Table created.
SQL> create trigger trga before insert on a for each row
2 begin
3 null;
4 end;
5 /
Trigger created.
SQL> select trigger_name from user_triggers where table_name = 'A';
TRIGGER_NAME
TRGA
SQL> drop table a;
Table dropped.
SQL> select trigger_name from user_triggers where table_name = 'A';
no rows selected -
Script will create database, 3 database objects and publish.
The error is due to the generation script to create the conflict tables that is not stripping out default constraints that reference a UDF.
As you can see below, the failure is on the generation script for the conflict table.
The conflict table should be a bucket table that shouldn’t enforce data integrity.
See how the default constraints for the columns someint and somestring were stripped out of the generation logic however the default constraint that utilizes a UDF persist and uses the same object name that was used on the production table (The
bold line) , this occurs if I explicitly name the constraint or let the system generate the name for me like in the example posted.
The only way I could see getting around this right now is to drop all default constraints in the system that uses a UDF, publish then add the constraints back which is vulnerable to invalid data and a lot of moving
steps. This all worked with SQL 2000, 2005, 2008, 2008r2, it’s stopped working in SQL 2012 and continues to not work in SQL 2014.
Error messages:
Message: There is already an object named 'DF__repTable__id__117F9D94' in the database.
Could not create constraint. See previous errors.
Command Text: CREATE TABLE [dbo].[MSmerge_conflict_MergeRepFailurePublication_repTable](
[id] [varchar](8) NULL CONSTRAINT [DF__repTable__id__117F9D94] DEFAULT ([dbo].[repUDF]()),
[somedata] [varchar](64) NULL,
[rowguid] [uniqueidentifier] ROWGUIDCOL NULL,
[someint] [int] NULL,
[somestring] [varchar](64) NULL
Parameters:
Stack: at Microsoft.SqlServer.Replication.AgentCore.ReMapSqlException(SqlException e, SqlCommand command)
at Microsoft.SqlServer.Replication.AgentCore.AgentExecuteNonQuery(SqlCommand command, Int32 queryTimeout)
at Microsoft.SqlServer.Replication.AgentCore.ExecuteDiscardResults(CommandSetupDelegate commandSetupDelegate, Int32 queryTimeout)
at Microsoft.SqlServer.Replication.Snapshot.YukonMergeConflictTableScriptingManager.ApplyBaseConflictTableScriptToPublisherIfNeeded(String strConflictScriptPath)
at Microsoft.SqlServer.Replication.Snapshot.BaseMergeConflictTableScriptingManager.DoConflictTableScriptingTransaction(SqlConnection connection)
at Microsoft.SqlServer.Replication.RetryableSqlServerTransactionManager.ExecuteTransaction(Boolean bLeaveTransactionOpen)
at Microsoft.SqlServer.Replication.Snapshot.BaseMergeConflictTableScriptingManager.DoConflictTableScripting()
at Microsoft.SqlServer.Replication.Snapshot.MergeSmoScriptingManager.GenerateTableArticleCftScript(Scripter scripter, BaseArticleWrapper articleWrapper, Table smoTable)
at Microsoft.SqlServer.Replication.Snapshot.MergeSmoScriptingManager.GenerateTableArticleScripts(ArticleScriptingBundle articleScriptingBundle)
at Microsoft.SqlServer.Replication.Snapshot.MergeSmoScriptingManager.GenerateArticleScripts(ArticleScriptingBundle articleScriptingBundle)
at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.GenerateObjectScripts(ArticleScriptingBundle articleScriptingBundle)
at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.DoScripting()
at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.DoScripting()
at Microsoft.SqlServer.Replication.Snapshot.MergeSnapshotProvider.DoScripting()
at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.GenerateSnapshot()
at Microsoft.SqlServer.Replication.SnapshotGenerationAgent.InternalRun()
at Microsoft.SqlServer.Replication.AgentCore.Run() (Source: MSSQLServer, Error number: 2714)
Get help: http://help/2714
Server COL-PCANINOW540\SQL2012, Level 16, State 0, Procedure , Line 1
Could not create constraint. See previous errors. (Source: MSSQLServer, Error number: 1750)
Get help: http://help/1750
Server COL-PCANINOW540\SQL2012, Level 16, State 0, Procedure , Line 1
Could not create constraint. See previous errors. (Source: MSSQLServer, Error number: 1750)
Get help: http://help/1750
Pauly C
USE [master]
GO
CREATE DATABASE [MergeRepFailure]
ALTER DATABASE [MergeRepFailure] SET COMPATIBILITY_LEVEL = 110
GO
USE [MergeRepFailure]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create view
[dbo].[repView] as select right(newid(),8) as id
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[repUDF]()
RETURNS varchar(8)
BEGIN
declare @val varchar(8)
select top 1 @val = id from [repView]
return @val
END
GO
create table repTable
id varchar(8) default([dbo].[repUDF]()),
somedata varchar(64) null,
rowguid uniqueidentifier ROWGUIDCOL default(newid()),
someint int default(1),
somestring varchar(64) default('somestringvalue')
GO
insert into reptable (somedata) values ('whatever1')
insert into reptable (somedata) values ('whatever2')
go
/*test to make sure function is working*/
select * from reptable
GO
/*Publish database*/
use [MergeRepFailure]
exec sp_replicationdboption @dbname = N'MergeRepFailure', @optname = N'merge publish', @value = N'true'
GO
declare @Descrip nvarchar(128)
select @Descrip = 'Merge publication of database ''MergeRepFailure'' from Publisher ''' + @@servername +'''.'
print @Descrip
-- Adding the merge publication
use [MergeRepFailure]
exec sp_addmergepublication @publication = N'MergeRepFailurePublication', @description = N'@Descrip',
@sync_mode = N'native', @retention = 14, @allow_push = N'true', @allow_pull = N'true', @allow_anonymous = N'true',
@enabled_for_internet = N'false', @snapshot_in_defaultfolder = N'true', @compress_snapshot = N'false', @ftp_port = 21,
@ftp_subdirectory = N'ftp', @ftp_login = N'anonymous', @allow_subscription_copy = N'false', @add_to_active_directory = N'false',
@dynamic_filters = N'false', @conflict_retention = 14, @keep_partition_changes = N'false', @allow_synctoalternate = N'false',
@max_concurrent_merge = 0, @max_concurrent_dynamic_snapshots = 0, @use_partition_groups = null, @publication_compatibility_level = N'100RTM',
@replicate_ddl = 1, @allow_subscriber_initiated_snapshot = N'false', @allow_web_synchronization = N'false', @allow_partition_realignment = N'true',
@retention_period_unit = N'days', @conflict_logging = N'both', @automatic_reinitialization_policy = 0
GO
exec sp_addpublication_snapshot @publication = N'MergeRepFailurePublication', @frequency_type = 4, @frequency_interval = 14, @frequency_relative_interval = 1,
@frequency_recurrence_factor = 0, @frequency_subday = 1, @frequency_subday_interval = 5, @active_start_time_of_day = 500, @active_end_time_of_day = 235959,
@active_start_date = 0, @active_end_date = 0, @job_login = null, @job_password = null, @publisher_security_mode = 1
use [MergeRepFailure]
exec sp_addmergearticle @publication = N'MergeRepFailurePublication', @article = N'repTable', @source_owner = N'dbo', @source_object = N'repTable', @type = N'table',
@description = null, @creation_script = null, @pre_creation_cmd = N'drop', @schema_option = 0x000000010C034FD1, @identityrangemanagementoption = N'manual',
@destination_owner = N'dbo', @force_reinit_subscription = 1, @column_tracking = N'false', @subset_filterclause = null, @vertical_partition = N'false',
@verify_resolver_signature = 1, @allow_interactive_resolver = N'false', @fast_multicol_updateproc = N'true', @check_permissions = 0, @subscriber_upload_options = 0,
@delete_tracking = N'true', @compensate_for_errors = N'false', @stream_blob_columns = N'false', @partition_options = 0
GO
use [MergeRepFailure]
exec sp_addmergearticle @publication = N'MergeRepFailurePublication', @article = N'repView', @source_owner = N'dbo', @source_object = N'repView',
@type = N'view schema only', @description = null, @creation_script = null, @pre_creation_cmd = N'drop', @schema_option = 0x0000000008000001,
@destination_owner = N'dbo', @destination_object = N'repView', @force_reinit_subscription = 1
GO
use [MergeRepFailure]
exec sp_addmergearticle @publication = N'MergeRepFailurePublication', @article = N'repUDF', @source_owner = N'dbo', @source_object = N'repUDF',
@type = N'func schema only', @description = null, @creation_script = null, @pre_creation_cmd = N'drop', @schema_option = 0x0000000008000001,
@destination_owner = N'dbo', @destination_object = N'repUDF', @force_reinit_subscription = 1
GOMore information, after running a profile trace the following 2 statements, the column with the default on a UDF returns a row while the other default does not. This might be the cause of this bug. Is the same logic to generate the object on
the subscriber used to generate the conflict table?
exec sp_executesql N'
select so.name, schema_name(so.schema_id)
from sys.sql_dependencies d
inner join sys.objects so
on d.referenced_major_id = so.object_id
where so.type in (''FN'', ''FS'', ''FT'', ''TF'', ''IF'')
and d.class in (0,1)
and d.referenced_major_id <> object_id(@base_table, ''U'')
and d.object_id = object_id(@constraint, ''D'')',N'@base_table nvarchar(517),@constraint nvarchar(517)',@base_table=N'[dbo].[repTable]',@constraint=N'[dbo].[DF__repTable__id__117F9D94]'
exec sp_executesql N'
select so.name, schema_name(so.schema_id)
from sys.sql_dependencies d
inner join sys.objects so
on d.referenced_major_id = so.object_id
where so.type in (''FN'', ''FS'', ''FT'', ''TF'', ''IF'')
and d.class in (0,1)
and d.referenced_major_id <> object_id(@base_table, ''U'')
and d.object_id = object_id(@constraint, ''D'')',N'@base_table nvarchar(517),@constraint nvarchar(517)',@base_table=N'[dbo].[repTable]',@constraint=N'[dbo].[DF__repTable__somein__1367E606]'
Pauly C -
Drag and Drop from Table with Treebynestingtablecolumn
Hi,
I am using table UI element in Webdynpro ABAP.
And I am showing data in tree format using element TreeByNestingTableColumnn.
Now I tried to implement the Drag functionality for a nested table line and I face two problems:
1. The requirement is to drag an item out of the table without selecting the reow before! I tried it (by implementing a dragable image etc.) but it seems that it is necessary to select the row first before being able to drag. The problem is that I don't use the property row selectable, so I can't select and therefore I cant drag, right?
Is it possible to drag an item out of the table but not selecting it before?
2. In the meanwhile I decided to use the property "row selectable". Now I am able to drag.
BUT, if I drag a nested item (a child item) and drop it, then - instead of the expected data-reference of the selected item - the data reference of the fathers node will be provided within wdevent. Does anyone know why? and is my requiremnt solvable?
Thanks and regards
OliverHi Saravanan,
thanks a lot for your answer. I was happy to hear that someone else also has the same curious problems than me
In the meanwhile I was able to solve my requirement and I describe the solution here:
- Important is how the table is defined:
--> Set rowSelectable to 'true'
--> Set selectionMode to 'none'
- Insert a column. Insert as CellEditor an "Image". Mark the image as "isDragHandle". Now insert a DragSourceInfo.
Take care on correct data binding.
For any reason it works now With Treebynestingtablecolumn and without selecting a row, but by dragging the image.
Best regards
Oliver -
[Answers] Parent section with all childs of all members
Hi all,
I am trying to do a pivot table having in 'Sections' a parent hierarchy level, and the child in 'Columns' , so in every section created I get all the members of the child level with empty values.
Normally we should have in a specific section only the childs of the corresponding parent level member, How can we do this plz.
If it's not very well explained please tell so.
ThanksI'm sorry, Elazhari, I am a bit confused.
Are you saying there is an error or problem, or you just don't know how to do it?
Do you have the parent-child hierearchy set up correctly in your rpd? If so, it should be no problem. Say you have Regions>District>Branches with this hierarchy set up.
Then in your pivot table, you can have Regions in the "Pages" section, District in the "Sections" section, and the Branches will be in your rows.
Under each parent level, the children would be as you would expect. I anticipate that there is more, so if this doesn't help you, please supply more information. -
On insert into parent table insert into child tables
hi all,
please suggest me an idea for below scenario in plsql
i have a main table where every day 10k records are inserted,
now when ever the main table gets inserted the same records should inserted into two other child tables.
main table will have 20 columns and two child tables will have 10 each columns with one common column in all three tables.
suggest me if a trigger is best or a procedure is best for this if possible with a solution.
thanks in advancelook at INSERT ALL
sample from http://psoug.org/reference/insert.html
INSERT ALL
INTO ap_cust VALUES (customer_id, program_id, delivered_date)
INTO ap_orders VALUES (order_date, program_id)
SELECT program_id, delivered_date, customer_id, order_date
FROM airplanes; -
Tables with Circular Foreign Constraints
Can you load data into the two tables (they both have the a foreign key from each other) without dropping the foreign
key constraints one at a time?If the foreign key constraints are created as DEFERRABLE, the checks are deferred until you commit. This would allow you to load both tables - and then commit at the end. Of course, if there are any constraint violations at that point, the entire transaction will rollback.
-
Right way to preserve all parent table entries in a join with many tables!!
This problem is quite interesting to me. I have asked this question to others but no body is able to provide me with proper answers.
The problem is: How do I join a huge parent table with many child tables (more than 5 child tables) preserving all of the parent table entries. Lets say there is the parent table parentTable and three child tables childTable1, childTable2, childTable3. In order to get the data after joining these tables the query that I have been using was:
select parent.field1, parent.field2, parent.field3, child1.field4, child1.field5, child2.field6, child3.field7 from ParentTable parent, childTable1 child1, childTable1 child2, childTable3 child3 where parent.fielda = child1.fieldb and parent.fieldc = child.fieldd and parent.fielde = child.fieldf.
Although the tables are huge (more than 100,000 entries), this query is very fast, however those parent table entries which do not have child entries are lost. I know that I can left join a parent table with a child table and then with the next child table and then with the next child table and continue. Isn't there a simple solution for this commonly happening problem?
Please provide suggestions please...Hello Lakshmi,
Although I do not know exactly how to achieve what you want to achieve but I have seen DBAs/ABAPers in my experience can run queries/scripts using the COUNT function to give the actual number of line items per table for all your 100 or odd tables.
Rgds
CONMJI
Maybe you are looking for
-
XI transformer configuration exception
Hi, I wonder if someone can help. I am struggling with an XSL that has been imported into XI. It is a mapping that has been used in another XI system (that I do not have access to) but I have a screen shot of the XSL. I have 'imported' this as an arc
-
Strange problem with PP_ORDER with SARA
Hello, We are facing a problem with archiving of PP_ORDER object. We archived production orders from 100000000096 to 100000000113 where: 1. Order 100000000113 which was collective order for orders 1..104 to 1..112 2. Order 100000000103 which was co
-
PSE 11 Not Showing in iTunes 11 drop down
I have iTunes 11.0.1 installed on my mac OSX 10.8.2 and Photoshop Elements 11. When syncing my iPad, photoshop does not appear in the drop down menu in the photos section, only iPhoto or the option to select a folder appears. I have re-installed iTun
-
Recreating my iTunes library from my iPod classic
I recently had to reinstall Windows XP on my laptop for various reasons. Obviously, in the process I wiped clean my iTunes library. I am now wary of synchronisng my iPod classic as I have a LOT of DVDs, purchased music, etc. that took a considerable
-
DG4ODBC configured and working but receiving ORA-28528 for some columns
DG4ODBC is configured and working for XE 11gR2 but under some circumstance receiving SQL Error: ORA-28528: Heterogeneous Services datatype conversion error. Configuration: DG4ODBC configured for Oracle 11gR2 using ODBC datasource based on IBM UniVers