Tables from 2 different database schemas in 1 module

I'd like to have only one module to store my source transactional tables.
In my transactional system, I've got, differente database schemas.
For example:
I've got a schema, schema1 with a table called table1 and schema2 with table2.
I've got a public synonym and granted the privileges to select table2 so, from schema1, I can see table2.
I'd like to have only one MODULE to store my SOURCE transactional tables.
But, when I create the module, I have to link it with a specific location, and a location is linked with a specific schema. When the list of objects to load is shown, I see the objects of the schema but no the others pointed with synonyms.
Example: If I have a location linked to schema1 I only see table1, but don't see table2.
IS THERE A WAY TO LOAD table1 and table2 IN THE SAME MODULE?
thanks in advance!

You cannot access objects in another schema via public synonyms.
If your location is linked to schema 1, then in schema 1 create a private synonym to schema2.table2, grant read on table2 to schema1 from schema2, and then you will be able to see table2 to import it into OWB if you have the option to included objects referenced by synonyms checked.
Cheers,
Mike

Similar Messages

  • How do you join two tables from different Oracle schemas using a subquery

    I am trying to join two tables from different Oracle schemas using a subquery. I can extract data from each of the tables without a problem. However, when I combine the select statements using a subquery I get the Oracle error *'ORA-00936: missing expression'*. Since each SELECT statement executes on its own without error I don't understand what is missing. The result set I am trying to get is to match up the LINE_ID from PDTABLE_12_1 in schema DD_12809 with the MAT_DESCRIPTION from table PDTABLE_201 in schema RA_12809.
    The query is as follows:
    sql = "SELECT [DD_12809].[PDTABLE_12_1].LINE_ID FROM [DD_12809].[PDTABLE_12_1] JOIN " _
    + "(SELECT [RA_12809].[PDTABLE_201].MAT_DESCRIPTION " _
    + "FROM [RA_12809].[PDTABLE_201]) AS FAB " _
    + "ON [DD_12809].[PDTABLE_12_1].PIPING_MATER_CLASS = FAB.PIPING_MATER_CLASS"
    The format of the query is copied from a SQL programming manual.
    I also tried executing the query using a straight JOIN on the two tables but got the same results. Any insight would be helpful. Thanks!
    Edited by: user11338343 on Oct 19, 2009 6:55 AM

    I believe you are receiving the error because you are trying to JOIN on a column that doesn't exist. For example you are trying to join on FAB.PIPING_MATER_CLASS but that column does not exist in the subquery.
    If you want to do a straight join without a subquery you could do the following
    SELECT  DD_12809.PDTABLE_12_1.LINE_ID
    ,       FAB.MAT_DESCRIPTION
    FROM    DD_12809.PDTABLE_12_1
    JOIN    RA_12809.PDTABLE_201    AS FAB ON DD_12809.PDTABLE_12_1.PIPING_MATER_CLASS = FAB.PIPING_MATER_CLASS  HTH!

  • Import Data Table from Different DB Schema in BI Administration

    Here is my scenario:
    Tables are imported from different DB schema in Administration. They are then joined together.
    When I select fields from more than one schema in BI Answer, incorrect result is returned.
    Below is the SQL it returns:
    -------------------- Sending query to database named DW_TESTING (id: <<15875>>):
    select D1.c4 as c1,
    D1.c5 as c2,
    D1.c2 as c3,
    D1.c1 as c4,
    D1.c3 as c5
    from
    *(select D1.c1 as c1,*
    D1.c2 as c2,
    D1.c3 as c3,
    D1.c4 as c4,
    D1.c5 as c5
    from
    *(select sum(T34.PRODUCT_SALES) as c1,*
    T52.DESCRIPTION as c2,
    T52.BE_TYPE as c3,
    T137.YEAR as c4,
    T137.QUARTER as c5,
    ROW_NUMBER() OVER (PARTITION BY T52.BE_TYPE, T137.QUARTER ORDER BY T52.BE_TYPE ASC, T137.QUARTER ASC) as c6
    from
    BEADMIN.BE_MASTER T52,
    DWADMIN.DATE_MASTER T137,
    BEADMIN.BE_DAILY_SALES T34
    where  ( T34.BE_TYPE = T52.BE_TYPE and T34.SALES_DATE = T137.CALENDAR_DATE )
    group by T52.BE_TYPE, T52.DESCRIPTION, T137.YEAR, T137.QUARTER
    *) D1*
    where  ( D1.c6 = 1 )
    *) D1*
    order by c2
    +++Administrator:7e0000:7e001f:----2009/06/08 17:22:09
    -------------------- Sending query to database named DW_TESTING (id: <<15938>>):
    select D2.c2 as c1,
    D2.c3 as c2,
    D2.c1 as c3
    from
    *(select D1.c1 as c1,*
    D1.c2 as c2,
    D1.c3 as c3
    from
    *(select sum(T109.PRODUCT_SALES) as c1,*
    T137.YEAR as c2,
    T137.QUARTER as c3,
    ROW_NUMBER() OVER (PARTITION BY T137.QUARTER ORDER BY T137.QUARTER ASC) as c4
    from
    DWADMIN.DATE_MASTER T137,
    DWADMIN.DAILY_SALES T109
    where  ( T109.SALES_DATE = T137.CALENDAR_DATE )
    group by T137.YEAR, T137.QUARTER
    *) D1*
    where  ( D1.c4 = 1 )
    *) D2*
    order by c2
    It seems that query has been seperated into two, and doesn't have relationship between each others.
    However, I also tested the same situation in other environment, and it returns correct result. I found that the query hasn't been seperated into two, but one. The query is as below:
    -------------------- Sending query to database named BI (id: <<2392>>):
    WITH
    SAWITH0 AS (select D1.c1 as c1,
    D1.c2 as c2,
    D1.c3 as c3,
    D1.c4 as c4
    from
    *(select sum(T29.PRODUCT_SALES) as c1,*
    T96.DESCRIPTION as c2,
    T120.YEAR as c3,
    T120.QUARTER as c4,
    ROW_NUMBER() OVER (PARTITION BY T96.DESCRIPTION, T120.QUARTER ORDER BY T96.DESCRIPTION ASC, T120.QUARTER ASC) as c5
    from
    SIMULATION.BE_MASTER T96,
    SIMULATION.DATE_MASTER T120,
    BIEE.BE_DAILY_SALES T29
    where  ( T29.BE_TYPE = T96.BE_TYPE and T29.SALES_DATE = T120.CALENDAR_DATE )
    group by T96.DESCRIPTION, T120.YEAR, T120.QUARTER
    *) D1*
    where  ( D1.c5 = 1 ) ),
    SAWITH1 AS (select D1.c1 as c1,
    D1.c2 as c2,
    D1.c3 as c3
    from
    *(select sum(T102.PRODUCT_SALES) as c1,*
    T120.YEAR as c2,
    T120.QUARTER as c3,
    ROW_NUMBER() OVER (PARTITION BY T120.QUARTER ORDER BY T120.QUARTER ASC) as c4
    from
    SIMULATION.DATE_MASTER T120,
    SIMULATION.DAILY_SALES T102
    where  ( T102.SALES_DATE = T120.CALENDAR_DATE )
    group by T120.YEAR, T120.QUARTER
    *) D1*
    where  ( D1.c4 = 1 ) )
    select distinct case  when SAWITH0.c3 is not null then SAWITH0.c3 when SAWITH1.c2 is not null then SAWITH1.c2 end  as c1,
    case  when SAWITH0.c4 is not null then SAWITH0.c4 when SAWITH1.c3 is not null then SAWITH1.c3 end  as c2,
    SAWITH0.c2 as c3,
    SAWITH1.c1 as c4,
    SAWITH0.c1 as c5
    from
    SAWITH0 full outer join SAWITH1 On nvl(SAWITH0.c4 , 8) = nvl(SAWITH1.c3 , 8) and nvl(SAWITH0.c4 , 9) = nvl(SAWITH1.c3 , 9)
    order by c1, c2, c3
    This query returns correct result and seems reasonable.
    Assume that the setup in BI Administration is the same for both environment, why the first situation returns query that are separated?

    I have made the same remark but not with two different environment and same design.
    What can influence the construction of two queries ?
    Here some ideas :
    - if you have of course two connections pools (I assume not)
    - if in our database features (double click on the icon and choose the tab feature), full outer join is not supported
    But I have this two requirement on my laptop and I can see that I have also two sql fired.
    What you can do is to make a comparison of your two repository.
    In the administration tool, File/Compare.
    The result will be very interesting.

  • Select query based on joining of tables from different database is taking too long

    Hi Team,
    Select query on table with millions of records is taking very long time. It took 50mins, the below query is joining on multiple table from two databases DB1.dbo.Table1 contains 100 million records and also Table3 and Table4 (of different database) might
    contain close to 1million records.
    Select T1.*
    From DB1.dbo.Table1 T1
    Join DB1.dbo.Table2 T2 on RTRIM(T1.Col3) = RTRIM(T2.Col3)
    Join Table4 CA on RTRIM(T1.Col1) + T2.Col2 = CA.Col1
    Join Table3 U on CA.Col2 = U.Col2 AND RTRIM(T2.Col2) = U.Col3
    Where U.Col4 NOT IN ('A1', 'A2', 'A3', 'A4', 'A5', 'A6','A7','A8','A9')
    And (T1.flg IS NULL OR T1.flg = 'N')
    And LTRIM(RTRIM(T2.Col2)) NOT IN ('B1','B2')
    How can i improve the performance of this query. Actual thing is update the data in Db1.dbo.table1 based on the conditions but if the select is taking close to 1hr then update will take hours together. Indexes already implemented on all the tables.
    Thanks,
    Eshwar.
    Please don't forget to Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful. It will helpful to other users.

    Thanks.
    Join Table4 CA on RTRIM(T1.Col1) + T2.Col2 = CA.Col1
    This join is not working with spaces if Rtrim is not used.
    Thanks! Eshwar.
    Please don't forget to Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful. It will helpful to other users.

  • How to join tables from different databases (DBLink/DB connection )

    Hello,
    i have an issue and i hope you could help me to solve it. My problem is: I want to create native sql select which joins two tables from different DB (both of them are ORACLE, one of them internal, another one - external). I have found several notes and posts, but without any success. Db connection exists in dbcon table, so this part of my problem has been solved.
    I would like something like that:
    select * from table1@xxx inner join table2.
    i can not split this select into two separate ones, because both tables store over 30 mln. entries and i do not want to create any copies of them.
    Br,
    dez

    Hi,
    you might need to create a DB-Link on DB level and use EXEC SQL.
    Lots of stuff on google about this, like
    Oracle DBLink ( external database )
    Volker

  • Dealing with tables from different databases?

    Hi. I'm a newbie to Visual Studio 2012 and stuck on how to interact with different datasets.
    I am building a report that is associated with with two tables, each from a different database. The
    master_flat table with the primary key matter_number is from the first database and it contains all the columns I need that should show up in the report layout I've built. However,
    billing_table with the primary key matter_number contains a flag that I go by which I must use to determine whether each matter should come through in the reporting or not. 
    I've set the master_flat as dataset1 and the billing_table as dataset2. Now, what is the best way in Visual studio 2012 to filter by the matters that has flag "N" in dataset2?
    Thanks

    We are way out of sync.  Lets synchronize.  I'm not sure which question you are refering to.  Is it the "C# or VBnet"  question or is it the "One or two database Question".  It seem like it would be the database question since you
    should know which programming language you are using.
    Open SQL Server Management Studio (SSMS).  After login, there is an explorer where you can browse the databases, tables, and fields in the tables.  You should be able to view how you build the database.  If you right click any tables and then
    "Script Table As : Select To : New Query Editor Window".  There is an execute button to run the query.  You can aslo edit the query.  I usually test all my qeuries in SSMS before actually using them in an application.  I would get a JOIN
    SQL working in SSMS.
    If you let me know if you are using VBnet or C# I will write a simple LINQ.  Even better if you supply me the names of the columns of the two tables.
    jdweng

  • Create tables in different database schemas using EJB 3 Entity Persistent

    Hi All,
    I would like to find out how to get the following tasks done using EJB 3.0 Java Entity Persistent:
    ( i ) Create tables in different schemas such as STUDENT under EDUCATION schema and table PATIENT in HOSPITAL schema. We can then reference them in SQL as EDUCATION.STUDENT and HOSPITAL.PATIENT.
    ( ii ) Reference these tables uniquely once they are created.
    There are no pre-existing tables or naming conventions that needs to be adhere to in this situation.
    I have no problem creating tables on the current schema in EJB 3.0 Java Entity Persistent.
    Any suggestions would be appreciated.
    Thanks,
    Jack

    Use the schema attribute of the Table annotation:
    package javax.persistence;
    @Target({TYPE}) @Retention(RUNTIME)
    public @interface Table
       String name( ) default "";
       String catalog( ) default "";
       String schema( ) default "";
       UniqueConstraint
    uniqueConstraints( ) default {};
    }

  • How to create a view consisting of data from tables in2 different databases

    Using Oracle 10.2g
    I have 2 databases Gus and haggis on Comqdhb schema.
    glink indicates a databse link between Haggis and Gus
    In Gus there are tables student,subject,grade,school containing columns like upn...
    STUDENT
    upn
    academicYear
    SUBJECT
    subject
    GRADE
    examlevel
    grade
    SCHOOL
    sn
    In HAGGIS there are tables student,grade,teacher containing columns upn...desc below.
    STUDENT
    upn
    GRADE
    grade
    upn
    academicyear
    level
    Create view in your HAGGIS database which will join all of the exam grades together. You should have one view which will produce the following relation :
    examGrade(upn, subject, examlevel, sn, grade,academicYear)
    so I need to create a view which gets the data from both the tables in both the databases.
    create view as examGrade(upn, subject, examlevel, sn, grade,academicYear) as select s.upn
    But i am not getting how to select a column from 2 tables in different databases
    I mean if i said
    select upn from comqdhb.student@glink,comqdhb.student;
    select upn from comqdhb.student@glink,comqdhb.student
    ERROR at line 1:
    ORA-00918: column ambiguously defined
    help me out,Thank you.

    Thank you for the reply will follow up the code format
    Create views in your HAGGIS schema database which will join all of the exam grades together. You should have one view which will produce the following relation :
    examGrade(upn, subject, examlevel, sn, grade,academicYear)
    I understand that there wont be duplication when we use conditions
    If i query
    select count(upn)
    from   comqdhb.student@glink I get 9000
    but after the union
    create view examGrade(upn, subject, examlevel, sn, grade,academicYear)
    as
    select distinct s.upn as upn
    ,                  g.subject as subject
    ,                  g."LEVEL" as examlevel
    ,                  g.grade as grades
    ,                  '9364097'
    ,                  to_number(g.academicyear) as academicyear
    from             comqdhb.student s
    ,                   comqdhb.grade g
    where           s.upn=g.upn
    union
    select            s.upn
    ,                   sb.subject
    ,                   g.elevel
    ,                   g.grade
    ,                   s.acyr
    ,                   sc.sn
    from              comqdhb.subject@glink sb
    ,                   comqdhb.student@glink s
    ,                    comqdhb.gradevalues@glink g
    ,                    comqdhb.school@glink sc,
    ,                    comqdhb.studentingroup@glink sg
    ,                    comqdhb.teachinggroup@glink tg
    where            sb.sid=tg.sid
    and                tg.gid=sg.gid
    and                sg.upn=s.upn
    and                g."LEVEL"=tg.elevel
    and                s.school=sc.id
    and                sc.id=tg.id; returns
    count(upn) from exam gradeIt gets stuck actually sometimes it returns
    932002 some results.
    2:
    Another problem i am having which i am trying to solve and written up my ideas but haven't been getting the expected results.Hope you can help.Thank you.
    Information:
    =======
    All children take exams at the age of 16 called a General Certificate of SecondaryEducation (GCSE).
    They have to study and take exams in Mathematics, English and Science, and can take other subjects such as History, French, Art etc. Most students will study between 5 and 10 different subjects before taking their GCSEs.
    For each exam, a student is awarded a grade from A*, A, B,C,D,E,F,G,U,X An A* grade is the best grade achievable and an X is the worst grade.
    In order to analyze how students have performed, each grade is mapped to a numeric value as follows:
    Grade Numerical score
    A* 8
    A 7
    B 6
    C 5
    D 4
    E 3
    F 2
    G 1
    U 0
    X 0
    Now why i need this avgGCSE is because i have to create a view containing avgGCSE of the students it is used in the next question where a condition is avgGCSE is between 6.5 and 7
    In order to calculate the avgGCSE the idea is to calculate the grades of the students and map the grades to their corresponding scores/values
    add them all up and div by the total no of grades to get the avg.
    desc comqdhb.STUDENT@glink;
    STUDENT
    =======
    UPN
    FNAME
    CNAME
    DOB
    GENDER
    PREVIOUSSCHOOL
    XGCSE
    SCHOOL
    ACYR
    STUDENTINGROUP
    =============
    UPN
    GID
    STARTDATE
    ENDDATE
    GRADE
    GRADEVALUES
    ===========
    GRADE
    LEVEL
    VALUE
    I have a opinion that xgcse in STUDENT table refers to the avgGCSE which i want to calculate as when i asked my professor as to what xgcse he said that he forgot to take it out of the table and it is not necessary while creating avggcse.
    select *
    from comqdhb.student@glink
    where xgcse<6.5; Displaying a result
    returns:
    UPN FAMILYNAME COMMONNAME DATEOFBIR GENDER PREVIOUSSCHOOL XGCSE SCHOOL ACYR
    ===========================================================================
    1011 KIMBERLY ABBOT 07-JUL-79 f none 3.93500948 2 2
    select *
    from comqdhb.student@glink
    where xgcse between 6.5 and 7 and upn = 1386; Displaying a result
    returns:
    UPN FAMILYNAME COMMONNAME DATEOFBIR GENDER PREVIOUSSCHOOL XGCSE SCHOOL ACYR
    ===========================================================================
    1386 STEPHANIE AANNESSON 15-JAN-79 f none 6.88873 2 2 so if xgcse is the avgGCSE then upn 1011 has avggcse<6.5 and 1386 has avggcse >6.5
    my idea was backward strategy like so now if we find out upn 1368 has suppose xgcse(avggcse)>6.5 how to extract the avggcse for the particular upn We need to map grades from GRADEVALUES to grade in STUDENTINGROUP and map upn from studentingroup to upn in student to output the values for the corresponding grades from GRADEVALUES
    select grade
    from comqdhb.studentingroup@glink
    where upn = 1011;
    Result:
    GRADE
    =====
    D
    F
    B
    E
    C
    E
    E
    B
    8 rows selected. Mapping each grade to the corresponding value and calculating we get
    32/8=4 total(values to corresponding grades)/no of grades.
    But the xgcse for upn 1011 is 3.935 and i am getting 4!! maybe xgcse isn't avggrade but ? is the procedure by me correct for calculating avggcse
    select grade
    from comqdhb.studentingroup@glink
    where upn = 1386;
    Result:
    GRADE
    ======
    A*
    A*
    A*
    A*
    B
    A*
    A*
    A
    B
    B
    B
    11 rows selected. grade to the corresponding value and calculating we get
    79/11=7.12 total(values to corresponding grades)/no of grades.
    But the xgcse for upn 1011 is 6.88... and i am getting 7.12!!
    But another problem
    when i say
    select   g.value,g.grade
    from     comqdhb.gradevalues@glink g
    ,        comqdhb.studentingroup@glink sg
    where    g.grade=sg.grade
    and      sg.upn=1011;
    result:
    ======
    VALUE GRADE
    ===========
      100 B
      100 B
       80 C
       60 D
       40 E
       40 E
       40 E
       20 F
        6 B
        6 B
        5 C
    VALUE GRADE
    =============
        4 D
        3 E
        3 E
        3 E
        2 F
    16 rows selected.
    select   distinct g.value,g.grade
    from     comqdhb.gradevalues@glink g
    ,        comqdhb.studentingroup@glink sg
    where    g.grade=sg.grade
    and      sg.upn=1011;
    result:
    ======
    VALUE GRADE
    ============
         2 F
       100 B
         6 B
         3 E
        60 D
         5 C
         4 D
        80 C
        40 E
        20 F
    10 rows selected. I am getting only 8 for the query
    select grade
    from comqdhb.studentingroup@glink
    where upn = 1386; here its becomming 10 and also its displaying values as 100 and ...
    select distinct *
    from   comqdhb.gradevalues@glink;
    GRADEVALUES
    ===========
    LEVEL      GRADE           VALUE
    ================================
    a          A                 120
    a          B                 100
    a          C                  80
    a          D                  60
    a          E                  40
    a          F                  20
    a          U                   0
    a          X                   0
    g          A                   7
    g          A*                  8
    g          B                   6
    LEVEL      GRADE           VALUE
    ================================
    g          C                   5
    g          D                   4
    g          E                   3
    g          F                   2
    g          G                   1
    g          U                   0
    g          X                   0
    18 rows selected. I was hoping if i could map the grades and get the values and calculate avggrade by total(values)/count(values)that would be it but here there are values like 100...
    select  sum(g.value)/count(g.grade) as avggrade
    from    comqdhb.gradevalues@glink g
    ,         comqdhb.studentingroup@glink sg
    where  g.grade=sg.grade
    and     sg.upn=1386;
    avggrade
    ========
    37.4375 the avggrade cant be this big and when i map each grade i obtained for 1368 like a to 7+b to 6 so on i get avggrade 7.12
    kindly help.
    Edited by: Trooper on Dec 15, 2008 4:49 AM

  • Accessing tables from different schema in CDS and AMDP

    Hi All,
    We are working on a HANA system which has several schema replicated from SAP R/3/Non SAP systems. We have BW 7.4 SP9 deployed on the same system and accessing the HANA views using latest BW virtual objects such as Open ODS , Composite providers etc.
    We are also using the BW system for few ABAP based data processing developments. We are currently accessing HANA views in ABAP programs by creating dictionary views based on external HANA views.
    We would like to however use recent possibilities of CDS and AMDP for better life cycle management of ABAP based solutions. The open SAP course on this subject was of very good help. Thanks a lot "open SAP team" for that. I would however have few open questions,
    As I understand AMDP gives us full flexibility of writing sql procedures within ABAP development environment, but can we access tables from different schema into AMDP code. If yes, then sample code would help.
    If the answer of first question is yes, then how do we manage transports between development and production systems where the schema names would be different. Currently in open HANA developments, such transport is manged using Schema mapping.
    Can I also use different schema tables in CDS views.
    We are updating few tables in ABAP dictionary after applying processing logic in ABAP program as detailed in step 1. With the new approach using AMDP, can we directly update database schema tables which will give us an optimization advantage.
    New ABAP HANA program interfaces are quite promising and we would like to use them to optimize many data intensive applications.
    Thanks & Regards,
    Anil

    Hi Anil,
    I can only answer 1. and 2. (and would be interested into 3. as well):
    1.
    Yes you can access tables from a different schema and also HANA views. In this case no 'using' is needed.
    Examples:
        RESULT = SELECT
        FROM
              "SAP_ECC"."T441V" AS t,
              "_SYS_BIC"."tmp.package/AFPO" AS a.
        WHERE ...
    2. In this case, if you need schema mapping: You could use HANA (projection) views which just forward to a different schema, also see example.
    Best regards,
    Christoph

  • Analytic View with tables from different schema

    Hi,
    I'm curious if I make something wrong or if this is not possible:
    I want to use two tables each in a different schema. I can drop them into the DataFoundation, can connect them, assign them some measure. But activation fails due to insufficient privileges. When I use the tables from the same schema activation works well. With the insufficient privileges I would guess HANA cannot create a View (failed with the statement CREATE COLUMN_VIEW "_SYS_BIC"."USER/ANALYTIC_VIEW_NAME"....).
    Since I tried the same assignment with the System-User and failed I wonder what kind of permissions are required. Or is this generally not allowed (resp. prohibited)?
    If not allowed, could somebody give me a hint, why its not possible?
    If it is possible, what kind of rights are required to get it working?
    roland

    Hm', I have allowed SYS_REPO the rights to the table and was able to activate the view. But now I have the problem, that the DataPreview is not working (again insufficient privileges). What user has to have additional permissions for the JDBC-query?
    Do I have to take care more on the privileges for other things?

  • No Easy Way to Join on Tables from Different Schemas

    Hi,
    The company policy does not allow to join on tables from different schemas or use db links...
    I'm tasked to come up with a Perl script that does exactly that - allows for the SELECT statement to do several joins on 3 different schemas. In addition 1 of the schemas is on the different host altogether.
    Upping the privileges for my user and allowing db links is not an option...Can someone, please help me to understand on a conceptual level how would I use Perl and what logic would it have and what would it (perl) do?
    Thank you,

    Court in the wrong job... ;)
    It's like a librarian who is a hard rock artist maintaining the silence in the premises. ;)
    My dear friend, i don't think this is the right place for your requirement. This is the PL/SQL forum. If you have any problem related PL/SQL or SQL you can place that here.
    Regards.
    Satyaki De.

  • Fetch data from different database tables

    Hi...
    How can i fetch data from different database tables and put it into a internal table and then display it??? Can provide simple short codes as i'm new to ABAP. Thanks.

    Hi,
    Check this sample code..
    TYPE-POOLS: slis.
    DATA: BEGIN OF itab OCCURS 0,
            vbeln TYPE vbeln,
            expand,
          END OF itab.
    DATA: BEGIN OF itab1 OCCURS 0,
            vbeln TYPE vbeln,
            posnr TYPE posnr,
            matnr TYPE matnr,
            netpr TYPE netpr,
          END OF itab1.
    DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.
    DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
    s_fieldcatalog-col_pos = '1'.
    s_fieldcatalog-fieldname = 'VBELN'.
    s_fieldcatalog-tabname   = 'ITAB'.
    s_fieldcatalog-rollname  = 'VBELN'.
    s_fieldcatalog-outputlen = '12'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '1'.
    s_fieldcatalog-fieldname = 'VBELN'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'VBELN'.
    s_fieldcatalog-outputlen = '12'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '2'.
    s_fieldcatalog-fieldname = 'POSNR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'POSNR'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '3'.
    s_fieldcatalog-fieldname = 'MATNR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'MATNR'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '4'.
    s_fieldcatalog-fieldname = 'NETPR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'NETPR'.
    s_fieldcatalog-do_sum    = 'X'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    DATA: s_layout TYPE slis_layout_alv.
    s_layout-subtotals_text            = 'SUBTOTAL TEXT'.
    s_layout-key_hotspot = 'X'.
    s_layout-expand_fieldname = 'EXPAND'.
    SELECT vbeln UP TO 100 ROWS
           FROM
           vbak
           INTO TABLE itab.
    IF NOT itab[] IS INITIAL.
      SELECT vbeln posnr matnr netpr
             FROM vbap
             INTO TABLE itab1
             FOR ALL ENTRIES IN itab
             WHERE vbeln = itab-vbeln.
    ENDIF.
    DATA: v_repid TYPE syrepid.
    v_repid = sy-repid.
    DATA: s_keyinfo TYPE slis_keyinfo_alv.
    s_keyinfo-header01 = 'VBELN'.
    s_keyinfo-item01   = 'VBELN'.
    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
         EXPORTING
              i_callback_program = v_repid
              is_layout          = s_layout
              it_fieldcat        = t_fieldcatalog
              i_tabname_header   = 'ITAB'
              i_tabname_item     = 'ITAB1'
              is_keyinfo         = s_keyinfo
         TABLES
              t_outtab_header    = itab
              t_outtab_item      = itab1
         EXCEPTIONS
              program_error      = 1
              OTHERS             = 2.
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Thanks
    Naren

  • How to copy a set of tables from a database to another periodically?

    We have a 4 node RAC primary database(10.2.0.2) with a physical standby(10.2.0.2) on our production site. Offlate we noticed that one of the applications(APP2) is causing heavy loads due large data downloads on the primary database servers. Our primary database has 2 schemas,
    1) one being the main schema with all objects, (USER1)
    2) and the other has views that query some set of tables from the main schema. (USER2)
    The application APP2 uses USER2 views to query and download huge data periodically. We need to be able to give accurate data results to APP2, but in the same time take off the load from the database, as APP2 is not our main application.
    We would like to know if there are any cost effective options in oracle to do this, and if so, what is the best option? Anyone has any experience setting up something like this before?
    We have thought of creating another 10.2.0.2 database on a different server and giving it regular updates(like data feeds) from the current database. The current database data changes quiet often, so the data feeds would have to be done often to keep the data current on the new database. So, we are not exactly sure how to go about it. Would a COPY command help?
    Please advice.

    user623066 wrote:
    Our 4 node RAC is already busy with our main application, which has its connections spread across all 4 nodes.
    Our main applications services are the same on all nodes and use all 4 nodes in the same way.
    There are some other utilities that we run from one of the app servers that connect to only 1 of the nodes.
    APP2 uses all 4 servers, which is again controlled by connection pooling and distributes the load.Wouldn't separate services be more beneficial here? If APP2 is locked down to one node during normal operation, that ensures that other connections aren't going to be competing for hardware with APP2 on 3 of the 4 nodes. If APP2 is generating less than 25% of the total load, you can let the other applications use whatever hardware resources are left idle on the node APP2 is locked down to.
    By Large data downloads, I meant both increase in network traffic and the CPU load on the database nodes.
    We are already using resouce manager to limit the resources allocated to USER2 that APP2 uses.
    And we have also limited the large downloads to take place in the early hours of the day when the traffic from our main application is less.
    But this has still not been optimal for the usage requirements for APP2. APP2 is also doing queries all through the day, but has a limit for the number of rows downloaded during peak hours.Can you explain a bit more about why using Resource Manager hasn't been sufficient? That's normally a pretty good way to prevent one hungry user from drastically affecting everyone else. Perhaps you just need to tweak the configuration here.
    Logical Standby seems a good option. But we need to keep our physical standby in place. Is it possible to have a logical standby and a physical standby? (ofcourse on separate servers)Sure. You can have as many standby servers of whatever type you'd like.
    Could we use a COPY command to copy data for the set of tables to a new database? Or is that also a complex option?You could, yes. COPY is a SQL*Plus command that has been depricated for copying data between Oracle databases for quite a while. It only works from SQL*Plus and would only be designed for one-time operations (i.e. there is no incremental COPY command). I can just about guarantee that's not what you want here.
    How do materialized views work? Wouldn't they still reside on the main database? Or is it possible to have remote materialized views?You probably don't want materialized views, but if you decide to go down that path
    - You'd create materialized view logs on the base tables to track changes
    - You'd create materialized views on the destination database that select data over a database link back to the source database
    - You'd put those materialized views into one or more refresh groups that are scheduled to refresh periodically
    - During a refresh, assuming incremental refreshes, the materialized view logs would be read and applied to the materialized views on the destination system to update the materialized views.
    Justin

  • Limitation on the number of tables in a Database Schema!

    Hi All,
    Is there a limitation on the number of tables present in a schema that can be fetched in Designer while creating a universe.
    Customer is using Oracle schema which contains 22000 tables and while trying to insert tables in Designer XIR2 (or trying to get the table browser) Designer hangs.
    In BO 6.5 there are no issues while retrieving the tables from the schema in Designer.
    Is there a way to retrieve only a certain amount of tables in Designer XIR2?
    Thanks for your help!

    Hi Ganesh,
    Following are the Answers regaring your queries:
    Query : 1
    There is no limitation on the number of components (objects, classes, tables, joins, hierarchies, lov's, etc) in a universe. But of course as the number of components increases, you could run into problems  related to performance.
    This depends on available RAM and the processing speed.
    Query 2:
    There is NO such option to select the number of table to be automatically inserted in to the universe because Suppose if you have 22000 tables in DB and you want only 1000 table ,you entered 1000 tables as the value to insert tables in Universe then How Designer will come to know which tables you want to take in Schema to build the Universe?
    It all depends on the DBA and Universe Designer which tables are important for organizations reporting needs.
    When you  create connection to the DB then Connection will fetch all table from the database and we canu2019t limit  DB data retrieval.
    I hope this Helps...
    Thanks...
    Pratik

  • Single query to get data from different databases

    i need to capture certain fields from certain tables in database 1 and certain fields from certain tables in database 2 into one file using a single SQL statement.
    i tried searching on the net
    i found that dblinks can help
    but iam not sure if ill be able to create dblinks in my situation which is:
    i need to get data from oracle to be copied to mysql
    this is not a replication acitivity, but i need certain fields from one database and certain from the other
    so what iwas thinking is, if i use an sql query to get all the fields (i need around 40) from the different oracle databases and create a singlefile with one insert per select, i can then read that file into mysql
    instead of creating multiple sql queries for each table and creating separate files and eventually separate tables in mysql.
    can anyone help me here?
    or maybe suggest another approach.
    thanks

    Hi,
    I think dblink is the only option available to get data from different databases. It will work for your case too.
    CREATE DATABASE LINK db_link CONNECT TO user_name IDENTIFIED BY  password USING 'instance_name'you must have the system privilege 'create database link' to create db links. This way you can get the required data and put it in a table in oracle. But i dont know how to put this data from oracle table to Mysql.
    HTH
    Muneer

Maybe you are looking for

  • I have home sharing on but can't see my library on the computers icon. iTunes does display my purchased tunes but not my own imports.

    I have home sharing on in iTunes but can't see my library when I use the computers icon on Apple TV. iTunes does display my purchased tunes but not my own imports. I can play my own tunes by selecting them on my iMAC and directing them to Apple TV. I

  • @loader_path problem for photoshop plugin on Mac

    Hi experts, One of my photoshop plugin (a file format plugin) depends on Qt, so I add the libQtCore.4.dylib and libQtGui.4.dylib in the same folder of my binary in my bundle ( that is '/Contents/MacOS' ), and reference them as @loader_path in my plug

  • Time to split this forum up a bit?

    i'm thinking that there is alot of traffic here. could we divide this up a bit... i'm thinking: maybe splitting it along the lines of iphone SDK questions and iphone app delivery questions. i'm also hopping they get the search back again soon.

  • Iphone does not appear in itunes when connected to XP computer

    I have the latest version of itunes and iphone software. When I connect my iphone 3GS through a USB to my computer (windows XP), the computer recognises the device as a hard drive in "my computer" and I can import photos. However Itunes when opened u

  • MDM Vendor ALE configuration

    Hi, i have a question related with ALE and MDM. I´m trying to conect R3-MDM with XI obviosuly. For vendors i have the outbound message CREMDM and i need clasiffication as well i guess CLFMAS. But for the inbound process i can not configure CREMDM for