SQL Code not working in Forms Developer without Functions?

Hi all,
I've write this code into Forms at it's work correctly in SQL and the following error occurened
The PL-SQL Code:
DECLARE
     Product_Name Products.Name%TYPE;
     Most_Occurence NUMBER(10);
BEGIN
     SELECT *
     INTO Most_Occurence, Product_Name
  FROM (SELECT   COUNT (returned_goods.ID) AS "Max Occurence", products.Name
  FROM Returned_Goods
  JOIN Products
  ON returned_goods.productId = products.Id
         GROUP BY returned_goods.productId, products.Name
         ORDER BY COUNT (returned_goods.ID) DESC)
WHERE ROWNUM = 1;
END;The error message (appears near JOIN Products) :
   Encountered symbol "PRODUCTS" when expecting one of the following:
      ), with group having intersect minus order start union where connectThanks in advance
Edited by: ZiKaS on Dec 30, 2008 8:57 AM

Now...obviously you can't use ansi join syntax in that forms module. So rewrite your query with
FROM returned_goods, products
WHERE returned_goods.productId = products.id
hth

Similar Messages

  • SQL Code not working in Forms Developer?

    Hi all,
    I'm using Oracle 10g and I have th following code running on iSQL+ but not working on Forms and I got the following erro
    The SQL code:
         select returningreason
            from (
                     select returningreason,
                     dense_rank() over (partition by 1 order by count(*) desc) as drnk
                     from returned_goods
                     group by returningreason)
           where drnk = 1;And the error happens near the word over to the right and the error statement is:
    Error 103 at line 18, column 19
       Encountered the symbol "(" when expecting one of the following:
             , formThanks in advance :)

    Triggers are compiled in forms so need to use only the features available to forms, which doesn't include all the new stuff in the database.
    select over partition
    NVL2They don't work in forms and reports too.
    Also if you use them in record Group
    Forms/SQL Compiler was not lined up to the database(10G).
    Meanwhile,for example. Pipelined TABLE and relative Select work in Reports AND Forms.

  • PL/SQL Code not working without debug statements

    Hi Guys,
    I have a pl/sql code in a procedure, logic iterates through almost 40K records, conditional delete and update.
    When I execute this code, I dont see the deletes and updates happening, though procedure executes for 8 minutes and exits wihtout any error, execption.
    In same procedure when I write some debug statements like dbms_output, then everything seems to be working fine.
    I know this scenario happens in Oracle Forms, wehre we use SYNCHRONIZE.
    But this is plain pl/sql procedure.
    any thoughts on this?
    Av.

    COMMIT ?
    Aside from that, no idea what your procedure looks like, what it does, what version of Oracle you are using, how you are determining "I dont see the deletes and updates happening". etc...
    You'd need to provide a slew of information for anyone to give you any meaningful help.
    I can only assure you that DBMS_OUTPUT doesn't do magic :)

  • Bug: Validate PL/SQL code not working?

    Hallo,
    in the newer versions of Apex there seems to be an issue with Process code validation.
    It doesn't make any difference if i check the
    "Do not validate PL/SQL code (parse PL/SQL code at runtime only)" option or if i don't.
    There is no parsing of the code and i can write the worst syntax without any problem resulting in bad runtime errors. However the parsing of Region SQL and PL/SQL is working well.
    Anybody knows what this is ?
    Thanks,
    Jochen
    Message was edited by:
    Jochen.Zehe

    I think I know what is happening.
    On the Create Process wizard, when you enter your PL/SQL code in
    http://i14.tinypic.com/4qxai38.jpg
    and click the Next button, the code is parsed and throws an error if it has syntax errors. But if you click on the Create Process button, the process is created, regardless of whether it has syntax errors or not!
    Similarly, the Edit Page Process page also doesn't appear to validate the code, it happily saves the process with any nonsense in the Process Source box, even when the "Do not parse code" checkbox is unchecked (default)
    Definitely a bug (not sure if it is regression from 2.x or not)

  • SQL (Reverse) not working in Forms 6i

    Hi:
    Env 6i c/s 8i DB.
    SELECT REVERSE ( '321' ) FROM DUAL works in SQL*Plus but does not accept the REVERSE function from within a Trigger. I could put the logic in a Package on the DB but I'd like to know why it does not work in F6i ?
    Thanks
    N.

    Forms 6i uses an older version of PL/SQL than the database, so it does not recognize the newly introduced function. You will need to create a database function to call from the form.

  • SQL code not working inside Java

    Below is my code from java. here, i'm trying to execute below sql code inside my java coding. its preety straight -
    ResultSet rs = null;
    PreparedStatement prepStmt = null;
    String statement="select * from TIMINGTABLE WHERE COUNTRY = 'USA' AND RE_DATE >= TO_DATE('04/11/2012','MM/DD/YYYY') order by COUNTRY";
    prepStmt = con.prepareStatement(statement);
    rs = prepStmt.executeQuery();
    dats it. but, its giving this error ---- SQL syntax error: the token "(" was not expected here
    now, here, when i simply remove this part from the above sql line ----- AND RE_DATE >= TO_DATE('04/11/2012','MM/DD/YYYY') -----the code works perfectly.
    RE_DATE is a date field in the sql table.
    I even tried this option too - TO_DATE(RE_DATE, 'MM/DD/YYYY') >= TO_DATE('04/11/2012','MM/DD/YYYY')
    which is giving same error
    please help
    -prodyut

    927428 wrote:
    Below is my code from java. here, i'm trying to execute below sql code inside my java coding. its preety straight -
    ResultSet rs = null;
    PreparedStatement prepStmt = null;
    String statement="select * from TIMINGTABLE WHERE COUNTRY = 'USA' AND RE_DATE >= TO_DATE('04/11/2012','MM/DD/YYYY') order by COUNTRY";
    prepStmt = con.prepareStatement(statement);
    rs = prepStmt.executeQuery();
    dats it. but, its giving this error ---- SQL syntax error: the token "(" was not expected here
    now, here, when i simply remove this part from the above sql line ----- AND RE_DATE >= TO_DATE('04/11/2012','MM/DD/YYYY') -----the code works perfectly.
    RE_DATE is a date field in the sql table.
    I even tried this option too - TO_DATE(RE_DATE, 'MM/DD/YYYY') >= TO_DATE('04/11/2012','MM/DD/YYYY')
    which is giving same error
    please help
    -prodyutWhat kind of DB you use?
    How do you connect to it?
    (If you use ODBC for example, that won't work)

  • PL/SQL code not working

    why is this code giving me error?
    declare
    type dept_tab_type is table of departments%rowtype;
    index by binary_integer;
    dept_tab dept_tab_type;
    v_counter number(3):= 270;
    begin
    for i in 10..v_count
    loop
    select * into dept_tab(i)
    from departments
    end loop;
    for i in dept_tab.first..dept_tab.last
    loop
    DBMS_OUTPUT.PUT_LINE(dept_tab(i).department_name);
    end loop;
    end;
    i got this error
    ORA-06550: line 3, column 5:
    PLS-00103: Encountered the symbol "INDEX" when expecting one of the following:
    begin function package pragma procedure subtype type use
    <an identifier> <a double-quoted delimited-identifier> form
    current cursor

    I think its you DEPT_TAB_TYPE deceleration which was incorrect.
    I think this might do it;
    set serveroutput on
    declare
      type dept_tab_type is table of departments%rowtype index by binary_integer;
      dept_tab dept_tab_type;
      v_counter number(3):= 270;
    begin
      for i in 10..v_counter loop
        select *
        into dept_tab(i)
        from departments
      end loop;
      for i in dept_tab.first..dept_tab.last loop
        DBMS_OUTPUT.PUT_LINE(dept_tab(i).department_name);
      end loop;
    end;
    /BUT
    UNTESTED!

  • Dynamic multi-row SQL :: doesn't work in Forms?

    I need to use a dynamic SQL statement and was at first trying to
    use the DBMS_SQL, which is overly complex. So I read up on NDS
    and thought that it would be much better to use.
    Unfortunately, Forms (6i) refuses to accept the correct syntax.
    ie:
    OPEN plr_cv FOR 'select foo from bar';
    returns an error:
    "Encountered the symbol 'select foo from bar'
    when expecting one of the following:
    select"
    plr_cv has been defined as per the examples in the Oracle
    documentation (as a ref cursor). Even a cut-and-paste of code
    from the Oracle Docs won't work. Why won't forms let me use NDS
    here? Is there a workaround?

    Did you ever get this to work. I tried using dynamic sql but this does not work in FORMS 6i.

  • Force encryption on SQL Server not working?

    Hello Everyone,
    I'm running SQL Server 2008 64-bit. I've installed a self-signed cert on the box and set  "Force Encryption"  and restarted SQL server. 
    I setup a client machine to trust the authority of the cert installed on the server. When I connect to that SQL server from SSMS from a client machine and select the "encrypt connection" option in the client Connection properties, SSMS correctly complains
    that the cert on the server does not match the computer name I asked to log into . This is because, although the cert is trusted, the dns name dos not match the CN in the cert <- Perfect, exactly what I am expecting.
    When I connect to the same SQL server from the same client but  UNCHECK "encrypt connection" on the client, I'm able to login. Considering I've checked the "Force Encryption" on the server, the server should have rejected the connection. Why not?
    Ameer Deen

    Hi all,
    We are implementing a Merge Synchronization solution which involves three SQL Servers located on three Azure locations worldwide and one on-premises location. We need to secure communications between all servers. We are evaluating the encryption of all server
    communications through SSL:
    http://technet.microsoft.com/en-us/library/ms191192.aspx
    When we configure one server (let’s call it server A) to accept only encrypted connections (with Force Encryption=Yes) we still can connect from other server (let’s call it server B) that do not have the certificate installed. We would expect the server
    B to fail in the attempt of connect as server A should only accept encrypted communications and those should need the certificated to encrypt/decrypt everything (commands and data).
    We have also review the following forum post that is very similar to this one:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/bde679d9-ff83-4fa7-b402-42e336a97106/force-encryption-on-sql-server-not-working
    In all cases the Microsoft answer is:
    “When the
    Force Encryption option for the Database Engine is set to YES, all communications between client and server is encrypted no matter whether the “Encrypt
    connection” option (such as from SSMS) is checked or not. You can check it using the following DMV statement”
    When we run the provided DMV statement to check if encryption is enabled:
    -- To check whether connections are encrypted between server and clients
    SELECT encrypt_option
    FROM sys.dm_exec_connections
    We get “TRUE”. So theoretically encryption is enabled.
    Then:
    Why can we run SQL statements against server A from server B (with SSMS) without any certificate?
    Are we wrong when we expect server A to refuse any client that do not have the right certificate?
    How can server B, without any certificate, decrypt the data encrypted by server A?
    Our intention is to encrypt all server in the same way so all of them will accept only encrypted communications. We are assuming that the Merge Agent will be able to communicate with the Publisher and the Subscriber through this encrypted environment. May
    anyone please confirm ti?
    Thanks for your help.
    Best Regards
    Benjamin Moles

  • What will you do if any SQL is not working.in oracle 10g...apps 11.5.10.2

    What will you do if any SQL is not working. in oracle 10g....apps 11.5.10.2

    928714 wrote:
    yes sir.If you help me in answering my questions i wll be very thankful to you sir.
    tnx,I haven't a clue.
    As you have been advised in many of your posts, go study the documentation for whichever specific topic you are interested in.
    For me to answer your questions, I would need to go get that documentation.
    Then I would need to read that documentation.
    Then I would need to write a forum post that interprets what I think I learned from that documentation.
    It is so very much faster if YOU go do that instead of posting to a forum and expecting others to do it. You will remember what you study for a lot longer time if you teach yourself.

  • Ole2 commands not working in forms 10g

    OLE2.set_property(Application, 'Visible', true);
    above statement not working in forms 10g;

    Try to use the OLE2 fuction from WEBUTIL library. There is function in webutil CLIENT_OLE2.
    -Ammad

  • Error PL Developer - SQL*Net not properly installed PL Developer

    - ok i am getting this error after i have installed my oracle 10 client on a windows 7 OS.
    - trying to use PL DEVELOPER version 6 (which is free ).
    error :
    SQL*Net not properly installed PL Developer
    -any ideas?
    Thanks in advance

    Maybe PL/SQL Developer is trying to use some missing registry values, or a missing ORACLE_HOME environment variable
    Check the ORACLE_HOME is pointing to your 10g client path, and then try to add the following entries in the registry, making a .reg file with the following, replacing with your paths, and executing (from Windows PATH variable
    [HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE]
    "inst_loc"="C:
    Program Files\\Oracle
    Inventory"
    "API"="D:\\oracle\\product\\10.1.0
    db_1"
    [HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ALL_HOMES]
    "HOME_COUNTER"="1"
    "DEFAULT_HOME"="HOME0"
    "LAST_HOME"="0"
    [HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ALL_HOMES\ID0]
    "NAME"="Oracle - ORACLE_HOME"
    "PATH"="D:\oracle\product\10.1.0\db_1"
    "NLS_LANG"="NA"
    [HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0]
    "ID"="0"
    "ORACLE_GROUP_NAME"="Oracle - ORACLE_HOME"
    "ORACLE_HOME_NAME"="ORACLE_HOME"
    "ORACLE_HOME"="D:\\oracle\\product\\10.1.0\\db_1"
    I hope this help
    Regards,
    Alfonso Vicente

  • PS4 Game Voucher Code not working

    my PS4 Game Voucher Code not working and says: "The code you entered may not be correct or may no longer be valid" "Please check your entry (e-820000134)  

    Voucher codes are region-specific. For instance a US voucher won't work with a UK account. First thing to check is whether the voucher's region matches your account's region.

  • Sql is not working after changing from MsAccess into sql server

    Following Sql  is not working after changing from MsAccess into sql server. 
    sum(trn.sales) as sales,
    sum(trn.cost) as cost,
    sales - cost as profit // Here is not working . can we not use sales a column. Please advise
    from trn
    Kind Regards
    pol
    polachan

    It will not work if use two different column from the table or column  from two  different table
    Example
    sum(trn.sales * trn.rate) as salesAmount,
    sum(trn.cost) as cost,
    sum(trn.salesAmount)-sum(trn.cost) as profit ----- Here is not working . can we not use sales a column. Please advise
    from trn
    Regards
    polachan

  • [svn] 2260: Fix for version checking code not always detecting calls to newer functions .

    Revision: 2260
    Author: [email protected]
    Date: 2008-06-26 12:42:39 -0700 (Thu, 26 Jun 2008)
    Log Message:
    Fix for version checking code not always detecting calls to newer functions.
    flex checkintests pass
    Modified Paths:
    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/semantics/ConstantEvaluator.java
    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/semantics/ReferenceValue.java

    Revision: 2260
    Author: [email protected]
    Date: 2008-06-26 12:42:39 -0700 (Thu, 26 Jun 2008)
    Log Message:
    Fix for version checking code not always detecting calls to newer functions.
    flex checkintests pass
    Modified Paths:
    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/semantics/ConstantEvaluator.java
    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/semantics/ReferenceValue.java

Maybe you are looking for

  • The First execution of a Stored Proc shows a delay between SP:StmtStarting and SP:Starting

    We experience a performanceproblem with some of our Stored Procedures. SQL Server is "Microsoft SQL Server 2012 (SP1) - 11.0.3128.0 (X64)" Situation: SQL Server Proc1 executes some SQL Statement and starts some other SQL Stored Procedures. I open a S

  • Desktop pictures: is there a limit to number of pictures

    Hi there I have a folder full of pictures (ie 6 thousand) that rotate through the desktop. Is there a limit to how many pictures I can have in the source folder and still have the display & computer functioning all right? Also, does changing the pic

  • Dates for Infinity enabling

    I think BT are playing with the enable dates My sister line was changed from Oct 2011 to a infinity date.(no Idea when they can switch it on) She went on line today found her was enabled and gets it fitted Thursday next week. So why do thay keep chan

  • Viewing Transport Log Errors in ECC

    Dear SRM Experts, System Info : ECC 6.0. and SRM 5.0 We moved transports from Dev to QA and some of the transports failed with  Return codes of 8 and 12. Where do we look up the transport errors that occured. Points will be rewarded for answers. Than

  • To trigger ADOBE form from Custom Infotype

    hello, I hae create d ADOBE form and want to trigger it on "Save" record from Custom Infotype.... I need this form to be displied as User my do some changes and save it again... I have used following code to trigger this from module pool... Data : lv