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.

Similar Messages

  • 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

  • Getting ORA-12518 error with DG4ODBC for link with SQL Server

    Hi all,
    We have recently upgraded a test box to 11g2 on a 64bit windows platform and now when setting up our database links with our sql servers we are recieving an 'ORA-12518' error.
    listener.ora
    LISTENERPCIS =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = WILTS-ORCL4)(PORT = 1522))
    SID_LIST_LISTENERPCIS =
    (SID_LIST =
    (SID_DESC =
    (PROGRAM = dg4odbc)
    (SID_NAME = PCIS)
    (ORACLE_HOME = c:\oracle\product\11.2.0\db_1)
    tnsnames.ora
    PCIS =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = WILTS-ORCL4)(PORT = 1522))
    (CONNECT_DATA =
    (SID = PCIS)
    (HS = OK)
    Any help appericated
    Cheers
    David

    C:\Users\administrator.ADMIN>tnsping pcis
    TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 24-JUN-2
    010 20:55:29
    Copyright (c) 1997, 2010, Oracle. All rights reserved.
    Used parameter files:
    C:\ORACLE\PRODUCT\11.2.0\DBhome_1\network\admin\sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhos
    t)(PORT = 1522)) (CONNECT_DATA = (SID = PCIS)) (HS = OK))
    OK (0 msec)
    C:\Users\administrator.ADMIN>lsnrctl status LISTENERPCIS
    LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 24-JUN-2010 20:55
    :47
    Copyright (c) 1991, 2010, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1522)))
    STATUS of the LISTENER
    Alias listenerpcis
    Version TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Produ
    ction
    Start Date 24-JUN-2010 20:55:17
    Uptime 0 days 0 hr. 0 min. 30 sec
    Trace Level admin
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File C:\ORACLE\PRODUCT\11.2.0\DBhome_1\network\admin\listen
    er.ora
    Listener Log File c:\oracle\product\11.2.0\diag\tnslsnr\WILTS-ORCL4\listenerpcis\alert\log.xml
    Listener Trace File c:\oracle\product\11.2.0\diag\tnslsnr\WILTS-ORCL4\listenerpcis\trace\ora_12216_2424.trc
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1522)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\PNPKEYipc)))
    Services Summary...
    Service "PCIS" has 1 instance(s).
    Instance "PCIS", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully
    C:\Users\administrator.ADMIN>dg4odbc
    Oracle Corporation --- THURSDAY JUN 24 2010 20:55:54.257
    Heterogeneous Agent Release 11.2.0.1.0 - 64bit Production Built with
    Oracle Database Gateway for ODBC
    C:\Users\administrator.ADMIN>

  • 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)

  • Multibyte issue in database link with sql server

    Hi Gurus,
    Greetings!!!
    I need to transfer data from Microsoft SQL Server 2005 to Oracle DAtabase 10g(AL32UTF8 characterset). I achieved it using Heterogeneous Connectivity. I can now issue queries but unfortunately i got an issue in displaying multibyte characters. I thought of using another Tool that can display multibyte data but it did not help. I even tried setting the initialization parameter HS_LANGUAGE to different characterset but still not able to display. Kindly help and advise how to resolve the said issue.
    Many Thanks in Advance,
    Benjie

    What is the exact issue you're talking about?
    Can you explain it or show us a sort of it with a sample output?
    MS SQL Server is not our daily bread so we may not know how it works with Oracle and what problems are there in their interconnectivity, but we may tell you what may be the reason of a behavior that causes the issues for your purpose.
    Bye Alessandro

  • 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.

  • 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

  • Essbase Cube Linking With Sql

    Hi,experts!!!!!!!
    I have Essbase Studio From Epm 11.1.2.1 Version,the thing is that i have to link the Essbase cube to sql,can you suggest any solutions or can just give me info about drill back method in essbase studio...

    The documentation on drill-through is a good place to start http://docs.oracle.com/cd/E17236_01/epm.1112/est_user/ch17.html
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • ORA-28545: error diagnosed by Net8  for DG4ODBC for link with SQL Server

    Database: 11.2.0 Windows 32-bit (on WindowsXP SP3)
    ORACLE_HOME = D:\Oracle\Product\11.2.0\dbhome
    GATEWAY_HOME = D:\Oracle\Product\11.2.0\tg
    odbc : sqlserver (working... i can import table's data in MS Excel) its ok...
    D:\Oracle\Product\11.2.0\dbhome\hs\admin\initsqlserver.ora
    # This is a sample agent init file that contains the HS parameters that are
    # needed for the Database Gateway for ODBC
    # HS init parameters
    HS_FDS_CONNECT_INFO = sqlserver
    HS_FDS_TRACE_LEVEL = 0
    # Environment variables required for the non-Oracle system
    #set <envvar>=<value>
    D:\Oracle\Product\11.2.0\dbhome\NETWORK\ADMIN\listener.ora
    # listener.ora Network Configuration File: D:\Oracle\Product\11.2.0\dbhome\network\admin\listener.ora
    # Generated by Oracle configuration tools.
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = orcl)
    (ORACLE_HOME = D:\Oracle\Product\11.2.0\dbhome)
    (PROGRAM = extproc)
    (ENVS = "EXTPROC_DLLS=ONLY:D:\Oracle\Product\11.2.0\dbhome\bin\oraclr11.dll")
    (SID_DESC=
    (SID_NAME=sqlserver)
    (ORACLE_HOME = D:\Oracle\Product\11.2.0\dbhome)
    (PROGRAM = dg4odbc)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 172.20.0.32)(PORT = 1521))
    ADR_BASE_LISTENER = D:\Oracle\Product\11.2.0\dbhome
    Listener Status
    LSNRCTL> status
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.20.0.32)(PORT=1521))
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Produ
    ction
    Start Date 30-SEP-2011 11:13:53
    Uptime 0 days 0 hr. 0 min. 24 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File D:\Oracle\Product\11.2.0\dbhome\network\admin\listener
    .ora
    Listener Log File d:\oracle\product\11.2.0\dbhome\diag\tnslsnr\stylo-dba
    \listener\alert\log.xml
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.20.0.32)(PORT=1521)))
    Services Summary...
    Service "orcl" has 1 instance(s).
    Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
    Service "sqlserver" has 1 instance(s).
    Instance "sqlserver", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully
    LSNRCTL>
    D:\Oracle\Product\11.2.0\dbhome\NETWORK\ADMIN\tnsnames.ora
    # tnsnames.ora Network Configuration File: D:\Oracle\Product\11.2.0\dbhome\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    ORACLR_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    (CONNECT_DATA =
    (SID = CLRExtProc)
    (PRESENTATION = RO)
    ORCL =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 172.20.0.32)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orcl)
    sqlserver =
    (DESCRIPTION=
         (ADDRESS=(PROTOCOL=tcp)(HOST=172.20.0.32)(PORT=1521))
    (CONNECT_DATA =
    (SID=sqlserver))
    (HS = OK)
    TNS PING Restult
    C:\Documents and Settings\Administrator>tnsping sqlserver
    TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 30-SEP-2
    011 11:15:47
    Copyright (c) 1997, 2010, Oracle. All rights reserved.
    Used parameter files:
    D:\Oracle\Product\11.2.0\dbhome\network\admin\sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=172.20.0.32)(PO
    RT=1521)) (CONNECT_DATA = (SID=sqlserver)) (HS = OK))
    OK (50 msec)
    C:\Documents and Settings\Administrator>
    Database Link
    create database link sqlserver connect to uoracle identified by uoracle using 'sqlserver';
    SQL>
    SQL> select from sysobjects@sqlserver*
    ERROR:
    ORA-28545: error diagnosed by Net8 when connecting to an agent
    Unable to retrieve text of NETWORK/NCR message 65535
    ORA-02063: preceding 2 lines from DG4ODBC
    SQL>
    Waiting for help. What thing im missing.....

    Hi Naeem,
    You have said the install setup is -
    ORACLE_HOME = D:\Oracle\Product\11.2.0\dbhome
    GATEWAY_HOME = D:\Oracle\Product\11.2.0\tg
    but in the listener.ora you have set ORACLE_HOME for the gateway as -
    (ORACLE_HOME = D:\Oracle\Product\11.2.0\dbhome)
    To use DG4ODBC installed in the 'tg' ORACLE_HOME then you should configure a listener in the gateway OH -
    D:\Oracle\Product\11.2.0\tg\network\admin
    and start this listener. This listener will need to use a different port from the RDBMS listener in the other OH.
    Change the gateway tnsnames.ora entry used by the RDBMS to reflect this port change.
    One other point - SQL*Server is case sensitive so you may need to create the database link as -
    create database link sqlserver connect to "uoracle" identified by "uoracle" using 'sqlserver';
    if the user/password are defined in lower case in SQL*Server.
    Also, the same for object names depending on the SQL*Server configuration -
    select "column_name" from "owner"."table_name"@sqlserver ;
    Regards,
    Mike
    Edited by: mkirtley on Sep 30, 2011 8:12 AM

  • 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>

  • 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

  • ODBC Link ans SQL Server

    Hi!
    So I tried to create a ODBC link with SQL server, but there is a problem during the authentification process.
    When I try to use authentification thanks to SQL server, even with 'sa' user enabled, this error shows up
    Connection failed:
    SQLState: '28000'
    SQL Server Error: 18456
    [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'myUser'.
    When I try to use authentification with Windows ID, another error shows up :
    Connection faled:
    SQLState: '28000'
    SQL Server Error: 18452
    [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.
    The server is a VPS server and there is no domain to configure.
    I already tried to switch to mixed authentification, with it I can easily connect to SQL server with SQL server Management Studio. I also already browsed SQL Server Configuration Manager in order to set a static (not dynamic) port, TCP/IP are enabled in SQL
    server Network Configuration / Protocols for SQLEXPRESS but it still doesn't work. Ofc I restarted SQL server several times and I even tried to uninstall/reinstall it.
    Finally, this error shows up when I start SQL Server agent with SQL server Configuration Manager.
    >The request failed or the service did not respond in a timely fashion. Consult the event log or other applicable error logs for details.
    I tried to find out what is the problem by reading the logs but there is nothing about the failed authentification attempts there. It only shows some services starting or stopping.
    I read somewhere that it the VIA protocol could be the problem, but I can't find it anywhere in SQL Server Configuration Manager.
    I've been struggling for days with this. you're my only hope
    thanks!

    I juste forgot to explain that I have to do this for a client who will use a software of my company and this software needs this ODBC link to communicate with SQL Server. Also the users will connect to the server in TSE (so the application will be on the
    same server than SQL Server). I don't know if this detail is important but I prefer specify.
    "If it works in SSMS to connect with a SQL Login, then it should work with ODBC by using the same server name/credentials from the sam Client."
    I entered 'sa' user and another user that I created in SQL Server but I have the same error (login fail for user)
    "Are remote Connections enabled? Is a Firewall running on server and/or Client side? If so unblock the required TCP and UDP ports."
    Remote Connections are enabled on the server and there's just Windows Firewall on the server. I unblocked resquired TCP and UDP Ports. Even with the Windows Firewall turned off I have this problem. 

  • 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

  • How to restore playlists?

    I just updated my iPod, and when it was done updating, I correctly disconnected it, but after doing so my playlists disappeared on iTunes, however they are on my iPod. I don't see any topic-related articles on the website as to why this happened and

  • New AIrport Extreme - seems to work, but....

    Hey all: Just received an Airport Extreme to replace old D-Link wireless router. Connected everything, and all seems to work as it should. But.... The AE unit's amber light on the front is continuously flashing. The Setup Guide says this indicates on

  • WDS unattend.xml shutdown the system after installing the image instead of reboot.

    I have a large number of machines that I want to install Windows 7 by using WDS unattend.xml.  unattend.xml works absolutely fine but I want WINPE to shutdown the system at the end of image installation and before OOBE.  Could you please let me know,

  • Emails disappear when placed in categories

    I moved several emails to one of my categories. They were there 2 days ago, but when I wanted to access now they went missing. Yes, I am sure I didn't accidentally delete. Not the oly category gone missing.

  • Custom Pattern

    I am trying to create a field (text, password, number, etc) to have the social security number print with this pattern xxx-xx-1234 (to show only the last four of the ssn) and am getting an invalid pattern... what am I doing wrong? Is there a way to c