Using a Sum query in Oracle Forms

Greedings,
I have the following query which works fine in PL/SQL but i cant get it working in Oracle forms as i get an error in SUM(SELECT...) . Any quidance on how i should fix my query to work in Forms?
select
   Sum((SELECT kl.amount
            FROM S03_a_salfldg@oracle_to_sun kl
            WHERE Trim(kl.accnt_code)=Trim(a.acnt_code)
            AND kl.period between 2008001 AND 2008012 AND ROWNUM=1)) AS actual
   from so_budgets_cat a,a01_acnt@oracle_to_sun b,so_budgets_com c,so_budgets d
   where trim(a.acnt_code)=trim(b.acnt_code)
   AND a.cat=c.cat
   AND TRIM(d.acnt_code)=trim(a.acnt_code)
   AND d.business_object=10000103883
   AND d.business_object=c.bus_object
   AND d.business_object=a.business_object
   AND SubStr(d.period,1,4)=Trim(c.PERIOD_Y)
   AND C.period_Y BETWEEN substr(2008001,1,4) AND substr(2008001,1,4)
   GROUP BY a.cat,a.acnt_code,c.com,a.cat_desc,b.descr,d.acnt_code
   order by a.cat,a.acnt_code,c.com,a.cat_desc,b.descrThanks in advance

And what error would that be? Also where are you using this query? In a from clause query? Also you didn't specify any version infos; as forms has it's own PL/SQL engine there is a possibility that you run in a version problem if the code runs fine in SQL*Plus but fails to compile in forms (e.g. when running Forms 6i against a 10g database). Without those informations answers to your question are based on guessings, and most likely will result in a question-answer ping-pong.
cheers

