Retriving data from more than one table
I have 6 tables with name A,B,C,D,E,F all of them have 1 column as common. I need help in developing a sql query which will give me name of table where record is present and number of its occurrences.
926085 wrote:
I have 6 tables with name A,B,C,D,E,F all of them have 1 column as common. I need help in developing a sql query which will give me name of table where record is present and number of its occurrences.You can check the table_name where column value is present by
select table_name, AVG_COL_LEN from user_tab_columns where column_name='ID' and AVG_COL_LEN != 0;You'll get the results if you have all these table analyzed
Similar Messages
-
JDBC-XI-FILE scenario. How to extract data from more than one table in JDBC
Hi,
I was asked a question like in JDBC-XI-FILE scenario........ How to extract data from more than one tables (i.e from JDBC system) ?? What is the logic to do the same ??
I am not sure whether this is a valid question..........but any help in this regards is highly appreciated.
Regards
KumarHI,
Yes it can be possible ,please see the following links
JDBC Receiver with Oracle Stored Procedures
configuring jdbc adapter with multiple tables
RFC -> XI -> JDBC Scenario Updating Multiple Tables
/people/alessandro.berta/blog/2005/10/04/save-time-with-generalized-jdbc-datatypes
JDBC Adapter multiple Selects
https://www.sdn.sap.com/irj/sdn/advancedsearch?query=jdbc%20with%20multiple%20tables&cat=sdn_all
Regards
Chilla.. -
Looking data from more than one table and inserting into another.
Hello,
I am giving you the Table structures as per my requirement..
CREATE TABLE TEMP_A
(NAME VARCHAR2(100) primary key);
CREATE TABLE TEMP_B
(STRUCTURE VARCHAR2(10));
CREATE TABLE TEMP_C
( NAME VARCHAR2(100),
STRUCTURE VARCHAR2(10),
VALUE VARCHAR2(10));
Alter table TEMP_C
add constraint fk_name_tempc foreign key(name) references TEMP_A(name)
INSERT INTO TEMP_A VALUES('SMITH');
INSERT INTO TEMP_A VALUES('ALLEN');
INSERT INTO TEMP_A VALUES('WARD');
INSERT INTO TEMP_A VALUES('JONES');
COMMIT;
INSERT INTO TEMP_B VALUES('IN');
INSERT INTO TEMP_B VALUES('IN_MIN');
INSERT INTO TEMP_B VALUES('IN_TYP');
INSERT INTO TEMP_B VALUES('IN_MAX');
INSERT INTO TEMP_B VALUES('DIP');
INSERT INTO TEMP_B VALUES('TIM');
COMMIT;
INSERT INTO TEMP_c VALUES('SMITH','C1','');
INSERT INTO TEMP_c VALUES('SMITH','C2','');
INSERT INTO TEMP_c VALUES('SMITH','D1','');
INSERT INTO TEMP_c VALUES('ALLEN','D2','');
INSERT INTO TEMP_c VALUES('ALLEN','R1','');
INSERT INTO TEMP_c VALUES('WARD','R2','');
COMMIT;
i want to say is it should insert into table 'TEMP_C' values as :
For 'SMITH' there should be (6 * 3) = 18 records.
( 6 distinct values of TEMP_B for SMITH to be inserted into TEMP_C against 'C1')
( 6 distinct values of TEMP_B for SMITH to be inserted into TEMP_C against 'C2')
( 6 distinct values of TEMP_B for SMITH to be inserted into TEMP_C against 'D1')
For 'ALLEN' there should be (6 * 2) = 12 records.
( 6 distinct values of TEMP_B for ALLEN to be inserted into TEMP_C against 'D2')
( 6 distinct values of TEMP_B for ALLEN to be inserted into TEMP_C against 'R1')
For 'WARD' there should be (6 * 1) = 6 records.
( 6 distinct values of TEMP_B for WARD to be inserted into TEMP_C against 'R2')
Like this if there are records for JONES also , it should also do the same way( Depending on the No. of records present
in the table 'TEMP_C' for 'JONES').
Thanks in advance,
AmkotzIs this what you are looking for?
SQL> insert into temp_c (name, structure, value)
2 select c.name, c.structure, b.structure
3 from temp_a a, temp_c c, temp_b b
4 where a.name = c.name
5 ;
36 rows created.
SQL> select * from temp_c;
NAME STRUCTURE VALUE
SMITH C1
SMITH C2
SMITH D1
ALLEN D2
ALLEN R1
WARD R2
SMITH C1 IN
SMITH C1 IN_MIN
SMITH C1 IN_TYP
SMITH C1 IN_MAX
SMITH C1 DIP
SMITH C1 TIM
SMITH C2 IN
SMITH C2 IN_MIN
SMITH C2 IN_TYP
SMITH C2 IN_MAX
SMITH C2 DIP
SMITH C2 TIM
SMITH D1 IN
SMITH D1 IN_MIN
SMITH D1 IN_TYP
SMITH D1 IN_MAX
SMITH D1 DIP
SMITH D1 TIM
ALLEN D2 IN
ALLEN D2 IN_MIN
ALLEN D2 IN_TYP
ALLEN D2 IN_MAX
ALLEN D2 DIP
ALLEN D2 TIM
ALLEN R1 IN
ALLEN R1 IN_MIN
ALLEN R1 IN_TYP
ALLEN R1 IN_MAX
ALLEN R1 DIP
ALLEN R1 TIM
WARD R2 IN
WARD R2 IN_MIN
WARD R2 IN_TYP
WARD R2 IN_MAX
WARD R2 DIP
WARD R2 TIM
42 rows selected.
SQL> -
Retrieval of Data from More Than Two tables
Hi Experts,
How to get the data from more than two tables.
By using Jdbc, and through only core java.
I mean if i entered some empid at command prompt,
then the complete data (where empid is presented at some tables like L1,L2,L3,L4.) is to be displayed.
Bye
TulsiRam Mohan.
Message #196971Is creating view on these 4 tables is an option ?
Something like :
Select * from a
union all
select * from b
... and so on ? -
Not able to view data from more than one data package in PSA
Hi Friends,
Desparetly trying to view data in PSA. Problem :
If i mark more than one datapackage this error raises:
You must only select one data packet when entering data record numbers
Message no. RSAODS127
And there is no change to reset data record numbers.
What is wrong ?
Thanks in advance for help.
Joe
BW3.5, SP21
Edited by: J.F.B. on Jul 2, 2009 11:40 AMHi again,
Seems I'm too stupid for this issue.......
As I understand there are two ways to view PSA :
1. PSA maintenance in RSA1
2. In SE11/SE16 viewing the underlaying transparent table
ad 1.
When I try to filter erroneous records for more than one datapackage situation is as described above.
ad 2.
Trying to view the table works, but where is the chararcteristic/field marking a record as erroneous
in table /BIC/Bxxxxxxxx (table containing PSA-Data) ?
Thanks
Joe -
Submitting data to more than one table
I want to be able to use one form to submit data to two or
more tables in the same database. Does anyone know if this is
possible and if so how would I go about it. I understand how to use
a form to submit to one table I am just stuck on more than one.
I am using Access 2000 and DW MX 2004
thanks in advanceIt's usually best to use a stored procedure to handle
this. -
Creating data source in R/3 system from more than one table.
Hi All,
Currently I have a requirement where I need to bring data in BW from 5 different table in the CM (our R/3 system) system.
How do I achieve this?
If I create a generic datasource, how can I map 5 tables in a single datasource?
Please detail the process to achieve this.
Regards,
Kironmoy BanerjeeHi ,
We can create the DS based on No.Of tables.
But need to check the below points.
1. Is there any relation ship between the tables (Means common Key).
- If the above condition is Ok then directly you can use view.
2. If there is no relation you have to FM.
- Please check the below link (Pdf Document) for how to to create FM in Generic :
http://www.sdn.sap.com/irj/scn/index;jsessionid=(J2EE3417100)ID0102005850DB00995891084283618218End?rid=/library/uuid/c062a3a8-f44c-2c10-ccb8-9b88fbdcb008&overridelayout=true
Regards
Ram. -
ADF delete from more than one table with single delete operation
Hi all,
I have a scenario in which I am trying to delete record(s) from 3 tables.
My jspx page looks like this:
Column1:drop down from 1st table
Column2:drop down from 2nd table
Column3:drop down from 3rd table
Delete Commit
I have created a view object which has these three tables as entities. I drag dropped the view object and displayed these three columns.
Now when i select any one or all three or any two out of these and click delete, only the "column 1" gets deleted from 1st table. The remaining two tables remain unaffected.
Y is this so?
Can't I use one delete operation for all three tables' DML operation in single go?
Thanks.If you have a business case that requires deleting from 3 tables at once when removing a single row in a view object then you may look for the problem in you data model...
Until then I'd suggest to create a database view providing the information you need (plus the PKs fron the individual tables) and creating entity and view objects based on this view. An "instead of dele" trigger attached to the view can do the actual delete operation on the 3 tables.
bye
TPD -
Get data with more than one table
hi Gurus,
I am from ABAP and now am doing Crystal reports...please bear with me if am silly.
in ABAP I have developed a report based on my select statement.
ex : **SELECT SINGLE * FROM cabn WHERE atnam EQ 'Z10_OPS_INC_REGION'.**
CLEAR ausp_objek.
CONCATENATE cciht_ihva-recn cciht_ihva-actn INTO ausp_objek.
CLEAR ausp.
now i have value in ausp_objek based on this i gone to other table to get the ausp-atwrt
SELECT DISTINCT atwrt FROM ausp
INTO CORRESPONDING FIELDS OF TABLE lt_ausp
WHERE objek EQ ausp_objek
AND atinn EQ cabn-atinn
so i have value in lt_ausp-atwrt which i wanted..
so in CRYSTAL How does this work???...i have linked the tables but it is not a direct value from single table...at this point how do we get the desired results...
hope am clear...
thank you,
pasala.Hi Pasala,
Nothing silly about it... We have a forum called SAP integration Kit which is both familiar with ABAP and CR so I moved your post to that forum.
Try searching on the home page for this forum on "ABAP" and you'll find lots of examples and suggestions and of course others will help too.
Don -
Crystal Report - More than one table from MySql
Hello, I am in need of help big time.
I have am using Visual Studio 2010 and Crystal Report 10.
The problem that I am incounting is that I am unable to retreive data from more than one table from a MySql database. I have been stuck on this for too long and need to hjump the hurdle.
I am using a MySql connection string, a dataset and a crystal report which is based on the dataset.
The main error that I am having is, the browser opens and a form appears saying "The report you requetsed requires further information" With the Server name: DataSetPropertiesDetials, while the User name and Password fields are then enabled.
I am guessing I am missing something in my code.
When I retreive data from one table the report is fine, but when I try to use more than one table it throws the error.
My Code is below and also attached:
Imports System.Data.SqlClient
Imports System.Configuration
Imports MySql.Data.MySqlClient
Imports CrystalDecisions.ReportSource
Imports CrystalDecisions.Web
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim con As MySqlConnection
Dim rpt As New CrystalReport3()
Dim myReport As New ReportDocument
Dim myData As New DataSet
Dim cmd As New MySqlCommand
Dim cmdUser, cmdProperty, cmdBranch As New MySqlCommand
Dim daBranch, daProperty, daUser As New MySqlDataAdapter
con = New MySqlConnection()
'Connection String
con.ConnectionString = "Server=****;Database=***;UID=***;Password=****"
Try
con.Open()
cmdBranch.CommandText = "SELECT branch FROM tblbranch"
cmdBranch.Connection = con
daBranch.SelectCommand = cmdBranch
daBranch.Fill(myData)
cmdProperty.CommandText = "SELECT ref, keys_held, key_no, keys_out, no_name, address_line1, address_line2,key_label FROM tblproperty"
cmdProperty.Connection = con
daProperty.SelectCommand = cmdProperty
daProperty.Fill(myData)
cmdUser.CommandText = "SELECT known_name FROM tbluser"
cmdUser.Connection = con
daUser.SelectCommand = cmdUser
daUser.Fill(myData)
myReport.Load("REPORT LOCATION")
myReport.SetDataSource(myData)
myReport.Database.Tables(0).SetDataSource(myData.Tables(0))
CrystalReportViewer1.ReportSource = myReport '
Catch myerror As MySqlException
MsgBox(myerror.Message)
End Try
End Sub
End ClassHi,
You have 3 SQL commands but you are calling SetDataSource only once. You need to look through for each of the SQL Commands.
Good luck,
Brian -
Can a master data will have loading from more than one data source
Dear gurus,
I have a master data object which has every day loading from one particular data source. Now I got a requirement to load data from another data source. If we load data from more than one data source , will there be any problem with data? Will it accept loading from more than one data source.?
Regards
RsHi Ram,
We can load the data to target morethan one datasource.Thats advantage in BI compare to BW. It will accept loading from more than one datasource.but you have to take care about characteristic and attributes are the same in both datasources like that.
Regards,
SVS -
Developing forms based on more than one table
I need to develop a form which requires to insert and query data elements from
more than one table in the database. Can create a view and develop a form based on the view to achieve this functionality? Also is it better to use portal forms for this purpose or Forms developer 6i for this purpose?
Any inputs/ideas will be greatly appreciated.
Thanks,
SuzanneYes you can do more than one table per form in portal.
You can base a form on two tables in portal if they are designed as master/detail tables. You can also provide linking to other forms passing parameters from a one form to the next to work with multiple tables. Combining more than two tables into a form using portal would require using a view, I believe.
HTH -
How do u save datas more than one table using net beans ide using JSF
Hi,
I am new to JSF.
I save / delete / update / New master table using POJO (Plain Old Java Objects), database - oracle and Toplink Persistence Unit.
How do u save data more than one table using net beans ide using JSF (I am using POJO) ?
and also Tell me the reference book for JSF.
Thanks in advance.
regards,
N.P.SivaSivaNellai wrote:
I am new to JSF.
So, I am using net beans IDE 6.1 from sun microsystem. It is a free software.No, you don't drag'n'drop if you're new to JSF. Switch to source code mode. Write code manually, with the help of IDE for the speed up.
So, please guide me the reference books, articles. I need the basic understanding of JSF, net beans IDE.[JSF: The Complete Reference|http://www.amazon.com/JavaServer-Faces-Complete-Reference/dp/0072262400] is a good book. The [JSF specification document|http://jcp.org/aboutJava/communityprocess/final/jsr252/index.html] is also a good reading to understand what JSF is and how it works. There are also javadocs and tlddocs of Sun JSF Mojarra. -
How to create Criterian For more than one table
Hi,
I have one problem how to create criteria for more than one table in that using one criteria hot to get the values from database in that more than onetable for getting these values .Please send me the exampke code.
reagrds,
raghuHi,
I don't think its possible to create fieldcatalog for different tables,
but if you want to do so create a dummy table which has all the fields which you want in fieldcatalog.
populate the data from different table to that dummy table
then create fieldcatalog for that table and pass it in the function module...
Regards,
Siddarth -
How to delete the double records connected to one or more than one tables in SQL 2008?
Hi
Can anyone please help me with the SQL query. I Im having a table called People with columns names: personno., lastname, firstname and so on. The personno. is having duplicate records,so all the duplicate records i have written with "double" in
the beginning of the numbers. I tried deleting these double records but they are linked to one or more than one tables. I have to find out, all the tables blocking the deleting of double person. And then create select statements which creates update statements
in order to replace the current id of double person with substitute id. (The personno. is in the form of id's in the database)
ThanksYou should not append "double" in the personno. When we append it will not be able to join or relate to other table. Keep the id as it is and use another field(STATUS) to mark as duplicate. Also we will require another field(PRIMARYID) against
those duplicate rows i.e the main or the primary personno.
SELECT * FROM OtherTable a INNER JOIN
(SELECT personno, status, primaryid FROM PEOPLE WHERE status = 'Duplicate') b
ON a.personno = b.personno
UPDATE OtherTable SET personno = b.primaryid
FROM OtherTable a INNER JOIN
(SELECT personno, status, primaryid FROM PEOPLE WHERE status = 'Duplicate') b
ON a.personno = b.personno
NOTE: Please take backup before applying the query. This is not tested.
Regards, RSingh
Maybe you are looking for
-
Run-time engine problem in Labview 2009 and Labview 2010
I have a problem with Labview 2009 and Labview 2010. I updated my Labview 2009 into 2010. But it turned out to be a trial one, because i did not have the serial number. So I uninstalled the Labview 2010. however, the funny stuff came over. I cannot u
-
Using overset text in Indesign CS6
I'm a designer who usually works in Illustrator. However, I just created my first catalog in Indesign CS6 and all my overplaced text on photos and text layered over text effects are all coming up as errors. Can you please let me know if I need to pu
-
I have problems saving pdf files in the web when I use Safari. I don't have this problem with firefox.
-
Tab through the Close File dialogue window buttons?
In the past when closing a document or file (any app) I could Tab through the different 'Don't Save', 'Cancel' & 'Save' buttons on the close file dialogue window. And also hit the spacebar to select the highlighted button. But not any more. It could
-
CRVS2010 Beta - Question about FieldMapping
I'm testing CRVS2010 by porting an app built on CR9 RDC. With CR9 RDC I used the FieldMapping property and the OnFieldMapping event. In CRVS2010 I've noticed there is a FieldMapping event, but the FieldMapping property is missing. I added an event ha