Query in jdeveloper

hello
i am a user of oracle10G jdeveloper using jclient/swing
in my product.
please do tell me how to write query in my jdeveloper. i mean select clause .
i do know that using viewobject we can run query but is their any other way to run the query like(select distinct name from usermaster).
how to use the distinct clause.
thank you
Aparna

Here is what I did.
I created a new "Default" application.
In the model project I created a new View object based on the HR schema. stepped through the wizard and in the query field I entered "select distinct (last_name) from employees"
And clicked test and finish.
Then I added an application module with the view object and tested it.
It works great.
Don't change a view that is alreadt there from the wizards and is connected to an entity object. Create a new view that is not connected to an entity.

Similar Messages

  • How to build table join query in Jdeveloper

    Hi,
    Can someone tell me how to build table join query in Jdeveloper's Expression Builder UI?

    [Is it possible to create a table of contents in Crystal Reports?|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313335333133303330%7D.do]

  • Query in jdeveloper using  distinct clause

    hello
    I am a user of oracle10G jdeveloper using jclient/swing
    in my product.
    I had written a query in my default view object as
    Select distinct(Name) from emp then i test it.
    Then message get displayed Query is valid.
    But when i bind this view object with my form ie with combobox using model property and finally run the form then it throw an error message .
    Please do help me to sort out this problem .
    thanks

    Please post the error message and the exception stack.
    My guess is that the error is: your VO's SQL statement did not include the primary key attribute (say Empno).
    Thanks.
    Sung

  • Execute a query in Jdeveloper using DB adpater

    Hi All ,
    In jdeveloper, using DB adapter i want to execute the following query ,
    select segment1,eng_item_flag from table_name where segment1 in ('itemnumber1',’itemnumber2’);
    In the query the operation IN got used so could you please help me to proceed further

    DB adpater wraps the parameter by ' (apostrophe), so using IN clause it becomes '1,2,3,4,5.........n' and the query returns nothing.
    You need to use below query in DB Adpater
    select attributes,attributes2 from table name where partnumber in (WITH VALUE_LIST AS
    (SELECT ? val FROM dual)
    SELECT SUBSTR(val, (decode(LEVEL, 1, 0, instr(val, ',', 1, LEVEL -1)) + 1), (decode(instr(val, ',', 1, LEVEL) -1, -1, LENGTH(val), instr(val, ',', 1, LEVEL) -1)) -(decode(LEVEL, 1, 0, instr(val, ',', 1, LEVEL -1)) + 1) + 1) a
    FROM VALUE_LIST CONNECT BY LEVEL <=
    (SELECT(LENGTH(val) -LENGTH(REPLACE(val, ',', NULL)))
    FROM VALUE_LIST) + 1)
    Value of <partnumber> tag can be mapped to DB Adapter Inputvariable.
    If you create a very big value list for IN query (greater than 4000 characters) you will get ORA-01704: string literal too long error. In that case you need to break value list and invoke this query multiple times.
    Thanks
    Ravdeep

  • How to use Query in JDeveloper

    Dear all,
    I use Oracle JDeveloper 10g,
    In the DesignerModel we can define Graph,Crosstab,Query,etc.
    In JSP page I can use the Presentation by drag&drop it.
    But I do not know how to use the Query that we have created by GUI through bibeans API.
    Any help is appreciated!
    thanks

    It seems that there is nobody meeting the same problem.
    I solved it by myself.
    An thanks.

  • Error coming while running  Hibernate HQL  select query in jdeveloper

    Hi ,
    I have created hibernate application with just create query its running fine, i also writeen HQL select query below exception is coming,
    CharScanner; panic: ClassNotFoundException: org.hibernate.hql.ast.HqlToken
    i also checked org.hibernate.hql.ast.HqlToken , its thr in jar file, eventhough it is throwing error.
    plz give sollution

    Hi dvohra,
    I have written below code
    List l1=new ArrayList();
    try{
    HibClass hib = new HibClass();
    Session session = hib.currentSession();
    Transaction tx = session.beginTransaction();
    Manager m;
    System.out.println("server------------------------");
    //Using from Clause
    String SQL_QUERY ="from Manager manager";
    Query query = session.createQuery(SQL_QUERY);
    List list = query.list();
    for (int i = 0; i < list.size();
    i++) {
    Manager manager =
    (Manager) list.get(i);
    System.out.println(
    "MId " +
    manager.getMid() +
    " Manager Name: " +
    manager.getMname());
    m=new Manager();
    m.setMid(manager.getMid());
    m.setMname(manager.getMname());
    l1.add(m);
    session.close();
    }catch(Exception e){
    System.out.println("helo-------------error---------"+e.getMessage());
    }finally{
    return l1;
    still below exception is coming
    CharScanner; panic: ClassNotFoundException: org.hibernate.hql.ast.HqlToken
    oc4j is shutting down
    i am trying from 4 days , help me

  • Jdeveloper query

    hi all,
    im built a query, which is running in 3 seconds in sql plus. But when i used the same query in jdeveloper ittakes 5 minutes to execute. Im using string buffer. What may be the problem.

    Do you (or your DBA) have access to some sort of session browser tool? If so, 5 minutes should be plenty of time to grab the explain plan of the actual query as executed through JDeveloper. If you compare that to the explain plan you get from SQLPlus, you might be able to see what it's doing differently - and whether it's even exactly the same query.

  • Error Setting up PL*SQL (sqlplus.exe) on JDeveloper 10.1.3.3

    Hi,
    I recently installed JDeveloper and Oracle Express Edition. To set up SQL*Plus I went into Tools->Preferences->Database Connections and pointed the SQL*Plus executable to
    C:\oraclexe\app\oracle\product\10.2.0\server\BIN\sqlplus.exe
    which is part of the Oracle Express Edition. When I try to run an SQL query from JDeveloper I get the following error:
    The target sqlplus.exe cannot be started because it is not a runnable target.
    Double clicking on the file successfully runs sql*plus. Any ideas?
    Thanks
    Casson

    OK, This is the PL/SQL package:
    Function:
    FUNCTION Obtener_paises RETURN res_webservice AS
    v_respuesta res_webservice;
    i PLS_INTEGER:=1;
    CURSOR C_paises IS
    SELECT cpais, tpais
    FROM paises
    ORDER BY tpais;
    BEGIN
    v_respuesta := res_webservice(null,null);
    v_respuesta.error := res_error(null,null,null);
    v_respuesta.error.cerror := 0;
    v_respuesta.error.cerror_ora := 0;
    v_respuesta.error.terror := null;
    v_respuesta.datos := res_datos ();
    FOR v_pais IN C_paises LOOP
    v_respuesta.datos.extend;
    v_respuesta.datos(i) := reg_datos(null,null);
    v_respuesta.datos(i).codigo := v_pais.cpais;
    v_respuesta.datos(i).descripcion := v_pais.tpais;
    i := i + 1;
    END LOOP;
    Insertar_log(NULL,SYSDATE,'C','Obtener_paises',NULL,'ERROR:0');
    RETURN v_respuesta;
    EXCEPTION
    WHEN OTHERS THEN
    v_respuesta.error.cerror := 1;
    v_respuesta.error.cerror_ora := SQLCODE;
    v_respuesta.error.terror := substr(SQLERRM,1,80);
    Insertar_log(NULL,SYSDATE,'C','Obtener_paises',NULL,'ERROR:1 '||substr(SQLERRM,1,120));
    RETURN v_respuesta;
    END Obtener_paises;
    TYPES USED:
    CREATE OR REPLACE
    TYPE res_webservice AS OBJECT (error res_error, datos res_datos);
    CREATE OR REPLACE
    TYPE res_error AS OBJECT (cerror NUMBER(1), cerror_ora VARCHAR2(12), terror VARCHAR2(80));
    CREATE OR REPLACE
    TYPE res_datos AS TABLE OF reg_datos;
    CREATE OR REPLACE
    TYPE reg_datos AS OBJECT(codigo VARCHAR2(12), descripcion VARCHAR2(150));
    Thanks in advanced...
    Could happen this bacause of these defined types???

  • How to see a query?

    I get the following message when I try to delete a row using BC4J and JSP:
    Error Message: JBO-26080: Error while selecting entity for GenesisSalesGroup
    Error Message: ORA-00936: missing expression
    I've added a transient column to an entity class. Best I can figure, it is this column that is causing the missing expression, but, since I cannot see the query, I cannot confirm it is the problem.
    So, what is the best way to view a query in JDeveloper and BC4J, I just need to see the code it generated so I can figure out what's going on here.
    Regards,
    Ed.

    Hi,
    If you are accessing a View Object to remove a row, you can
    see the associated query in the properties panel of the VO in
    JDeveloper.At design time? Or run time?
    I can see a query for the View, but it is a select query and is valid. I cannot see the Delete statement that is generated by the Business Object. That is what is failing.
    You may want to check the Attribute Settings of the entity
    to make sure that transient attribute is not mapped to any
    table column. The View Attributes "Entity Tab" shows a "Database Column" value of "$none$", which I assume is correct.
    Regards,
    Ed.

  • Bug after adding fields in advanced search mode of af:query

    We are migrating from JDeveloper 11.1.1.6 to 11.1.1.7.
    I noticed the following issue:
    In a page with search criteria (based on a view object), when the user adds an additional field in advanced search mode and clicks on a full submit button in the page, the following browser popup appears:
    "This page is asking you to confirm that you want to leave - data you have entered may not be saved."
    This was logged as a bug in Oracle Support but we have not been able to find a workaround yet.
    This is the only issue currently blocking us from migrating to 11.1.1.7. Has anyone else faced this issue? Any ideas on how we can bypass this behavior?
    Thank you,
    Gabriel.

    Unfortunately, the latest update from Oracle Support was that they no longer consider this a bug!
    SR 3-7706485141: Additional Fields in af:query problem - JDeveloper 11.1.1.7
    Bug 17346704 - ADDING FIELD TO AF:QUERY ADVANCED SEARCH CAUSES SPURIOUS WARNING DIALOG POPUP
    1. I cannot understand how something that blocks user actions and cannot be bypassed in any way could be considered "acceptable behavior".
    2. I also do not understand how a Bug can be lodged and then have its status changed to "Not a Bug".
    3. Even if we were to ignore this issue and convince our customers that they should be delayed by meaningless popups while working (which we cannot), their is still another issue that makes this functionality dysfunctional. When the user clicks on "Stay on Page" the popup closes and the page freezes and becomes unresponsive.
    Off course this is another issue and a different SR should open, but I think it shows that something is going very wrong with this functionality.
    I wonder if anyone else is considering using JDeveloper 11.1.1.7.0 in a production system.

  • SQL-Query with JDBC returns error ORA-00600

    Hi,
    I try to execute a SQL-Query using JDeveloper 3.2.3 and the Oracle JDBC-Library 8.1.7
    The following statement
    'ResultSet rset=stmt.executeQuery(SQL-String);'
    where stmt is Statement returns a Database-Error
    ORA-00600 with the Arguments [ttcgcshnd-1], [0] [], [], [], [], [], []
    when the SQL-String queries Varchar2 or CHAR-Columns.
    The Query returns correct values for numeric fields.
    The Database-Server is running on Oracle 9i
    Does anybody know, what could be the reason?
    Thanks, Harold

    I found many forums about it also, but I still haven't got solution yet.
    They talk about the cause, and report to oracle group and so on,
    but I still don't know how to solve my problem and how to enable my oracle 9i jdbc driver working.
    Need help please

  • XSQL File - Dynamic query from standard Browser - XML response.

    Hi, this is my first post !
    I need to query an Oracle DB from the web browser and get the data in XML format.
    I've made some progress but they're still not enough.
    I wrote a FIXED query from JDeveloper XSQL File (here is my big lack of knowledge) and then I compiled it, and run it. Doing so, a tcp service listening to specific port was created. (I also have a program called lsnrctl running at server side). For example:
    http://IP:PORT/Application1-test1-context-root/query.xsql
    Ok, pointing that address from explorer, I happily have the result of my FIXED query in XML format:
    <?xml version="1.0" encoding="windows-1252"?>
    <ROWSET>
    <ROW NUM = '1'>
    <field_1>value_1</field_1>
    <field_2>value_2</field_2>
    <field_3>value_3</field_3>
    <field_4>value_4</field_4>
    </ROW>
    <ROW NUM = '2'>
    <field_1>value_A</field_1>
    <field_2>value_B</field_2>
    <field_3>value_C</field_3>
    <field_4>value_D</field_4>
    </ROW>
    </ROWSET>
    BUT I need to pass the query as a DYNAMIC parameter. Something like:
    http:IP:PORT/...?SQL="SELECT * FROM MY_TABLE WHERE my_condition ORDER BY my_column" from the browser.
    Please, I will appreciate any suggestion, to put me in the right way!!
    I am struggling to find out the solution since last two weeks!
    Thank you in advance !
    JM

    Ok,what I needed was this xsql file:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <page xmlns:xsql="urn:oracle-xsql" connection="jdbc/user_xsql_1DS">
    <xsql:query max-rows="-1" null-indicator="no" tag-case="lower">
    {@sql}
    </xsql:query>
    </page>
    So, from the web browser i can pass ?sql=MY_GENERIC_QUERY. And it works just as I expect.
    BUT. I tried this running Embedded OC4J Server (from the IDE). The last step I need is to achive the same result but from a generic web server like Apache.
    If I copy the .xsql file to ../htdocs/ the root apache directory for documents, and I ask for http://localhost/query.xsql what I get is the QUERY but not the RESPONSE. I don't get the values from the selected table, what I get again is:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <page xmlns:xsql="urn:oracle-xsql" connection="jdbc/user_xsql_1DS">
    <xsql:query max-rows="-1" null-indicator="no" tag-case="lower">
    {@sql}
    </xsql:query>
    </page>
    Can anybody guide me to configure Apache in order to get the resulting XML, not my query!!
    Thank you in advance!
    Juan Manuel

  • Upgrade jdbc driver in jdeveloper

    Hi,
    We have build an application in jdev 10.1.3.3.0 which connects to a database 10.2.0.3.0.
    We have been experiencing performance issues during the execution of some of our queries.
    When executing this query outside jdeveloper (sqldeveloper, sqlnavigator), performance is ok, and explain plan is as expected.
    When exactly the same query is executed from within Jdeveloper, (application and SQL worksheet) the explain plan gets messed up and performance is bad.
    We suspect this has to do with the version of the JDBC Client.
    As in the past we experienced similar behaviour when running queries from older Oracle clients (fi. 10g rel 1).
    Can someone indicate on how we can check and upgrade the version of the JDBC driver Jdeveloper is using.
    thanks,
    Gert

    You can upgrade your JDBC driver by doing the next steps:
    1. Download JDBC driver from
    http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
    2. Browse to <JDeveloper_home>\jdbc\lib
    3. Replace the existing files with the new files you have downloaded (you might need to make a backup first)
    4. Now, you have successfully upgraded your JDBC driver.

  • Obiee server SQL throw exception :ORA-29275

    The obiee server throws oracle exception: ORA-29275 while execute in the sql in the bidw , the sql results have Chinese characters
    I have try to copy the sql to query from Jdeveloper adn SQL developer , the sql can run and no exception so does it the NSL_LANG issue in the obiee server side ?
    I also have try to set the NSL_LANG as AMERICAN_AMERICA.AL32UTF8 and AMERICAN_AMERICA.UTF8 , and they seems not worked!
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 17001] Oracle Error code: 29275, message: ORA-29275: partial multibyte character at OCI call OCIStmtFetch. [nQSError: 17012] Bulk fetch failed. (HY000)

    Any one can help?

  • 500 Internal Server Error in SRdemo application

    hi everyone... i have installed the SRDemo application i have also created the db schema and bd connection but when i run the application and enter one of the pass and username i always get the same error:
    java.lang.NoSuchMethodError: oracle.adf.view.faces.webapp.UploadedFileProcessor.init(Ljava/lang/Object;)V     at oracle.adfinternal.view.faces.webapp.ConfigParser.parseConfigFile(ConfigParser.java:117)     at oracle.adfinternal.view.faces.context.AdfFacesContextFactoryImpl._getBean(AdfFacesContextFactoryImpl.java:40)     at oracle.adfinternal.view.faces.context.AdfFacesContextFactoryImpl.createContext(AdfFacesContextFactoryImpl.java:29)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterHelperImpl.startFilter(AdfFacesFilterHelperImpl.java:87)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:110)     at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:103)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)     at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:162)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:620)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:369)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:865)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:447)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:215)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)     at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)     at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)     at java.lang.Thread.run(Thread.java:595)
    i think it has to do with the configuration of the application to connect with the db i have created but i dont know how to do that.... do i have to change anything to the session.xml file???
    any idea? thanks in advance
    Message was edited by:
    user537329

    Post your query at "JDeveloper" thread, for sure you would get better response:
    JDeveloper and ADF

Maybe you are looking for

  • How To Force User to Fulfill validations in view before switch to another view in infopath 2012

    i have a form with different views ,, every view has some validations ,, how to validate each view's validations before switching to another view if manual how to do that ?

  • DBMS bug in Oracle 10g Relese 2

    It seems some bug appeared in Oracle 10g Release 2. We have a single installation of that release on a Linux system. Therefore we don't know if the bug also exists on Windows or Mac platforms. It will be appreciated if someone can give some advice or

  • RFC call during mapping?!

    Hi @ all, I have a question I like to call a RFC function during mapping. Is this possible and if - how to do that :-)?? THX Matt

  • Close all in accordion widget?

    Is there a way / I wish you would add  a Close ALL option to the accordion widget. Because the widget can push content down the page, if the accordion is left open and a user clicks on a nav bar that has an anchor placed when the accordion is closed,

  • Switch logs

    hey gurus i have a database on oracle 9.2. i have created two standby out of it .and both are in managed recovery.ths database has sufficient space of it's requirement . Good space for datafile to grow and good space for archive logs. but the strange