Similar Messages

  • Can i use case in query in oracle form 6i

    sir can i use case in query in oracle form 6i
    such as
    select empno, case when deptno=10 then dptno end from emp;
    please gice me

    Hello,
    Does this code compile ?
    If not, I'm afraid that the PL/SQL engine of Forms6i does not recognize this syntax.
    Francois

  • For Update Query from ORACLE Forms

    Hi
    We are using Oracle Forms 10g running with 10g database 10.2.0.1.0. We happend to see a query which is getting generated in AWR report like Select rowid, all_columns from TableName for Update of C1 Nowait. But no such query is really written in forms and we are aware that, Any query prefixed with rowid is definitely executing from Forms. But how the ForUpdate and Nowait clause is appended to the query.
    We have checked the following properties in the database Block
    *1) Locking Mode is set to Automatic*
    *2) Update Changed Columns only is set to YES*
    *3) Query all records is set to No (Though this particular property may not be relevant to the issue)*
    What is the property or setting which might trigger such a query from ORACLE Forms with ForUpdate and Nowait clause.
    Any ideas/suggestions on why such behaviour. Please have a healthy discussion on this. Thanks in advance.

    you can't dynamically add a query to the data model in reports.
    You should look into the XML based customization of Oracle Reports. This will enable you to define a report dynamically by creating a definition in XML.
    Also another option is to have the report with a query in it and use lexical parameters in reports to pass the query definition or just the where part of it.
    Look at the reports online help for both of these solutions.

  • Frm-40505:ORACLE error: unable to perform query in oracle forms 10g

    Hi,
    I get error frm-40505:ORACLE error: unable to perform query on oracle form in 10g environment, but the same form works properly in 6i.
    Please let me know what do i need to do to correct this problem.
    Regards,
    Priya

    Hi everyone,
    I have block created on view V_LE_USID_1L (which gives the error frm-40505) . We don't need any updation on this block, so the property 'updateallowed' is set to 'NO'.
    To fix this error I modified 'Keymode' property, set it to 'updatable' from 'automatic'. This change solved the problem with frm-40505 but it leads one more problem.
    The datablock v_le_usid_1l allows user to enter the text (i.e. updated the field), when the data is saved, no message is shown. When the data is refreshed on the screen, the change done previously on the block will not be seen (this is because the block updateallowed is set to NO), how do we stop the fields of the block being editable?
    We don't want to go ahead with this solution as, we might find several similar screens nad its diff to modify each one of them individually. When they work properly in 6i, what it doesn't in 10g? does it require any registry setting?
    Regards,
    Priya

  • Index Usage from SQL query in Oracle Forms

    Would using LIKE/OR in where clause (of an indexed column) will force the the query to NOT use INDEX. We have these where clause in Oracle Forms Records Group.
    Below are two examples...
    1. If we have a where clause with LIKE would that NOT use the index?
    Example: ColumnName like :block.Column||%
    2. How about having an OR clause?
    Example: and (ColumnName = :block.column or :block.column is null)
    Thanks

    Hi
    Answer 1: Where with like clause WOULD use the index.
    In this example index on ColumnName
    Answer 2: Write better where:
    Example: and (:block.column is null or ColumnName = :block.column)
    When :block column is null then statement after 'or' is not used. Index will not be used with RBO, i think.
    The best way to be sure is to look at explain plan on the original query.
    Regards
    Kuba

  • Developering ADF form in query mode (Oracle forms simulation)

    Hi,
    we have a requirement for developing the existing Oracle form using Oracle ADF. The existing Oracle form displays the form in query mode by default. We can enter the search criteria in any of the text fields and then execute query to get the results. If the user does not enter any search criteria, then the form loads specific record based on default criteria into the form. Could you please help developing similar form using ADF.
    At present I created the view object with one bind variable and dragged the view as ADF form to the jspx page. Then I am launching the form in query mode (executing the find method on the view object using operation binding at the time of loading the page). After entering the query criteria in the form, If I click on a button I am executing a method in the managed bean. In the managed bean I am executing the "Execute" operation on the view and it is working fine.
    But my problem is if the user does not enter the search criteria I have to pass default parameters to the view object and return the default record in the form.
    Can you please help in resolving the issue.
    Thanks and Regards,
    S R Prasad

    Hi Frank,
    Thank you for providing information. I created the query panel with the table by dragging all the named criteria. But this is not the look we are expecting for this form. As we have to deveop ADF form with the same behavior as oracle forms, the user must be in a position to edit the data in the same field as that of query field.
    As an example, we have to design a form for Dept table. We have to display all the columns of the dept view in the form at the time of launching the form in query mode. Once the user enters any search criteria in the form, we have to perform search and display the record(s) matching the query criteria in the same columns displayed in the form. User should not see any changes in the form layout.
    If the user does not enter any data in the form, then we have to display the record(s) in the form with the specific department id(This department id can be calculated based on the data in another table).
    Can you please help us in resolving the issue.
    Thanks and Regards,
    S R Prasad

  • How to use this sql query in oracle?

    Hi all,
    i am using one sql query that is
    SELECT @ToDate = '2012-10-03 00:00:00.000'
    select @BetweenDate = DATEADD(MM,-1,@ToDate)
    select @FromDate = DATEADD(m,DATEDIFF(m,0,@BetweenDate),0)
    SELECT @ToDate = DATEADD(month, ((YEAR(@BetweenDate) - 1900) * 12) + MONTH(@BetweenDate), -1)
    so @todate value is = '2012-10-03 00:00:00.000'
    so in @betweendate value will come 1 month before like '2012-09-03 00:00:00.000'
    again in @fromdate value will come like that '2012-09-01 00:00:00.000' means first date of @betweendate
    and again @todate value will come like that '2012-09-30 00:00:00.000' means last date of @betweendate
    it's happening in sql and i have to use same logic in oracle also.
    how to use it??
    thanks

    declare
    todate date:= to_date('2012-10-03 00:00:00','yyyy-mm-dd hh:mi:ss');
    betwendate date := add_months(todate,-1);
    for datediff / additions you can direct subtract/add two different date variables
    like
    datediff = betweendate -todate
    dateadd := todate+1;

  • Cannot use Flashback Versions Query in Oracle 10g

    If I want use Flashback Versions Query for one Table in my Database 10.1.0.4 then I receive follow error message:
    500 Internal Server Error
    java.lang.RuntimeException: options is null
         at oracle.sysman.emSDK.jsp.ListBean.applyAttributes(ListBean.java:70)
         at oracle.sysman.emSDK.jsp.ShuttleBean.render(ShuttleBean.java:41)
         at oracle.cabo.ui.BaseUINode.render(Unknown Source)
         at oracle.cabo.ui.BaseRenderer.renderChild(Unknown Source)
         at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
         at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
         at oracle.cabo.ui.BaseRenderer.renderContent(Unknown Source)
         at oracle.cabo.ui.BaseRenderer.render(Unknown Source)
         at oracle.cabo.ui.laf.xhtml.XhtmlLafRenderer.render(Unknown Source)
         at oracle.cabo.ui.BaseUINode.render(Unknown Source)
         at oracle.cabo.ui.BaseUINode.render(Unknown Source)
         at oracle.cabo.ui.BaseRenderer.renderChild(Unknown Source)
         at oracle.cabo.ui.laf.xhtml.RowLayoutRenderer.renderChild(Unknown Source)
         at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
         at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
         at oracle.cabo.ui.BaseRenderer.renderContent(Unknown Source)
         at oracle.cabo.ui.BaseRenderer.render(Unknown Source)
         at oracle.cabo.ui.laf.xhtml.XhtmlLafRenderer.render(Unknown Source)
         at oracle.cabo.ui.BaseUINode.render(Unknown Source)
         at oracle.cabo.ui.BaseUINode.render(Unknown Source)
         at oracle.cabo.ui.BaseRenderer.renderChild(Unknown Source)
         at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
         at oracle.cabo.ui.BaseRenderer.renderIndexedChild(Unknown Source)
         at oracle.cabo.ui.BaseRenderer.renderContent(Unknown Source)
         at oracle.cabo.ui.BaseRenderer.render(Unknown Source)
    .... and so on
    Can any of you help me?

    At what stage did you get this error?. Have you already selected the type of Flash Back Versions Query you want e.g Specifying type of Point in Time (Row Evaluation, Timestamp or SCN) or just when you select from the Action?

  • How to show the result of query in oracle forms 10g to Excel Sheet File

    Dear All,
    I have query and i want the result to be show in excel sheet file in oracle forms
    for example if i have a form with search criteria and when pressed the button of ( export to excel ) the result is
    excel file contains the result of the query .

    The only method to achieve this is with the help of Webutil. Please go through documentation for more help.
    Regards,
    Manoj Chakravarthy

  • Using of google map in oracle forms 10g

    Hello,
    We are on Oracle Forms 10g. We have a requirement of calling a Custom Map application (Like Google Maps) from Oracle Forms 10g.
    We want to show the Employee's Hose location in the form when city,street and state is entered.
    We are using the following PJC
    http://forms.pjc.bean.over-blog.com/article-26335020.html
    But when i run it i do not get anything in GMAP.
    I appreciate if I can get some help for the above requirements.
    Thank you.

    hello sir,
    I am running my form from the form Builder.
    I have copied my jar file into E:\DevsuiteHome_1\forms\Java Folder.
    Updated formsweb.cfg file as
    archive_jini= frmall.jar,frmwebutil.jar,jacob.jar,StaticGMap.jar
    and updated default.env Class path
    I got the following error: on java console
    Oracle JInitiator: Version 1.3.1.30
    Using JRE version 1.3.1.30-internal Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\Administrator
    Proxy Configuration: Manual Configuration
    Proxy:
    Proxy Overrides:
    JAR cache enabled
    Location: C:\Documents and Settings\Administrator\Oracle Jar Cache
    Maximum size: 50 MB
    Compression level: 0
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    q: hide console
    s: dump system properties
    t: dump thread list
    x: clear classloader cache
    0-5: set trace level to <n>
    Loading http://polish_dap-2:8889/forms/java/frmall_jinit.jar from JAR cache
    Loading http://polish_dap-2:8889/forms/java/frmwebutil.jar from JAR cache
    Loading http://polish_dap-2:8889/forms/java/jacob.jar from JAR cache
    Loading http://polish_dap-2:8889/forms/java/JCalendarJinit.jar from JAR cache
    Loading http://polish_dap-2:8889/forms/java/jcalendar.jar from JAR cache
    Loading http://polish_dap-2:8889/forms/java/AWTFileDialog.jar from JAR cache
    Loading http://polish_dap-2:8889/forms/java/FileDropper.jar from JAR cache
    Loading http://polish_dap-2:8889/forms/java/statusbar.jar from JAR cache
    Loading http://polish_dap-2:8889/forms/java/lablediconbutton.jar from JAR cache
    Loading http://polish_dap-2:8889/forms/java/dynamicmenu.jar from JAR cache
    Loading http://polish_dap-2:8889/forms/java/ComboMenuBar.jar from JAR cache
    Loading http://polish_dap-2:8889/forms/java/StaticGMap.jar from JAR cache
    Loading http://polish_dap-2:8889/forms/java/personalize.jar from JAR cache
    Loading http://polish_dap-2:8889/forms/java/progressbar.jar from JAR cache
    Loading http://polish_dap-2:8889/forms/java/rolloverbutton.jar from JAR cache
    Loading http://polish_dap-2:8889/forms/java/getclientinfo.jar from JAR cache
    proxyHost=null
    proxyPort=0
    connectMode=HTTP, native.
    Forms Applet version is : 10.1.2.0
    java.lang.ClassNotFoundException: java.io.IOException: open HTTP connection failed.
         at sun.applet.AppletClassLoader.getBytes(Unknown Source)
         at sun.applet.AppletClassLoader.access$100(Unknown Source)
         at sun.applet.AppletClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at oracle.forms.handler.UICommon.instantiate(Unknown Source)
         at oracle.forms.handler.UICommon.onCreate(Unknown Source)
         at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
         at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
         at oracle.forms.engine.Runform.processMessage(Unknown Source)
         at oracle.forms.engine.Runform.processSet(Unknown Source)
         at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
         at oracle.forms.engine.Runform.onMessage(Unknown Source)
         at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
         at oracle.forms.engine.Runform.startRunform(Unknown Source)
         at oracle.forms.engine.Main.createRunform(Unknown Source)
         at oracle.forms.engine.Main.start(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)

  • How to use Key Board Key In oracle forms to perform a specific task

    Hello Experts,               I am new In Oracle forms.I am using weblogic server 10.3.5 with oracle forms 11g at windows 7.I have a procedure(say check) under program unit.I have a data block.Now I have need to access Check procedure when I press The 'Ctrl+C'(control +'C' key board key). I have to set this functionality for a single form(module) not for all modules.Please suggest me how to do this by using pl/sql in oracle forms if possible. thank You regards aaditya.

    Hi,
    Its a documentary question, please google for hotkey mapping in forms.
    I hope this is helpful to you Enabling Key Mappings

  • Using PJC in Web Based Oracle forms Applications

    Hello,
    Any one could tell how to Configure 10g AS for using date,Key filter etc PJC in
    web based Applications of Oracle forms(having beans/olb,pll attached)
    Avijeet

    please sir help me
    1. I have attached the calendar.pll(remove path=yes),reusablecomponents.olb
    and compiled in Windows based forms builder 9i. worked fine
    2. Put into RHEL based Oracle 10g AS having compiled in the AS(f90genm.sh)
    while putting the .pll and .olb in the current directory where the .fmx is placed
    3. but in the enerprise web when I press button to invoke the Calendar the error is
    ora-06508 unable to find procedure

  • Using Safari to connect to ORACLE forms

    Hallo,
    I want to test Safari as a browser to connect to ORACLE forms (10/11). When I try to do this, it tells me that it needs to download and install the appropriate jInitiator. Although it is already installed on my PC (I am using IE and Firefox to connect) I chose to download and install again.
    I have restarted Safari but it still does not connect to ORACLE forms.
    How and/or where do I need to configure Safari to find the correct jInitiator and to connect to ORACLE forms?
    Regards,
    Phlip Pretorius

    Okay. We could do some basic-principles troubleshooting if you like. (The issue with that is that I'm not entirely sure if this is a deficiency in the current Safari versions, or if it's a problem with the Safari versions on your PC ... so there's a chance we'd be beating our heads against a wall trying to "fix" this.)
    The first thing I'd be inclined to check on would be whether this is a systemwide or user-specific issue on the PC. (This isn't a cure in itself, but can give us a heads up on the possible nature of the problem.)
    Head into your User accounts control panel and create a new user account with full administrative rights. Now log out of your usual account and log into the new account. (Don't use fast user switching to move between accounts.)
    Launch Safari in the new account, and try connecting to the forms again. Do you get the error message again? or does it connect okay in there?

  • Query on oracle forms

    when i am trying to run my oracle form on google chrome i am getting a error message that oracle jinitiator version is very low
    kindly give the answer

    Google Chrome is not compatible with the Oracle Jinitiator.  Actually, very few - if any - current browsers are compatible because the Oracle Jinitiator is based on Java 1.3.
    As others have asked, we need to know your Forms, Windows, Java and browser versions in order to offer you some help.
    Craig...

  • Data to be queried in oracle forms

    select a.dept_id,a.drive_id,a.qc_type_id,a.qc_subtype_id,
    a.equip_code,a.staff_id,a.out_of_service,a.comments
    from qc_equipment_used a,qc_equipment b
    where a.equip_code = b.equip_code
    and a.dept_id = 5
    and a.drive_id = 'DRV2007930'
    and qc_type_id = 1008
    and qc_subtype_id = 1000
    and equip_type_id =1000
    But when I am trying to query in the form I get only one line.
    Header is database
    in the detail ids are database but a.equip_code,a.staff_id,a.out_of_service,a.comments are non database columns. The data gets saved properly but when I query I get only one line.
    Cursor C1 is select a.equip_type_id
    from qc_dept_equipment a,qc_equipment_type b
    where a.equip_type_id = b.equip_type_id
    and a.qc_type_id = :qc_daily.qc_type_id
    and a.qc_subtype_id = :qc_daily.qc_subtype_id
    and alias_desc = v_description;
    Cursor C6 is select a.equip_code,a.staff_id,a.out_of_service,a.comments
    from qc_equipment_used a,qc_equipment b
    where a.equip_code = b.equip_code
    and a.dept_id = :qc_daily.dept_id
    and a.drive_id = :qc_daily.drive_id
    and qc_type_id = :qc_daily.qc_type_id
    and qc_subtype_id = :qc_daily.qc_subtype_id
    and equip_type_id = v_equip_type_id;
    Begin
    select count(*) into v_count from qc_daily a
    where a.dept_id = :qc_daily.dept_id
    and a.drive_id = :qc_daily.drive_id
    and qc_type_id = :qc_daily.qc_type_id
    and qc_subtype_id = :qc_daily.qc_subtype_id;
    v_description := 'Genesis Sealer';
    :parameter.equip_code := 'one';
    Open c1;
    Fetch c1 into v_equip_type_id;--:qc_dept_equipment.equip_type_id;
    Close C1;
    If v_count > 0 then
    Open C6;
    loop
    Fetch C6 into :qc_equipment_used1.equip_code,:qc_equipment_used1.staff_id,
    :qc_equipment_used1.out_of_service,:qc_equipment_used1.comments;
    :parameter.P_EQUIP_CODE := v_equip_code;
    :parameter.equip_type_id := v_equip_type_id;--:qc_dept_equipment.equip_type_id;
    :parameter.EQUIP_TYPE_ID1 := :parameter.equip_type_id;
    Exit when :system.last_record = 'TRUE';
    next_record;
    End loop;
    Close C6;
    End if;
    End;
    DEPT_ID     DRIVE_ID     QC_TYPE_ID     QC_SUBTYPE_ID     EQUIP_CODE     STAFF_ID     
    5     DRV2007930     1008     1000     SEALCEN001     0143          
    5     DRV2007930     1008     1000     SEALCEN038     0143

    Sorry, but i don't understand your problem. What is that code you provided? In what trigger do you place it? What is it supposed to do?

Maybe you are looking for

  • Week view - repeating dates wrong!

    Hi there. Strange problem this. When I enter a repeating event (all day) into iCal, say 16th July to 31st July, the block shows up fine in Month view and ends when it should. In Week view however it all goes a bit odd, and the 16-31 July example I ga

  • Error in authentication with ldap server with certificate

    Hi, i have a problem in authentication with ldap server with certificate. here i am using java API to authenticate. Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.

  • Macbookpro & linksys wrt300n router

    Hello, can you tell me if I can use a linksys wrt300n wireless router with a macbookpro & G4 Imac ? thanks

  • Problems with event handling in JmenuItem

    Hello: I'm trying to handle an event for a menuItem and tool bar item: with this code: newBallotAction = new AbstractAction("newBallot") public void actionPerformed(ActionEvent e) try{ System.out.println("MainWindow newBallotAction"); Ballot ballot =

  • Premiere Elements 8

    Today Adobe announced the release of Premiere Elements 8. For those interested in some of the new featuers in this exciting new release, I've created a new FAQ with a linked PDF of some screen shots and detailed discussions. http://forums.adobe.com/t