Multi-table Join

I want to join a table with the result of another table join. Is there a syntax to make the first join execute first? Or perhaps I'm going at this all wrong. Any insight would be appreciated. Thanks

I want to join a table with the result of another table join. Hi,
Your "other join" is just like a table, so you can do things like this:
SQL> with t1 as (select 1 x, 'v1' v1 from dual)
  2     , t2 as (select 1 y, 'v2' v2 from dual)
  3     , t3 as (select 1 z, 'v3' v3 from dual)
  4  select *
  5    from t1, (select *
  6                from t2, t3
  7               where t3.z = t2.y) joined
  8   where t1.x = joined.y;
         X V1          Y V2          Z V3
         1 v1          1 v2          1 v3
[pre]
Regards
Peter                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Help with multi-table join

    Hello -
    HELP!!!!! I need to join the following tables so I can compare the totals of colVal1+colVal2+colVal3  in tblIMP with ColTOTAL_NVal in AnotherDB.dbo.BL
    Below are the important columns along with relationships from the tables.  Is this even possible?
    tblIMP
    PK IMP integer
    TNum
    colVal1
    colVal2
    colVal3
    colVal4
    tblSC
    PK IntCNum numeric(7,)
    FK ISN numeric(8,0)
    TNum
    tblSD
    PK IntSLNum  numeric(7,0)
    FK ISN
    tblSH
    PK ISN numeric(8,0)
    Sh_ID nvarchar(25)
    AnotherDB.dbo.BL
    PK BL_ID integer
    Sh_ID nvarchar(100)
    ColTOTAL_NVal
    TNum in tblIMP has duplicates (not for the row, but for TNum itself)
    TNum in tblSC has duplicates also (not for the row, but for TNum itself)
    tblSH has a one-to-many relationship with tblSC;
    tblSH has a one-to-many relationship with tblSD;
    tblSD has a one-to-many relationship with tblSC
    tblSC is a recursive table – think container with many TNum in it
    ANY HELP AT ALL WILL BE APPRECIATED!!!
    Juniormint

    Thanks for your response, Latheesh.
    I would have posted the DDL, sample data and desired output, but I'm on a contract job and am unable to divulge that information.  Is there anything that is not understandable with what I have posted?  If so, please let me know.
    Juniormint
    You need to atleast explain us with some INDICATIVE data how your tables hold information and how you want the output to appear. Otherwise its hard for us by just looking at some table structure alone as we cant see your system neither knows your rules.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • OJ syntax for multi-table left outer join with MS Oracle Driver

    I have a multi-table left outer join that works fine in SQL Server ODBC Driver, Oracle ODBC driver 8.01.07.00, but not with Microsoft ODBC Driver for Oracle 2.573.7326.0
    SELECT * from { oj A LEFT OUTER JOIN B ON A.col1 = B.col1 LEFT OUTER JOIN C ON A.col1 = C.col1 }
    I noticed someone had a similar problem (the proposed solution doesn't work):
    http://www.justpbinfo.com/listarchive/msg02874.html
    Does anyone know how to get this working with the Microsoft ODBC Driver for Oracle? Or does it just not work?

    The Microsoft ODBC Driver for Oracle 2.573.7326.0 does perform the same 'fix up' with {oj} in Oracle 8i. The problem is that it doesn't work when joining more than two tables:
    This works:
    SELECT * from { oj A LEFT OUTER JOIN B ON A.col1 = B.col1}
    This doesn't work:
    SELECT * from { oj A LEFT OUTER JOIN B ON A.col1 = B.col1 LEFT OUTER JOIN C ON B.col1 = C.col1 }
    (The second query will work with the Oracle Oracle ODBC driver, with a bit of tweaking. But I haven't found a way to get it to work with the Microsoft ODBC Driver for Oracle 2.573.7326.0. My suspicion is that it just doesn't work.)
    Gavin

  • VLD-1119: Unable to generate Multi-table Insert statement for some or all t

    Hi All -
    I have a map in OWB 10.2.0.4 which is ending with following error: -
    VLD-1119: Unable to generate Multi-table Insert statement for some or all targets.*
    Multi-table insert statement cannot be generated for some or all of the targets due to upstream graphs of those targets are not identical on "active operators" such as "join".*
    The map is created with following logic in mind. Let me know if you need more info. Any directions are highly appreciated and many thanks for your inputs in advance: -
    I have two source tables say T1 and T2. There are full outer joined in a joiner and output of this joined is passed to an expression to evaluate values of columns based on
    business logic i.e. If T1 is available than take T1.C1 else take T2.C1 so on.
    A flag is also evaluated in the expression because these intermediate results needs to be joined to third source table say T3 with different condition.
    Based on value taken a flag is being set in the expression which is used in a splitter to get results in three intermediate tables based on flag value evaluated earlier.
    These three intermediate tables are all truncate insert and these are unioned to fill a final target table.
    Visually it is something like this: -
    T1 -- T3 -- JOINER1
    | -->Join1 (FULL OUTER) --> Expression -->SPLITTER -- JOINER2 UNION --> Target Table
    | JOINER3
    T2 --
    Please suggest.

    I verified that their is a limitation with the splitter operator which will not let you generate a multi split having more than 999 columns in all.
    I had to use two separate splitters to achieve what I was trying to do.
    So the situation is now: -
    Siource -> Split -> Split 1 -> Insert into table -> Union1---------Final tableA
    Siource -> Split -> Split 2 -> Insert into table -> Union1

  • View links in multi table relations

    Is it advisable (in terms of performance e. g.), to create view links and view objects as local variables in multi table relations?
    examle: the jdev online help says to use
    such multi table relations like this:
    // A (one) -> B (many) -> C (many)
    ViewLink a2b = appMod.findViewLink("AtoB");
    ViewLink b2c = appMod.findViewLink("BtoC");
    ViewObject aV = a2b.getSource();
    ViewObject bV = a2b.getDestination();
    ViewObject cV = b2c.getDestination();
    while(aV.hasNext())
    Row aR = aV.next();
    while(bV.hasNext())
    Row bR = cV.next();
    while(cV.hasNext())
    Row cR = cV.next();
    I would rather keep everything concerning
    a, b, c together, especially when more
    tables (d, e, ...) are added, like this
    ViewLink a2b = appMod.findViewLink("AtoB");
    ViewObject aV = a2b.getSource();
    while(aV.hasNext())
    Row aR = aV.next();
    ViewLink b2c = appMod.findViewLink("BtoC");
    ViewObject bV = a2b.getDestination();
    while(bV.hasNext())
    Row bR = cV.next();
    ViewObject cV = b2c.getDestination();
    while(cV.hasNext())
    Row cR = cV.next();
    Is there anything to say against this approach (in term of performance for example). I am not sure to remeber,
    if this was the approach used in the HotelResevationSystem example.
    Thanks.
    Rx
    null

    For this to work you have to either build a view based on the entities from which you need attributes (joined by the FK) or build a ViewObject with the sql statement giving you all the attributes you need.
    The first case enables you the edit the attributes, the second gives you read only access to the attributes.
    What you try to do isn't a master-detail connection, you are doing a join of some tables.
    Timo

  • Any general tips on getting better performance out of multi table insert?

    I have been struggling with coding a multi table insert which is the first time I ever use one and my Oracle skills are pretty poor in general so now that the query is built and works fine I am sad to see its quite slow.
    I have checked numerous articles on optimizing but the things I try dont seem to get me much better performance.
    First let me describe my scenario to see if you agree that my performance is slow...
    its an insert all command, which ends up inserting into 5 separate tables, conditionally (at least 4 inserts, sometimes 5 but the fifth is the smallest table). Some stats on these tables as follows:
    Source table: 5.3M rows, ~150 columns wide. Parallel degree 4. everything else default.
    Target table 1: 0 rows, 27 columns wide. Parallel 4. everything else default.
    Target table 2: 0 rows, 63 columns wide. Parallel 4. default.
    Target table 3: 0 rows, 33 columns wide. Parallel 4. default.
    Target table 4: 0 rows, 9 columns wide. Parallel 4. default.
    Target table 5: 0 rows, 13 columns wide. Parallel 4. default.
    The parallelism is just about the only customization I myself have done. Why 4? I dont know it's pretty arbitrary to be honest.
    Indexes?
    Table 1 has 3 index + PK.
    Table 2 has 0 index + FK + PK.
    Table 3 has 4 index + FK + PK
    Table 4 has 3 index + FK + PK
    Table 5 has 4 index + FK + PK
    None of the indexes are anything crazy, maybe 3 or 4 of all of them are on multiple columns, 2-3 max. The rest are on single columns.
    The query itself looks something like this:
    insert /*+ append */ all
    when 1=1 then
    into table1 (...) values (...)
    into table2 (...) values (...)
    when a=b then
    into table3 (...) values (...)
    when a=c then
    into table3 (...) values (...)
    when p=q then
    into table4(...) values (...)
    when x=y then
    into table5(...) values (...)
    select .... from source_table
    Hints I tried are with append, without append, and parallel (though adding parallel seemed to make the query behave in serial, according to my session browser).
    Now for the performance:
    It does about 8,000 rows per minute on table1. So that means it should also have that much in table2, table3 and table4, and then a subset of that in table5.
    Does that seem normal or am I expecting too much?
    I find articles talking about millions of rows per minute... Obviously i dont think I can achieve that much... but maybe 30k or so on each table is a reasonable goal?
    If it seems my performance is slow, what else do you think I should try? Is there any information I may try to get to see if maybe its a poorly configured database for this?
    P.S. Is it possible I can run this so that it commits every x rows or something? I had the heartbreaking event of a network issue giving me this sudden "ora-25402: transaction must roll back" after it was running for 3.5 hours. So I lost all the progress it made... have to start over. plus i wonder if the sheer amount of data being queued for commit/rollback is causing some of the problem?
    Edited by: trant on Jun 27, 2011 9:29 PM

    Looks like there are about 54 sessions on my database, 7 of the sessions belong to me (2 taken by TOAD and 4 by my parallel slave sessions and 1 by the master of those 4)
    In v$session_event there are 546 rows, if i filter it to the SIDs of my current session and order my micro_wait_time desc:
    510     events in waitclass Other     30670     9161     329759     10.75     196     3297590639     1736664284     1893977003     0     Other
    512     events in waitclass Other     32428     10920     329728     10.17     196     3297276553     1736664284     1893977003     0     Other
    243     events in waitclass Other     21513     5     329594     15.32     196     3295935977     1736664284     1893977003     0     Other
    223     events in waitclass Other     21570     52     329590     15.28     196     3295898897     1736664284     1893977003     0     Other
    241     row cache lock     1273669     0     42137     0.03     267     421374408     1714089451     3875070507     4     Concurrency
    241     events in waitclass Other     614793     0     34266     0.06     12     342660764     1736664284     1893977003     0     Other
    241     db file sequential read     13323     0     3948     0.3     13     39475015     2652584166     1740759767     8     User I/O
    241     SQL*Net message from client     7     0     1608     229.65     1566     16075283     1421975091     2723168908     6     Idle
    241     log file switch completion     83     0     459     5.54     73     4594763     3834950329     3290255840     2     Configuration
    241     gc current grant 2-way     5023     0     159     0.03     0     1591377     2685450749     3871361733     11     Cluster
    241     os thread startup     4     0     55     13.82     26     552895     86156091     3875070507     4     Concurrency
    241     enq: HW - contention     574     0     38     0.07     0     378395     1645217925     3290255840     2     Configuration
    512     PX Deq: Execution Msg     3     0     28     9.45     28     283374     98582416     2723168908     6     Idle
    243     PX Deq: Execution Msg     3     0     27     9.1     27     272983     98582416     2723168908     6     Idle
    223     PX Deq: Execution Msg     3     0     25     8.26     24     247673     98582416     2723168908     6     Idle
    510     PX Deq: Execution Msg     3     0     24     7.86     23     235777     98582416     2723168908     6     Idle
    243     PX Deq Credit: need buffer     1     0     17     17.2     17     171964     2267953574     2723168908     6     Idle
    223     PX Deq Credit: need buffer     1     0     16     15.92     16     159230     2267953574     2723168908     6     Idle
    512     PX Deq Credit: need buffer     1     0     16     15.84     16     158420     2267953574     2723168908     6     Idle
    510     direct path read     360     0     15     0.04     4     153411     3926164927     1740759767     8     User I/O
    243     direct path read     352     0     13     0.04     6     134188     3926164927     1740759767     8     User I/O
    223     direct path read     359     0     13     0.04     5     129859     3926164927     1740759767     8     User I/O
    241     PX Deq: Execute Reply     6     0     13     2.12     10     127246     2599037852     2723168908     6     Idle
    510     PX Deq Credit: need buffer     1     0     12     12.28     12     122777     2267953574     2723168908     6     Idle
    512     direct path read     351     0     12     0.03     5     121579     3926164927     1740759767     8     User I/O
    241     PX Deq: Parse Reply     7     0     9     1.28     6     89348     4255662421     2723168908     6     Idle
    241     SQL*Net break/reset to client     2     0     6     2.91     6     58253     1963888671     4217450380     1     Application
    241     log file sync     1     0     5     5.14     5     51417     1328744198     3386400367     5     Commit
    510     cursor: pin S wait on X     3     2     2     0.83     1     24922     1729366244     3875070507     4     Concurrency
    512     cursor: pin S wait on X     2     2     2     1.07     1     21407     1729366244     3875070507     4     Concurrency
    243     cursor: pin S wait on X     2     2     2     1.06     1     21251     1729366244     3875070507     4     Concurrency
    241     library cache lock     29     0     1     0.05     0     13228     916468430     3875070507     4     Concurrency
    241     PX Deq: Join ACK     4     0     0     0.07     0     2789     4205438796     2723168908     6     Idle
    241     SQL*Net more data from client     6     0     0     0.04     0     2474     3530226808     2000153315     7     Network
    241     gc current block 2-way     5     0     0     0.04     0     2090     111015833     3871361733     11     Cluster
    241     enq: KO - fast object checkpoint     4     0     0     0.04     0     1735     4205197519     4217450380     1     Application
    241     gc current grant busy     4     0     0     0.03     0     1337     2277737081     3871361733     11     Cluster
    241     gc cr block 2-way     1     0     0     0.06     0     586     737661873     3871361733     11     Cluster
    223     db file sequential read     1     0     0     0.05     0     461     2652584166     1740759767     8     User I/O
    223     gc current block 2-way     1     0     0     0.05     0     452     111015833     3871361733     11     Cluster
    241     latch: row cache objects     2     0     0     0.02     0     434     1117386924     3875070507     4     Concurrency
    241     enq: TM - contention     1     0     0     0.04     0     379     668627480     4217450380     1     Application
    512     PX Deq: Msg Fragment     4     0     0     0.01     0     269     77145095     2723168908     6     Idle
    241     latch: library cache     3     0     0     0.01     0     243     589947255     3875070507     4     Concurrency
    510     PX Deq: Msg Fragment     3     0     0     0.01     0     215     77145095     2723168908     6     Idle
    223     PX Deq: Msg Fragment     4     0     0     0     0     145     77145095     2723168908     6     Idle
    241     buffer busy waits     1     0     0     0.01     0     142     2161531084     3875070507     4     Concurrency
    243     PX Deq: Msg Fragment     2     0     0     0     0     84     77145095     2723168908     6     Idle
    241     latch: cache buffers chains     4     0     0     0     0     73     2779959231     3875070507     4     Concurrency
    241     SQL*Net message to client     7     0     0     0     0     51     2067390145     2000153315     7     Network
    (yikes, is there a way to wrap that in equivalent of other forums' tag?)
    v$session_wait;
    223     835     PX Deq Credit: send blkd     sleeptime/senderid     268697599     000000001003FFFF     passes     1     0000000000000001     qref     0     00     1893977003     0     Other     0     10     WAITING
    241     22819     row cache lock     cache id     13     000000000000000D     mode     0     00     request     5     0000000000000005     3875070507     4     Concurrency     -1     0     WAITED SHORT TIME
    243     747     PX Deq Credit: send blkd     sleeptime/senderid     268697599     000000001003FFFF     passes     1     0000000000000001     qref     0     00     1893977003     0     Other     0     7     WAITING
    510     10729     PX Deq Credit: send blkd     sleeptime/senderid     268697599     000000001003FFFF     passes     1     0000000000000001     qref     0     00     1893977003     0     Other     0     2     WAITING
    512     12718     PX Deq Credit: send blkd     sleeptime/senderid     268697599     000000001003FFFF     passes     1     0000000000000001     qref     0     00     1893977003     0     Other     0     4     WAITING
    v$sess_io:
    223     0     5779     5741     0     0
    241     38773810     2544298     15107     27274891     0
    243     0     5702     5688     0     0
    510     0     5729     5724     0     0
    512     0     5682     5678     0     0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Multi table insert

    Hello boys,
    I would like to do an insert into 3 tables:
    insert into t1
    if found insert into t2
    if not found insert into t3.
    So 2 out of 3 tables will end up with data.
    I would like to do it in 1 multi table insert.
    I can't use selects from the destination tables cause they are in the terabytes. I tried a number of combinations of primary keys error logging tables ("log errors reject limit unlimited") but without any success.
    Any ideas?

    Hello Exor,
    You said,
    insert into t1
    if found insert into t2
    if not found insert into t3.
    What is found condition? What are you checking and have you looked into insert all clause if that what you needed. Remember you can have complex join in your select and insert into 3 or 4 table based your "found" condition. This might be fastest way to move data into 3 tables instead of using cursor or bulk collect.
      INSERT ALL
       WHEN order_total < 1000000 THEN
          INTO small_orders
       WHEN order_total > 1000000 AND order_total < 2000000 THEN
          INTO medium_orders
       WHEN order_total > 2000000 THEN
          INTO large_orders
       SELECT order_id, order_total, sales_rep_id, customer_id
          FROM orders;Regards

  • DataStoreException for multi-table inheritence using numeric indicator value

    I am using multi-table inheritance with Kodo 2.5.5
    Relevant kodo.properties are:
    com.solarmetric.kodo.PersistentTypes=com.letsys.erespond.business.model.netw
    ork.PowerTransformer,com.letsys.erespond.business.model.network.Device,com.l
    etsys.erespond.business.model.network.ElectricalDevice,com.letsys.erespond.b
    usiness.model.network.Switch
    javax.jdo.PersistenceManagerFactoryClass=com.solarmetric.kodo.impl.jdbc.JDBC
    PersistenceManagerFactory
    com.solarmetric.kodo.impl.jdbc.DefaultSubclassProviderClass=com.solarmetric.
    kodo.impl.jdbc.ormapping.IntegerSubclassProvider
    I have given each of my PC classes s a numeric subclass indicator value (to
    improve join performance)
    e.g.
    <extension vendor-name="kodo" key="subclass-indicator-value" value="1">
    </extension>
    Here is my query code, the exception is at the end of the email:
    Extent e = pm.getExtent(Device.class, true);
    Query q = pm.newQuery(e, "active == p1");
    q.declareParameters("int p1");
    Collection c = (Collection)q.execute(new Integer(1));
    Iterator iter = c.iterator();
    while (iter.hasNext()) {
    Device d = (Device)iter.next();
    System.out.println("name="+d.getName());
    NOTE: The above code works if I first do a similar query, but specify the
    subclass in the pm.getExtent()
    It seems to me that the persistent classes listed in kodo.properties are not
    getting loaded.
    I also get this from debug on startup
    421 DEBUG [TestRunner-Thread] kodo.Runtime -
    [email protected]067:
    registering 1 classes: [class
    com.letsys.erespond.business.model.network.Device]
    421 DEBUG [TestRunner-Thread] kodo.MetaData - found JDO resource
    Device.jdo for com.letsys.erespond.business.model.network.Device at
    file:/C:/Dev/projectm/classes/com/letsys/erespond/business/model/network/Device.jdo
    421 INFO [TestRunner-Thread] kodo.MetaData -
    com.solarmetric.kodo.meta.JDOMetaDataParser@d12eea: parsing source:
    file:/C:/Dev/projectm/classes/com/letsys/erespond/business/model/network/Device.jdo
    I would have expected it to register all my PC classes at this stage.
    Any ideas ???
    Regards,
    Chris.
    [junit] Testcase: testInheritenceQuery took 9.747 sec
    [junit] Caused an ERROR
    [junit] com.solarmetric.kodo.runtime.DataStoreException: Type "null",
    the type registered for subclass indicatorvalue "3", is re
    ferenced in the database, but does not exist.
    [junit] NestedThrowables:
    [junit] com.solarmetric.kodo.runtime.DataStoreException: Type "3" is
    referenced in the database, but does not exist.
    [junit] com.solarmetric.kodo.runtime.FatalDataStoreException:
    com.solarmetric.kodo.runtime.DataStoreException: Type "null", the
    type registered for subclass indicatorvalue "3", is referenced in the
    database, but does not exist.
    [junit] NestedThrowables:
    [junit] com.solarmetric.kodo.runtime.DataStoreException: Type "3" is
    referenced in the database, but does not exist.
    [junit] NestedThrowables:
    [junit] com.solarmetric.kodo.runtime.DataStoreException: Type "null",
    the type registered for subclass indicatorvalue "3", is re
    ferenced in the database, but does not exist.
    [junit] NestedThrowables:
    [junit] com.solarmetric.kodo.runtime.DataStoreException: Type "3" is
    referenced in the database, but does not exist.
    [junit] at
    com.solarmetric.kodo.impl.jdbc.runtime.LazyResultList.instantiateRow(LazyRes
    ultList.java:217)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.runtime.LazyResultList.get(LazyResultList.jav
    a:142)
    [junit] at java.util.AbstractList$Itr.next(AbstractList.java:416)
    [junit] at
    com.solarmetric.kodo.runtime.objectprovider.ResultListIterator.next(ResultLi
    stIterator.java:49)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.runtime.ResultListFactory.createResultList(Re
    sultListFactory.java:82)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCSto
    reManager.java:1138)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.query.JDBCQuery.executeQuery(JDBCQuery.java:1
    26)
    [junit] at
    com.solarmetric.kodo.query.QueryImpl$DatastoreQueryExecutor.executeQuery(Que
    ryImpl.java:1565)
    [junit] at
    com.solarmetric.kodo.query.QueryImpl.executeQueryWithMap(QueryImpl.java:685)
    [junit] at
    com.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:545)
    [junit] at
    com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:531)
    [junit] at
    com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:501)
    [junit] at
    com.letsys.erespond.business.model.network.DeviceAppTest.testInheritenceQuer
    y(DeviceAppTest.java:32)
    [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
    [junit] at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    [junit] at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    ..java:25)
    [junit] NestedThrowablesStackTrace:
    [junit] com.solarmetric.kodo.runtime.DataStoreException: Type "null",
    the type registered for subclass indicatorvalue "3", is re
    ferenced in the database, but does not exist.
    [junit] NestedThrowables:
    [junit] com.solarmetric.kodo.runtime.DataStoreException: Type "3" is
    referenced in the database, but does not exist.
    [junit] at
    com.solarmetric.kodo.impl.jdbc.ormapping.IntegerSubclassProvider.getType(Int
    egerSubclassProvider.java:214)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.ormapping.SubclassProviderImpl.getType(Subcla
    ssProviderImpl.java:97)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping.loadPrimaryMappings(Cl
    assMapping.java:1060)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.initialize(JDBCStore
    Manager.java:374)
    [junit] at
    com.solarmetric.kodo.runtime.StateManagerImpl.loadInitialState(StateManagerI
    mpl.java:215)
    [junit] at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.getObjectByIdFilter(Pers
    istenceManagerImpl.java:1278)
    [junit] at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.getObjectById(Persistenc
    eManagerImpl.java:1196)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.createFromResultSet(
    JDBCStoreManager.java:967)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager$2.getResultObject(JD
    BCStoreManager.java:1146)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.runtime.LazyResultList.instantiateRow(LazyRes
    ultList.java:199)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.runtime.LazyResultList.get(LazyResultList.jav
    a:142)
    [junit] at java.util.AbstractList$Itr.next(AbstractList.java:416)
    [junit] at
    com.solarmetric.kodo.runtime.objectprovider.ResultListIterator.next(ResultLi
    stIterator.java:49)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.runtime.ResultListFactory.createResultList(Re
    sultListFactory.java:82)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCSto
    reManager.java:1138)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.query.JDBCQuery.executeQuery(JDBCQuery.java:1
    26)
    [junit] at
    com.solarmetric.kodo.query.QueryImpl$DatastoreQueryExecutor.executeQuery(Que
    ryImpl.java:1565)
    [junit] at
    com.solarmetric.kodo.query.QueryImpl.executeQueryWithMap(QueryImpl.java:685)
    [junit] at
    com.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:545)
    [junit] at
    com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:531)
    [junit] at
    com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:501)
    [junit] at
    com.letsys.erespond.business.model.network.DeviceAppTest.testInheritenceQuer
    y(DeviceAppTest.java:32)
    [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
    [junit] at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    [junit] at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    ..java:25)
    [junit] NestedThrowablesStackTrace:
    [junit] com.solarmetric.kodo.runtime.DataStoreException: Type "3" is
    referenced in the database, but does not exist.
    [junit] at
    com.solarmetric.kodo.impl.jdbc.ormapping.IntegerSubclassProvider.getType(Int
    egerSubclassProvider.java:207)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.ormapping.SubclassProviderImpl.getType(Subcla
    ssProviderImpl.java:97)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping.loadPrimaryMappings(Cl
    assMapping.java:1060)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.initialize(JDBCStore
    Manager.java:374)
    [junit] at
    com.solarmetric.kodo.runtime.StateManagerImpl.loadInitialState(StateManagerI
    mpl.java:215)
    [junit] at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.getObjectByIdFilter(Pers
    istenceManagerImpl.java:1278)
    [junit] at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.getObjectById(Persistenc
    eManagerImpl.java:1196)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.createFromResultSet(
    JDBCStoreManager.java:967)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager$2.getResultObject(JD
    BCStoreManager.java:1146)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.runtime.LazyResultList.instantiateRow(LazyRes
    ultList.java:199)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.runtime.LazyResultList.get(LazyResultList.jav
    a:142)
    [junit] at java.util.AbstractList$Itr.next(AbstractList.java:416)
    [junit] at
    com.solarmetric.kodo.runtime.objectprovider.ResultListIterator.next(ResultLi
    stIterator.java:49)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.runtime.ResultListFactory.createResultList(Re
    sultListFactory.java:82)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCSto
    reManager.java:1138)
    [junit] at
    com.solarmetric.kodo.impl.jdbc.query.JDBCQuery.executeQuery(JDBCQuery.java:1
    26)
    [junit] at
    com.solarmetric.kodo.query.QueryImpl$DatastoreQueryExecutor.executeQuery(Que
    ryImpl.java:1565)
    [junit] at
    com.solarmetric.kodo.query.QueryImpl.executeQueryWithMap(QueryImpl.java:685)
    [junit] at
    com.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:545)
    [junit] at
    com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:531)
    [junit] at
    com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:501)
    [junit] at
    com.letsys.erespond.business.model.network.DeviceAppTest.testInheritenceQuer
    y(DeviceAppTest.java:32)
    [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
    [junit] at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    [junit] at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    ..java:25)
    [junit] Testcase: testInheritenceQuery
    [junit] TEST com.letsys.erespond.business.model.network.DeviceAppTest
    FAILED

    Marc,
    All of my PC classes are in the result of the api call you suggested:
    [junit] Kodo type[0] =
    com.letsys.erespond.business.model.network.PowerTransformer
    [junit] Kodo type[1] = com.letsys.erespond.business.model.network.Device
    [junit] Kodo type[2] =
    com.letsys.erespond.business.model.network.ElectricalDevice
    [junit] Kodo type[3] = com.letsys.erespond.business.model.network.Switch
    However, when doing the query, it only seems to read the parent jdo file
    [junit] (kodo.MetaData 89 )
    com.solarmetric.kodo.meta.JDOMetaDataParser@16477d9: parsing source:
    file:C:/Dev/projectm/classes/com/letsys/erespond/business/model/network/Device.jdo
    When I do a Class.forName() on each of the classes, I see that it loads in
    all the .jdo files.
    Chris.
    "Marc Prud'hommeaux" <[email protected]> wrote in message
    news:[email protected]..
    Chris-
    Strange. It does seem like your PersistentTypes property is not being
    used at all.
    Can you try casting your pmf to a JDBCPersistenceManagerFactory and
    seeing if your types have actually been registered with:
    String[] types = pmf.getConfiguration ().getPersistentTypeNames ();
    In article <bop53p$a5u$[email protected]>, Chris McCarthy wrote:
    Hi Patrick,
    Just tried it and yes, doing a Class.forName() on the classes I insert
    does provide a work-around.
    Any idea what is causing this ?
    Regards,
    Chris.
    "Patrick Linskey" <[email protected]> wrote in message
    news:boc31n$7do$[email protected]..
    Chris,
    What happens if you do a Class.forName() (or just a class reference) to
    each of your persistent classes before executing any JDO code?
    -Patrick
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • SQL+-MULTI TABLE QUERY PROBLEM

    HAI ALL,
    ANY SUGGESTION PLEASE?
    SUB: SQL+-MULTI TABLE QUERY PROBLEM
    SQL+ QUERY GIVEN:
    SELECT PATIENT_NUM, PATIENT_NAME, HMTLY_TEST_NAME, HMTLY_RBC_VALUE,
    HMTLY_RBC_NORMAL_VALUE, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE,
    DLC_POLYMORPHS_NORMAL_VALUE FROM PATIENTS_MASTER1, HAEMATOLOGY1,
    DIFFERENTIAL_LEUCOCYTE_COUNT1
    WHERE PATIENT_NUM = HMTLY_PATIENT_NUM AND PATIENT_NUM = DLC_PATIENT_NUM AND PATIENT_NUM
    = &PATIENT_NUM;
    RESULT GOT:
    &PATIENT_NUM =1
    no rows selected
    &PATIENT_NUM=2
    no rows selected
    &PATIENT_NUM=3
    PATIENT_NUM 3
    PATIENT_NAME KKKK
    HMTLY_TEST_NAME HAEMATOLOGY
    HMTLY_RBC_VALUE 4
    HMTLY_RBC_NORMAL 4.6-6.0
    DLC_TEST_NAME DIFFERENTIAL LEUCOCYTE COUNT
    DLC_POLYMORPHS_VALUE     60
    DLC_POLYMORPHS_NORMAL_VALUE     40-65
    ACTUAL WILL BE:
    &PATIENT_NUM=1
    PATIENT_NUM 1
    PATIENT_NAME BBBB
    HMTLY_TEST_NAME HAEMATOLOGY
    HMTLY_RBC_VALUE 5
    HMTLY_RBC_NORMAL 4.6-6.0
    &PATIENT_NUM=2
    PATIENT_NUM 2
    PATIENT_NAME GGGG
    DLC_TEST_NAME DIFFERENTIAL LEUCOCYTE COUNT
    DLC_POLYMORPHS_VALUE     42
    DLC_POLYMORPHS_NORMAL_VALUE     40-65
    &PATIENT_NUM=3
    PATIENT_NUM 3
    PATIENT_NAME KKKK
    HMTLY_TEST_NAME HAEMATOLOGY
    HMTLY_RBC_VALUE 4
    HMTLY_RBC_NORMAL 4.6-6.0
    DLC_TEST_NAME DIFFERENTIAL LEUCOCYTE COUNT
    DLC_POLYMORPHS_VALUE     60
    DLC_POLYMORPHS_NORMAL_VALUE     40-65
    4 TABLES FOR CLINICAL LAB FOR INPUT DATA AND GET REPORT ONLY FOR TESTS MADE FOR PARTICULAR
    PATIENT.
    TABLE1:PATIENTS_MASTER1
    COLUMNS:PATIENT_NUM, PATIENT_NAME,
    VALUES:
    PATIENT_NUM
    1
    2
    3
    4
    PATIENT_NAME
    BBBB
    GGGG
    KKKK
    PPPP
    TABLE2:TESTS_MASTER1
    COLUMNS:TEST_NUM, TEST_NAME
    VALUES:
    TEST_NUM
    1
    2
    TEST_NAME
    HAEMATOLOGY
    DIFFERENTIAL LEUCOCYTE COUNT
    TABLE3:HAEMATOLOGY1
    COLUMNS:
    HMTLY_NUM,HMTLY_PATIENT_NUM,HMTLY_TEST_NAME,HMTLY_RBC_VALUE,HMTLY_RBC_NORMAL_VALUE     
    VALUES:
    HMTLY_NUM
    1
    2
    HMTLY_PATIENT_NUM
    1
    3
    MTLY_TEST_NAME
    HAEMATOLOGY
    HAEMATOLOGY
    HMTLY_RBC_VALUE
    5
    4
    HMTLY_RBC_NORMAL_VALUE
    4.6-6.0
    4.6-6.0
    TABLE4:DIFFERENTIAL_LEUCOCYTE_COUNT1
    COLUMNS:DLC_NUM,DLC_PATIENT_NUM,DLC_TEST_NAME,DLC_POLYMORPHS_VALUE,DLC_POLYMORPHS_
    NORMAL_VALUE,
    VALUES:
    DLC_NUM
    1
    2
    DLC_PATIENT_NUM
    2
    3
    DLC_TEST_NAME
    DIFFERENTIAL LEUCOCYTE COUNT
    DIFFERENTIAL LEUCOCYTE COUNT
    DLC_POLYMORPHS_VALUE
    42
    60
    DLC_POLYMORPHS_NORMAL_VALUE
    40-65
    40-65
    THANKS
    RCS
    E-MAIL:[email protected]
    --------

    I think you want an OUTER JOIN
    SELECT PATIENT_NUM, PATIENT_NAME, HMTLY_TEST_NAME, HMTLY_RBC_VALUE,
    HMTLY_RBC_NORMAL_VALUE, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE,
    DLC_POLYMORPHS_NORMAL_VALUE
    FROM PATIENTS_MASTER1, HAEMATOLOGY1,  DIFFERENTIAL_LEUCOCYTE_COUNT1
    WHERE PATIENT_NUM = HMTLY_PATIENT_NUM (+)
    AND PATIENT_NUM = DLC_PATIENT_NUM (+)
    AND PATIENT_NUM = &PATIENT_NUM;Edited by: shoblock on Nov 5, 2008 12:17 PM
    outer join marks became stupid emoticons or something. attempting to fix

  • Multi table inheritance and performance

    I really like the idea of multi-table inheritance, since a have a main
    class and three subclasses which just add one integer to the main class.
    It would be a waste to spend 4 tables on this, so I decided to put them
    all into one.
    My problem now is, that when I query for a specific class, kodo will build
    SQL like:
    select ... from table where
    JDOCLASSX='de.mycompany.myprojectname.mysubpack.classname'
    this is pretty slow, when the table grows because string comparisons are
    awefull - and even worse: the database has to compare nearly the whole
    string because it differs only in the last letters.
    indexing would help a bit but wouldn't outperforming integer comparisons.
    Is it possible to get kodo to do one more step of normalization ?
    Having an extra table containing all classnames und id's for them (and
    references in the original table) would improve performance of
    multi-tables quite a lot !
    Even with standard classes it would save a lot memory not having the full
    classname in each row.

    Stefan-
    Thanks for the feedback. Note that 3.0 does make this simpler: we have
    extensions that allow you to define the mechanism for subclass
    identification purely in the metadata file(s). See:
    http://solarmetric.com/Software/Documentation/3.0.0RC1/docs/manual.html#ref_guide_mapping_classind
    The idea for having a separate table mapping numbers to class names is
    good, but we prefer to have as few Kodo-managed tables as possible. It
    is just as easy to do this in the metadata file.
    In article <[email protected]>, Stefan wrote:
    First of all: thx for the fast help, this one (IntegerProvider) helped and
    solves my problem.
    kodo is really amazing with all it's places where customization can be
    done !
    Anyway as a wish for future releases: exactly this technique - using
    integer as class-identifiers rather than the full class names is what I
    meant with "normalization".
    The only thing missing, is a table containing information of how classIDs
    are mapped to classnames (which is now contained as an explicit statement
    in the jdo-File). This table is not mapped to the primary key of the main
    table (as you suggested), but to the classID-Integer wich acts as a
    foreign key.
    A query for a specific class would be solved with a query like:
    select * from classValues, classMapping where
    classValues.JDOCLASSX=classmapping.IDX and
    classmapping.CLASSNAMEX='de.company.whatever'
    This table should be managed by kodo of course !
    Imagine a table with 300.000 rows containing only 3 different derived
    classes.
    You would have an extra table with 4 rows (base class + 3 derived types).
    Searching for the classID is done in that 4row table, while searching the
    actual class instances than would be done over an indexed integer-classID
    field.
    This is much faster than having the database doing 300.000 String
    comparisons (even when indexed).
    (By the way - it would save a lot memory as well, even on classes which
    are not derived)
    If this technique is done by kodo transparently, maybe turned on with an
    extra option ... that would be great, since you wouldn't need to take care
    for different "subclass-indicator-values", can go on as everytime and have
    a far better performance ...
    Stephen Kim wrote:
    You could push off fields to seperate tables (as long as the pk column
    is the same), however, I doubt that would add much performance benefit
    in this case, since we'd simply add a join (e.g. select data.name,
    info.jdoclassx, info.jdoidx where data.jdoidx = info.jdoidx where
    info.jdoclassx = 'foo'). One could turn off default fetch group for
    fields stored in data, but now you're adding a second select to load one
    "row" of data.
    However, we DO provide an integer subclass provider which can speed
    these sorts of queries a lot if you need to constrain your queries by
    class, esp. with indexing, at the expense of simple legibility:
    http://solarmetric.com/Software/Documentation/2.5.3/docs/ref_guide_meta_class.html#meta-class-subclass-provider
    Stefan wrote:
    I really like the idea of multi-table inheritance, since a have a main
    class and three subclasses which just add one integer to the main class.
    It would be a waste to spend 4 tables on this, so I decided to put them
    all into one.
    My problem now is, that when I query for a specific class, kodo will build
    SQL like:
    select ... from table where
    JDOCLASSX='de.mycompany.myprojectname.mysubpack.classname'
    this is pretty slow, when the table grows because string comparisons are
    awefull - and even worse: the database has to compare nearly the whole
    string because it differs only in the last letters.
    indexing would help a bit but wouldn't outperforming integer comparisons.
    Is it possible to get kodo to do one more step of normalization ?
    Having an extra table containing all classnames und id's for them (and
    references in the original table) would improve performance of
    multi-tables quite a lot !
    Even with standard classes it would save a lot memory not having the full
    classname in each row.
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • Order Query in SQ01 using Table Joins in CRM

    Hello Experts,
    I am trying to create a query using table joins in SQ01 in CRM because I need a report that will give me all transactions for a selected Business Partner.  I am unable to display any results when running my query.  I have found other threads which give a list of possible tables to join together, but the fields used in the joins were not described. 
    The tables I have joined in my query are as follows:
    CRMD_ORDERADM_H
    CRMD_ORDER_INDEX
    CRMD_PARTNER
    BUT_000
    I have used SE16 to try to search for additional tables to use for linking the Business Partner with a transaction, but I have been unsuccessful.
    Would anyone please give advice as how to proceed? 
    Reward points are available!
    Thank you in advance,
    David

    David
    The link with be the GUID.
    CRMD_ORDERADM_H = Document Header Table
    CRMD_ORDERADM_I = Document Line item Table
    CRMD_LINK = Lists various ‘link’ GUIDs, to
    access order Information
    The Table CRMD_ORDERADM_H will contain you transactions , once you find the GUID of your sales transaction in the table CRMD_ORDERADM_H.
    You then need to check the table CRMD_LINK.
    In this table you will then find a number in 11 = sales. This refers to the table CRMD_SALES. There are also links to many other tables ie Shipping, pricing, org etc.
    CRMM_BUT_SET0140 - for Sales Group, Sales Office, District
    CRMM_BUT_LNK0141 - for Sales Area data
    Transaction CRMD_BUS2000115 allows you to see all sales transactions for a BP. CRMD_BUS2000126 shows you activities for selected BP.
    Regards
    M

  • Multi-table INSERT with PARALLEL hint on 2 node RAC

    Multi-table INSERT statement with parallelism set to 5, works fine and spawns multiple parallel
    servers to execute. Its just that it sticks on to only one instance of a 2 node RAC. The code I
    used is what is given below.
    create table t1 ( x int );
    create table t2 ( x int );
    insert /*+ APPEND parallel(t1,5) parallel (t2,5) */
    when (dummy='X') then into t1(x) values (y)
    when (dummy='Y') then into t2(x) values (y)
    select dummy, 1 y from dual;
    I can see multiple sessions using the below query, but on only one instance only. This happens not
    only for the above statement but also for a statement where real time table(as in table with more
    than 20 million records) are used.
    select p.server_name,ps.sid,ps.qcsid,ps.inst_id,ps.qcinst_id,degree,req_degree,
    sql.sql_text
    from Gv$px_process p, Gv$sql sql, Gv$session s , gv$px_session ps
    WHERE p.sid = s.sid
    and p.serial# = s.serial#
    and p.sid = ps.sid
    and p.serial# = ps.serial#
    and s.sql_address = sql.address
    and s.sql_hash_value = sql.hash_value
    and qcsid=945
    Won't parallel servers be spawned across instances for multi-table insert with parallelism on RAC?
    Thanks,
    Mahesh

    Please take a look at these 2 articles below
    http://christianbilien.wordpress.com/2007/09/12/strategies-for-rac-inter-instance-parallelized-queries-part-12/
    http://christianbilien.wordpress.com/2007/09/14/strategies-for-parallelized-queries-across-rac-instances-part-22/
    thanks
    http://swervedba.wordpress.com

  • Context index can't be used in complicated multiple tables join?

    hello
    thank you for view this page.
    i have a comlicated sql :
    SELECT count(*)
    from
    ((app_AssetBasicInfo left join app_AssetBasicInfoExt on
    app_AssetBasicInfo.id=app_AssetBasicInfoExt.id) left join
    (app_AssetCustominfo1 left join app_AssetCustominfoExt1 on
    app_AssetCustominfo1.id=app_AssetCustominfoExt1.id) on
    app_AssetBasicInfo.id=app_AssetCustominfo1.id) WHERE
    app_AssetBasicInfo.CategoryID=1 AND Del_tag=0 and contains(description,'department')>0;
    the table app_AssetBasicInfo and app_AssetBasicInfoExt have multiple columns and large recoord size. i create a context index on app_assetbasicinfoext(description) which description is 4000 varchar2.
    but the sql doesn't use context index. i suspect that the complicated multiple table join can't use context index? does it correct?
    thanks very much!

    Could you please post an explain plan? I'm not quite sure what is the issue.

  • Problems with ReportDocument and multi-table dataset...

    Hi,
    First post here and hoping someone can help with me with this problem.
    I have an ASP.NET app running using CR 2008 Basic to produce invoices - these are fairly complex and use multiple tables - data used is provided in lists and they work fine when displayed/printed/exported from the viewer.
    My client now wants the ability to batch print these so I'm trying to develop a page which will use create a ReportDocument object and then print/export as required.
    As soon as I started down this path I received the 'invalid logon params problem' - so to simplify things and to get past this I've developed a simple 1 page report with which takes data from a dataset I've populated and passed to it.
    Here's the problem:
    1) If I put one table in the dataset and add a field from that table to the report it works OK.
    2) If I use a second table and field (without the first) it works OK.
    3) as soon as I have both tables and the report has field from each I get the 'Invalid logon parameters' error.
    The tables are fine (since I can use each individually), the report is find (only has 1 or 2 fields and works with individual tables) ... it's only when I have both tables that I get problems...
    ... this is driving me up the wall and if CR can't handle this there's no way it's going to handle the more complex invoices with subreports.
    Can anyone suggest what I'm doing wrong ... or tell me whether I'm just pushing CR beyond it's capabilities?
    The code I'm using to generate the ReportDocument is:
    List<Invoice> rinv = Invoice.SelectOneContract(inv.Invoice_ID);
    List<InvoiceLine> rline = InvoiceLine.SelectInvoice(inv.Invoice_ID);
            DataSet ds = new DataSet();
            ds.Tables.Add(InvoiceLineTable(rline));
            ds.Tables.Add(InvoiceTable(rinv));
            rdoc.FileName = Server.MapPath("~/Invoicing/test.rpt");
            rdoc.SetDataSource(ds.Tables);
            rdoc.ExportToDisk(ExportFormatType.PortableDocFormat, "c:
    test
    test.pdf");
    ... so not rocket science and the error is always caused at the 'ExportToDisk' line.
    Thanks in advance!

    I've got nowhere trying to create a reportdocument and pass it a multi-table dataset, so decided to do it the 'dirty' way by adding all the controls to an aspx page and referring to them.
    I know I can do this because the whole issue is printing a report that is currently viewed.
    So ... I've now added the ObjectDataSources to the page as well as the CrystalReportSource and the CrystalViewer ...
    .. I've tested the page and the report appears within the viewer with all the correct data ...
    ...so with a certain amount of excitement I've added the following line to the code behind file:
    rptSrcContract.ReportDocument.PrintToPrinter(1, true, 1, 1);
    ... then I run the page and predictably the first thing that comes up is:
    Unable to connect: incorrect log on parameters.
    .. this is madness!
    1) The data is retrieved and is in the correct format otherwise the report would not display.
    2) the rptSrcContract.ReportDocument exists ... otherwise it would not display in the viewer.
    So why does this want to logon to a database when the data is retrieved successfully and the security is running with a 'Network Services' account anyway????? (actually I know it has nothing to do with logging onto the database this is just the generic Crystal Reports 'I have a problem' message)
    ... sorry if this is a bit of an angry rant .. didn't get much sleep last night because of this ... all I want to be able to do is print a report from code .... surely this should be possible??

  • How to create an explain plan with rowsource statistics for a complex query that include multiple table joins ?

    1. How to create an explain plan with rowsource statistics for a complex query that include multiple table joins ?
    When multiple tables are involved , and the actual number of rows returned is more than what the explain plan tells. How can I find out what change is needed  in the stat plan  ?
    2. Does rowsource statistics gives some kind of  understanding of Extended stats ?

    You can get Row Source Statistics only *after* the SQL has been executed.  An Explain Plan midway cannot give you row source statistics.
    To get row source statistics either set STATISTICS_LEVEL='ALL'  in the session that executes theSQL OR use the Hint "gather_plan_statistics"  in the SQL being executed.
    Then use dbms_xplan.display_cursor
    Hemant K Chitale

Maybe you are looking for