Generate ER Diagram with Sql Queries ?

Hi Expertie,
I am new to Oracle Sql Developer Data Modeler.
I am having doubt in Oracle Sql Developer Data Modeler. Can we create ER Diagram with sql queries ?
Ex: select Ename, EAge, Eemail, ESalary, DDept, Dname, Estatus from Emp E join Dept D on E.EmpId = D.Empid
      Where EAge in (20, 25, 30, 35)
Please provide me the answer and suggestion. It will be greatful for me.
Thanks & Regards
Bhaskar

Yes, you can engineer your physical model to a logical one, then you'll have an ERD as well. It's a right-click on the model I believe.
To be more specific, if you relational model is loaded, you can use the button in the toolbar that looks like a double-blue-arrow, or you can mouse-right-click on your relational model in the tree. This will engineer your model to a logical one. You'll then have your ERD.
Edited by: Jeff Smith SQLDev PM on Apr 29, 2013 9:53 AM

Similar Messages

  • Links with sql queries to practice

    Hi all,
    Can someone give me the links with sql queries for practice to preparing for OCP
    Thanks
    Shekar.

    Hi,
    Can u repost?? as its very difficult to understand ur problem.
    Vasu Natari.

  • Generate ER Diagram from Sql Data Modeler

    Hi,
    I want to use the Oracle Sql Developer Data Modeler to generate ER diagram for my schema. There are huge number of tables in this schema, so I would like to identify only those tables which need to be selected for generating my ER diagram.
    Basically, I want only those table which are having relationship with other tables here. The reason being, if I select all tables in the schema then I would get those tables in the ER diagram which don't have any relationship with other tables.
    Can someone please suggest writing queries which yield this from data dictionary?
    Thanks.

    Well, your requirement is based on the the database schemas having been designed with proper primary key and foreign key constraints in place.  If they're not there then the database doesn't know about the relationships between tables, and such relationships are just theoretical (and as such usually controlled by the application that uses them).
    Of course there are also tables that are used by applications for lookups and other reasons, so they're part of the application and should be included on ER diagrams, even if they have no direct relationship to any one table (or they could have relationships to many tables).
    So, rather than try and write queries to figure out what tables are required, why not let the Data Modeller tool generate an ER diagram from the information that IS known about on the database, and then you can see if the relationships exist, or if they're missing and need manually putting on the diagram (or applying to the database).

  • Open Toad Data Modeler diagram with SQL Data Modeler

    hi, I've made a diagram with TOAD Data Modeler in Windows. Now I'm working with Linux, so I need a portable application to work with. Oracle SQL Data Modeler seems to be the solution to my problems, but I can't open/import my TOAD's diagrams into SQL Data Modeler.
    Anyone knows how to do it?
    Thanks in advance,
    Neuquino
    Edited by: Neuquino2 on Nov 1, 2010 1:30 PM

    Hi Neuquino,
    there is no import from TOAD Data Modeler. You can generate DDL script with TOAD DM and import that script.
    Philip

  • Looking for a SQL report guru to help me with SQL queries

    As an independent consultant, I sometimes need to build custom SSRS reports.  I need someone I can reach out to when SQL queries become complex.  There is such a query now.
    Thanks.
    Richgar
    612-207-8347

    Thanks, Visakh,
    I'm trying to determine which resources did not fill out a timesheet.  The result of this query is missing just a few names and I can't find the reason.  I'm thinking of a web meeting looking at real data is necessary and will be glad to pay
    for the help.
    SELECT       
    ResourceName, ResourceIsGeneric, ResourceType, RBS, ResourceIsActive
    FROM           
    MSP_EpmResource_UserView
    WHERE       
    (ResourceName NOT IN
    (SELECT DISTINCT MSP_EpmResource_UserView_1.ResourceName
    FROM           
    MSP_EpmResource_UserView AS MSP_EpmResource_UserView_1 INNER JOIN
    MSP_TimesheetLine_UserView ON MSP_EpmResource_UserView_1.ResourceUID = MSP_TimesheetLine_UserView.ResourceUID INNER JOIN
    MSP_Timesheet ON MSP_TimesheetLine_UserView.TimesheetUID = MSP_Timesheet.TimesheetUID
    WHERE        (MSP_EpmResource_UserView_1.ResourceType = 2) AND (MSP_EpmResource_UserView_1.ResourceIsActive = 1) AND (MSP_EpmResource_UserView_1.RBS IS NOT NULL) AND
    (CONVERT(varchar, MSP_TimesheetLine_UserView.PeriodStartDate, 101) IN (@Period_Start_Date)) AND (MSP_EpmResource_UserView_1.RBS IN (@RBS)))) AND (ResourceIsGeneric = 0) AND
    (ResourceType = 2) AND (RBS IN (@RBS)) AND (ResourceIsActive = 1)

  • Help with SQL queries following migration

    Hi there,
    I have just migrated from MS SQL Server database to Oracle 10g database using the Oracle SQL Developer.
    My application is using JDBC to access the database, and there are heaps of SQL statements that need to be verified and tested. I've found a number of SQL compatibility issues from my testing of the Oracle database and I hope you can help me the following.
    1. Case sensitivity
    Is it possible to not enforce case sensitivity (by default) when performing a select query?
    If this is not possible, all the SQL statements will need to be changed to evaluate column based on uppercase.
    2. Trailing white space
    Is it possible to not evaluate trailing white space (by default) when performing a select query?
    For example, suppose a table column studentNo has trailing spaces (after database migration), e.g. 'A182D '
    when performing query - select * from student where studentNo = 'A182D'
    no results can be found
    3. Issue with Where condition containing with '' = ''
    There are quite a number of SQL statements with Where condition containing '' = ''.
    For example, the following SQL query doesn't return any results even though there are matching suburb that starts with 'ST'. These types of queries are mostly used in dynamic generated queries.
    select * from Address where (suburb like 'ST%') and ('' = '' or country = '')
    Any help or advice will be greatly appreciated.
    Regards,
    Jason Gordon

    As justin mentioned setting those NLS parameters will make oracle not to use your regular index. for that you must create a function based index. See example below.
    SQL> create index t_idx on t (name)
      2  /
    Index created.
    SQL> exec dbms_stats.gather_table_stats(user,'T',cascade=>true)
    PL/SQL procedure successfully completed.
    SQL> explain plan for
      2  select * from t where name = 'karthick'
      3  /
    Explained.
    SQL> select * from table(dbms_xplan.display)
      2  /
    PLAN_TABLE_OUTPUT
    Plan hash value: 2946670127
    | Id  | Operation        | Name  | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT |       |     1 |     9 |     1   (0)| 00:00:01 |
    |*  1 |  INDEX RANGE SCAN| T_IDX |     1 |     9 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
       1 - access("NAME"='karthick')
    13 rows selected.
    SQL> delete from plan_table
      2  /
    2 rows deleted.
    SQL> alter session set NLS_COMP=ANSI;
    Session altered.
    SQL> alter session set NLS_SORT=BINARY_CI;
    Session altered.
    SQL> explain plan for
      2  select * from t where name = 'karthick'
      3  /
    Explained.
    SQL> select * from table(dbms_xplan.display)
      2  /
    PLAN_TABLE_OUTPUT
    Plan hash value: 1601196873
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |     9 |     5   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| T    |     1 |     9 |     5   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
       1 - filter(NLSSORT("NAME",'nls_sort=''BINARY_CI''')=HEXTORAW('6B61727
                  46869636B00') )
    14 rows selected.
    SQL> create index t_idx_1 on t(NLSSORT(name,'NLS_SORT=BINARY_CI'))
      2  /
    Index created.
    SQL> exec dbms_stats.gather_table_stats(user,'T',cascade=>true)
    PL/SQL procedure successfully completed.
    SQL> /
    create index t_idx_1 on t(NLSSORT(name,'NLS_SORT=BINARY_CI'))
    ERROR at line 1:
    ORA-00955: name is already used by an existing object
    SQL> delete from plan_table
      2  /
    2 rows deleted.
    SQL> explain plan for
      2  select * from t where name = 'karthick'
      3  /
    Explained.
    SQL> select * from table(dbms_xplan.display)
      2  /
    PLAN_TABLE_OUTPUT
    Plan hash value: 2580036035
    | Id  | Operation                   | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |         |     3 |    27 |     2   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T       |     3 |    27 |     2   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | T_IDX_1 |     3 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access(NLSSORT("NAME",'nls_sort=''BINARY_CI''')=HEXTORAW('6B6172746869636B00') )Thanks,
    Karthick.

  • ER diagram with SQL DEVELOPER, HELP!!!

    I have imported the data dictionary and generate the physical data model with tables name and type, now I want to create conceptual er-diagram, does any one know the physical data model can be converted into er-diagram? Because I only know physical data model can be converted to logical data model, but what I want is only relationship between entities?

    Yes, you can engineer your physical model to a logical one, then you'll have an ERD as well. It's a right-click on the model I believe.
    To be more specific, if you relational model is loaded, you can use the button in the toolbar that looks like a double-blue-arrow, or you can mouse-right-click on your relational model in the tree. This will engineer your model to a logical one. You'll then have your ERD.
    Edited by: Jeff Smith SQLDev PM on Apr 29, 2013 9:53 AM

  • How to crete CFL with SQL queries

    Hi, First create the srf which has two buttons- Choose and Cancel code for creating the grid :- you have to pass the SQL query as a paramter in the below function .In query you choose as many as fields from the table ,at run time columns will automatically created corresponds to your query. private bool CreateGrid(string sSQL) { try { SAPbouiCOM.Item oItem; oItem = oform.Items.Add("Grid", SAPbouiCOM.BoFormItemTypes.it_GRID); oItem.Left = 7; oItem.Width = 387; oItem.Top = 47; oItem.Height = 188; oform.DataSources.DataTables.Add("dtLookUpTable"); oDataTable = oform.DataSources.DataTables.Item("dtLookUpTable"); oDataTable.Clear(); oDataTable.ExecuteQuery(sSQL); oGrid = (SAPbouiCOM.Grid)oItem.Specific; oGrid.SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Single ; oGrid.DataTable = oDataTable; if(oGrid.Rows.Count > 0) { oGrid.Rows.SelectedRows.Add(0); } for (int iColCounter = 0; iColCounter < oGrid.Columns.Count; iColCounter+) { oGrid.Columns.Item(iColCounter).Width = 50; oGrid.Columns.Item(iColCounter).Editable = false; } oGrid.AutoResizeColumns(); return true; } catch(Exception ex) { oform.Freeze(false); throw ex; } } -
    choose the value on pressing the button 'Choose' protected override void ITEMPRESS_AFTERACTION(ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent, SAPbouiCOM.Application oSboApplication, SAPbobsCOM.Company oCompany) { BubbleEvent = true; if (pVal.ItemUID == "choosebuttonuid") { if (oGrid.Rows.SelectedRows.Count > 0) { SAPbouiCOM.DataTable oReturnTable = null; oform.DataSources.DataTables.Add("dtReturnTable"); oReturnTable = oform.DataSources.DataTables.Item("dtReturnTable"); oReturnTable.CopyFrom(oDataTable); for (int iRowIndex = 0; iRowIndex < oReturnTable.Rows.Count; iRowIndex) oReturnTable.Rows.Remove(iRowIndex); int iRow = oGrid.GetDataTableRowIndex(oGrid.Rows.SelectedRows.Item(0, SAPbouiCOM.BoOrderType.ot_RowOrder)); oReturnTable.Rows.Add(1); //for (int iColIndex = 0; iColIndex < oReturnTable.Columns.Count; iColIndex+) // oReturnTable.SetValue(iColIndex, 0, oDataTable.GetValue(iColIndex, iRow)); oReturnTable.SetValue(0, 0, oDataTable.GetValue(0, iRow )); oReturnTable.SetValue(1, 0, oDataTable.GetValue(1, iRow)); SBOAppAddOn.mLookupForms.Remove(oform.UniqueID.ToString()); then u have to send the oReturnTable with parentuid( issue for production) to the baseform. example-> SendData(oReturnTable, strParentFormUID, oSboApplication, oCompany); oform.Close(); } } } More:- You have to include the Doubleclick faclity on the grid You have to include the find functionality also.

    Hi,
    Can u repost?? as its very difficult to understand ur problem.
    Vasu Natari.

  • ASSERTION_FAILED when filling dropdownbykey with sql queries

    Hi everybody,
    I'm new to WDA, and I am coding a new interface for transaction CBIH82 in EHS.
    I am filling a dropdownbykey with a sql query, for the work area.
    On the view, the dropdownbykey is populated, but when I click on a button, or when I launch an action, I have the error "ASSERTION_FAILED".
    However, if I fill the dropdownbykey manually in the code, I got no error.
    Error in IE :
    The ASSERT condition was violated
    Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LSTANDARD===============CP
    Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LSTANDARD===============CP
    Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LSTANDARD===============CP
    Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LSTANDARD===============CP
    Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LSTANDARD===============CP
    Method: CONV_VIEW_INTO_VE_ADAPTER_TREE of program CL_WDR_INTERNAL_WINDOW_ADAPTERCP
    Method: SET_CONTENT_BY_WINDOW of program CL_WDR_INTERNAL_WINDOW_ADAPTERCP
    Method: RENDER_WINDOWS of program CL_WDR_CLIENT_SSR=============CP
    Method: IF_WDR_RESPONSE_RENDERER~RENDER_VIEWS of program CL_WDR_CLIENT_SSR=============CP
    Method: IF_WDR_RESPONSE_RENDERER~RENDER_USER_INTERFACE_UPDATES of program CL_WDR_CLIENT_SSR=============CP
    Here is the dump :
    27926     else.                                                                           
    27927       IFUR_NW5_COMBOBOX~READONLY = wd_DROPDOWN_BY_KEY->vl_READ_ONLY.                
    27928     endif.                                                                          
    27929 *   >> UCA STANDARD|ABSTR_DROPDOWN_BY_KEY|READONLY                                  
    27930     if M_PARENT_READONLY = abap_true or                                             
    27931        mv_KEY_ATTR_INFO-is_read_only = abap_true.                                   
    27932       IFUR_NW5_COMBOBOX~READONLY = abap_true.                                       
    27933     endif.                                                                          
    27934                                                                               
    27935 *   >> property-UCA IFUR_NW5_COMBOBOX~REQUIRED                                      
    27936 *   >> UCA STANDARD|DROPDOWN_BY_KEY|REQUIRED                                        
    27937     if mv_WD_STATE = cl_wd_dropdown_by_idx=>e_state-required.                       
    27938       IFUR_NW5_COMBOBOX~REQUIRED = abap_true.                                       
    27939     else.                                                                           
    27940       IFUR_NW5_COMBOBOX~REQUIRED = abap_false.                                      
    27941     endif.                                                                          
    27942                                                                               
    27943 *   >> property-Property IFUR_NW5_COMBOBOX~USEDINSAPTABLE                           
    27944     IFUR_NW5_COMBOBOX~USEDINSAPTABLE = /1WDA/VTABLE_CELL_EDITOR~mv_INSIDE_TABLE.    
    27945                                                                               
    27946 *   >> property-UCA mv_VALUE_SET                                                    
    27947 *   >> UCA STANDARD|ABSTR_DROPDOWN_BY_KEY|VALUE_SET                                 
    27948     data value_set_item type WDR_CONTEXT_ATTR_VALUE.        "#EC NEEDED             
    27949     mv_VALUE_SET = mv_KEY_ATTR_INFO-value_set.                                      
    27950     read table mv_VALUE_SET into value_set_item                                     
    27951       with key value = mv_KEY_INTERNAL.                                             
    27952     if sy-subrc = 0.                                                                
    27953       IFUR_NW5_COMBOBOX~VALUE = cl_http_utility=>escape_html( value_set_item-text ).
    27954     else.                                                                           
    27955       " entry not found - only legal for "initial" value                            
    >>>>>       assert mv_KEY_INTERNAL co ` 0`.                       "#EC NOTEXT             
    27957       IFUR_NW5_COMBOBOX~VALUE = ''.                         "#EC NOTEXT             
    27958     endif.                   
    The error is at line 27956.                                                     
    And here is my code to fill the dropdownbykey in my wddoinit of my view :
    data:
        lieux_de_travail                    type string,
        description_lieux_travail           type string,
        table_record_number_travail         type TABLE OF string,
        table_lieux_travail_full            type TABLE OF string,
        lieux_travail_full                  type string,
        record_number_travail               type string,
        valeur_int                          type i VALUE 0,
        valeur_string                       type string.
    SELECT RECNROOT FROM CCIHT_WAH INTO TABLE table_record_number_travail.
    LOOP AT table_record_number_travail INTO record_number_travail.
      SELECT WANAM FROM CCIHT_WALD INTO description_lieux_travail WHERE RECNROOT = record_number_travail.
      ENDSELECT.
      SELECT WAID FROM CCIHT_WAH INTO lieux_de_travail WHERE RECNROOT = record_number_travail.
      ENDSELECT.
      IF NOT lieux_de_travail = 'ALOUETTE'.
        CONCATENATE lieux_de_travail description_lieux_travail INTO lieux_travail_full SEPARATED BY ' - '.
      ELSE.
        lieux_travail_full = lieux_de_travail.
      ENDIF.
    INSERT lieux_travail_full INTO TABLE table_lieux_travail_full.
    ENDLOOP.
    data:     NODE_INFO type ref to IF_WD_CONTEXT_NODE_INFO,
              NODE_INFO_ACLOC type ref to IF_WD_CONTEXT_NODE_INFO.
    NODE_INFO = WD_CONTEXT->GET_NODE_INFO( ).
    NODE_INFO_ACLOC = NODE_INFO->GET_CHILD_NODE( 'INFO_ACLOC' ).
    data:    LT_VALUESET type WDR_CONTEXT_ATTR_VALUE_LIST,
             L_VALUE type WDR_CONTEXT_ATTR_VALUE.
    valeur_int = 0.
    LOOP AT table_lieux_travail_full INTO L_VALUE-TEXT.
      ADD 1 TO valeur_int.
      MOVE valeur_int to valeur_string.
      L_VALUE-VALUE = valeur_string.
      INSERT L_VALUE into table LT_VALUESET.
    ENDLOOP.
    CLEAR valeur_int.
    NODE_INFO_ACLOC->SET_ATTRIBUTE_VALUE_SET(
         NAME = 'LIEUX'
         VALUE_SET = LT_VALUESET ).
    The values are stored in the context node "INFO_ACLOC", and cardinality 1.1/0.1, in LIEUX of type String.
    Anybody had this error before?
    Thank you!
    Brad

    Hi Thomas,
    thank you, that was it.
    I had a conversion of int to string, and the resulting string was not good.
    It looked like as a number in the debug mode, but not in the hexadecimal value.
    I did not saw it, because I'm beginning to learn abap too.
    Brad

  • Can I get metadata with SQL queries ??

    Can I get relationships between tables in MS Access using SQL statements ??

    Actually, you might be able to get what you need out of DatabaseMetaData class.
    DatabaseMetaData meta = connection.getMetaData();perhaps using:
    public ResultSet getCrossReference(String primaryCatalog,
                                       String primarySchema,
                                       String primaryTable,
                                       String foreignCatalog,
                                       String foreignSchema,
                                       String foreignTable)
                                throws SQLException
    Retrieves a description of the foreign key columns in the given foreign key table that reference the primary key columns of the given primary key table (describe how one table imports another's key). This should normally return a single foreign key/primary key pair because most tables import a foreign key from a table only once. They are ordered by FKTABLE_CAT, FKTABLE_SCHEM, FKTABLE_NAME, and KEY_SEQ.

  • JComboBox or JList with SQL queries. Best practises.

    Hi!
    I'm wondering what you do in the following situation, providing you develop a hotel reservation application and you have a form where you enter room details: room number, number of rooms, description and type (JComboBox).
    So when executing an INSERT query what do you usually do? Do you store ID's of types or execute addtion SELECT query to get the if of the selected type?

    Thank you very much! I like your approach, but what if I should fill in a form automatically? I mean I have a section in my application where you can edit rooms, you choose a room from a JList and fter clicking on a particular room, the fields of the form get entered and if I have a JComboBox there what should I do?
    I use this approach:
    <code>
    public void valueChanged ( ListSelectionEvent e )
    Item item = ( Item ) lRooms.getSelectedValue();
    try {
    Db db = new Db ();
    ResultSet rs = db.executeQuery ( "SELECT * FROM rooms " +
    "WHERE id = " + item.getId () );
    rs.next ();
    pRoomsEdit.this.id = rs.getInt ( "id" );
    tfNo.setText ( item.getName () );
    ComboBoxModel cbm = cbType.getModel ();
    ResultSet rsType = db.executeQuery ( "SELECT name FROM types " +
    "WHERE id = " + rs.getString ( "type" ) );
    rsType.next ();
    cbm.setSelectedItem ( new Item ( rs.getInt ( "id" ), rsType.getString ( "name" ) ) );
    tfRoomNum.setText ( rs.getString ( "roomNum" ) );
    taDesc.setText ( rs.getString ( "description" ) );
    catch ( SQLException se ) {
    se.printStackTrace ();
    </code>

  • Why it's so inefficient to generate XML from SQL queries?

    I am learning to use Oracle9i XML DB to generate XML document using SQL queries. According to the document, there are multiple ways to do it (SQLX, DBMS_XMLGEN, SYS_XMLGEN, XSU). I am using SQLX to do it, but find it's so inefficient. Could someone point out what could be the problem?
    I generate XML from TPC-H database, using the query as shown below. The indexes and primary key/foreign keys are created and specified. The system is Pentium IV 2GHz, Linux 2.4.18 with 512MB memory and 1GB swap. With database size 5MB, it spends about 300 seconds (TKPROF result) to generate the XML document. But for 10MB TPCH database, I cannot get the xml document after a long time. I find that all almost physical memory are used up by it. Therefore I stop it.
    It seems that nested-loop join is used to evaluate the query, therefore it's very inefficient. I don't know whether there is a efficient way to do it.
    Wish to get your help. Thank you very much!
    Chengkai Li
    ===================================================================================================================
    SELECT XMLELEMENT (
    "region",
    XMLATTRIBUTES ( r_regionkey AS "regionkey", r_name AS "name", r_comment AS "comment"),
    (SELECT XMLAGG(
    XMLELEMENT (
    "nation",
    XMLATTRIBUTES ( n_nationkey AS "nationkey", n_name AS "name", n_regionkey AS "regionkey", n_comment AS "comment"),
    XMLConcat ((SELECT XMLAGG(XMLELEMENT (
    "supplier",
    XMLATTRIBUTES ( s_suppkey AS "suppkey", s_name AS "name", s_address AS "address", s_nationkey AS "nationkey", s_phone AS "phone", s_acctbal AS "acctbal", s_comment AS "comment"),
    (SELECT XMLAGG(XMLELEMENT (
    "part",
    XMLATTRIBUTES ( p_partkey AS "partkey", p_name AS "name", p_mfgr AS "mfgr", p_brand AS "brand", p_type AS "type", p_size AS "size", p_container AS "container", p_retailprice AS "retailprice", p_comment AS "comment", ps_availqty AS "ps_availqty", ps_supplycost AS "ps_supplycost", ps_comment AS "ps_comment")))
    FROM PART p, PARTSUPP ps
    WHERE ps.ps_partkey = p.p_partkey
    AND ps.ps_suppkey = s.s_suppkey
         FROM SUPPLIER s
    WHERE s.s_nationkey = n.n_nationkey
    (SELECT XMLAGG(XMLELEMENT(
    "customer",
    XMLATTRIBUTES ( c_custkey AS "custkey", c_name AS "name", c_address AS "address", c_nationkey AS "nationkey", c_phone AS "phone", c_acctbal AS "acctbal", c_mktsegment AS "mktsegment", c_comment AS "comment"),
    (SELECT XMLAGG(XMLELEMENT (
    "orders",
    XMLATTRIBUTES ( o_orderkey AS "orderkey", o_custkey AS "custkey", o_orderstatus AS "orderstatus", o_totalprice AS "totalprice", o_orderdate AS "orderdate", o_orderpriority AS "orderpriority", o_clerk AS "clerk", o_shippriority AS "shippriority", o_comment AS "ps_comment"),
    (SELECT XMLAGG(XMLELEMENT (
    "lineitem",
    XMLATTRIBUTES ( l_orderkey AS "orderkey", l_partkey AS "partkey", l_suppkey AS "suppkey", l_linenumber AS "linenumber", l_quantity AS "quantity", l_extendedprice AS "extendedprice", l_discount AS "discount", l_tax AS "tax", l_returnflag AS "returnflag", l_linestatus AS "linestatus", l_shipdate AS "shipdate", l_commitdate AS "commitdate", l_receiptdate AS "receiptdate", l_shipinstruct AS "shipinstruct", l_shipmode AS "shipmode", l_comment AS "comment")
    FROM LINEITEM l
    WHERE l.l_orderkey = o.o_orderkey
    FROM ORDERS o
    WHERE o.o_custkey = c.c_custkey
         FROM CUSTOMER c
    WHERE c.c_nationkey = n.n_nationkey
    FROM NATION n
    WHERE n.n_regionkey = r.r_regionkey
    FROM REGION r;

    Tim,
    Oracle Reports was the orginal way to do this in an Oracle Apps environment. However, the XML Publisher team built a tool called data templates to do this as well. You can read several articles on how to use data templates on the XMLP blog. Here's the first arcticle in a series: http://blogs.oracle.com/xmlpublisher/2006/11/08#a127.
    Bryan

  • SQL Queries, filter with multiple radio Buttons

    I am trying to figure out how to filter my datagridview with SQL queries so that both of them have to be met for data to show up not just one.
    My datagridview is bound to an Access Database.
    I basically would want it filtered by 'Width' and 'Wood Type'
    I have radio buttons in group boxes so a width and wood can be selected. However only one Query is applied at a time.

    Public Class Form1
    Private Sub StickersBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
    Me.Validate()
    Me.StickersBindingSource.EndEdit()
    Me.TableAdapterManager.UpdateAll(Me.TestDataSet)
    End Sub
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    'TODO: This line of code loads data into the 'TestDataSet.Stickers' table. You can move, or remove it, as needed.
    Me.StickersTableAdapter.Fill(Me.TestDataSet.Stickers)
    AcceptButton = Button1
    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    End Sub
    Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton1.CheckedChanged
    Try
    Me.StickersTableAdapter.Wood_Oak(Me.TestDataSet.Stickers)
    Catch ex As System.Exception
    System.Windows.Forms.MessageBox.Show(ex.Message)
    End Try
    End Sub
    Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton2.CheckedChanged
    Try
    Me.StickersTableAdapter.Wood_Walnut(Me.TestDataSet.Stickers)
    Catch ex As System.Exception
    System.Windows.Forms.MessageBox.Show(ex.Message)
    End Try
    End Sub
    Private Sub RadioButton3_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton3.CheckedChanged
    Try
    Me.StickersTableAdapter.Width14(Me.TestDataSet.Stickers)
    Catch ex As System.Exception
    System.Windows.Forms.MessageBox.Show(ex.Message)
    End Try
    End Sub
    Private Sub RadioButton4_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton4.CheckedChanged
    Try
    Me.StickersTableAdapter.Width18(Me.TestDataSet.Stickers)
    Catch ex As System.Exception
    System.Windows.Forms.MessageBox.Show(ex.Message)
    End Try
    End Sub
    Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
    If RadioButton5.Checked = True Then
    If TextBox1.Text = "" Then
    Else
    Me.StickersBindingSource.Filter = "Width LIKE '" & TextBox1.Text & "%'"
    DataGridView1.Refresh()
    End If
    ElseIf RadioButton6.Checked = True Then
    If TextBox1.Text = "" Then
    Else
    Me.StickersBindingSource.Filter = "[Wood Type] LIKE '" & TextBox1.Text & "%'"
    DataGridView1.Refresh()
    End If
    ElseIf RadioButton5.Checked = False And RadioButton6.Checked = False Then
    MsgBox("Please Select a Search Criteria")
    End If
    End Sub
    Private Sub TextBox2_TextChanged(sender As Object, e As EventArgs) Handles TextBox2.TextChanged
    Try
    Me.StickersTableAdapter.SearchWood(Me.TestDataSet.Stickers)
    Catch ex As System.Exception
    System.Windows.Forms.MessageBox.Show(ex.Message)
    End Try
    End Sub
    End Class

  • Sql queries - slow database

    hi all,
    is there a general but specific way to generate a list of sql queries that are consuming most resources and resulting in slow database performance?
    thanks.

    There are very few ways in this world that are "general but specific".
    You can use "general" tools like StatsPack and AWR.
    You can write "general" queries on V$SQL, V$SQLAREA, V$SQLSTATS.
    You can use "specific" methods like Tracing.
    You can use "specific" methods like Client side (or Application Server side) Logs.

  • Recursive Java programming method for executing recursive SQL queries

    Anybody has a Java/JDBC example method to execute recursive SQL queries and print results? The method has to work for any number of queries and levels and the first query passes the parameter to the second query.
    Edited by: user4316962 on Jun 12, 2011 1:59 PM

    user4316962 wrote:
    Guys, the problem what I am trying to solve is much more complex and I don’t think SQL level recursion is enough. I am looking for Java solution with SQL queries in it to make it more flexible and DB independent.
    If you want to do recursion in SQL then it has nothing to do with Java.
    And if you want to do recursion in Java then the idiom itself has nothing to do with SQL.
    Other than that you have provided enough detail for anyone to even guess at what you are asking.
    As a start I am not even sure that you understand what recursion is nor how JDBC works. (But it could be that you are using the terms to mean something else.)
    And looking at your original post it could be nothing more than that you are looking for a design pattern - perhaps the interpreter.

Maybe you are looking for

  • RAM upgrade from 1gig to 2gig for 1.83 Mac Mini Core 2 duo

    I have the new 1.83 gig mac mini and attempting to upgrade ram. Once opened, the ram slots are not easily available, unlike the older versions where you just snap it when the cover is removed. Is there any video instructions out there? The one I foun

  • Carry forward AR spl and asset error

    when I use year end balance carry forward for AP/AR, it pops the message saying company code still in year 2010, do we need to do vendor/customer  open item clearing and finish the dec month closing, then we can use f07 to carry forward and no such w

  • Office 2013 - Unable to save/save as to mapped home drive

    Hello-- We have several users who are unable to save documents to their mapped home drives, which we point to H. If you browse to the UNC of the mapping, you can save just fine. Other mapped drives work correctly, only the H mapping give us the messa

  • 10.2.1.1925 installed - No picture password

    I can't seem to find picture password on the System Settings --> Security and Privacy --> Device Password screen. Am i missing something? I thought this was a new feature. I have rebooted and hard rebooted (volume buttons), but still doesn't show up.

  • Password Protect Part of a Director Movie

    Hi, I've recently purchased INM Impressario and i've added a bunch of PDFS to my director movie. I'll be handing this movie out to my students, but i would like only certain students to view certain pdf files. Is there a way i can either password pro