Query giving compilation error

hi,
i am confused that my query is working fine on back-end sqlplus, but as i put to use it in my form
at pre-form to know count, it gives compilation error;
sqlplus
SELECT COUNT(*) M_CNT1
FROM(
SELECT POH_CODE||'-'||POH_NO CODE,NVL(POH_FREIGHT_lc_amount,0)
-NVL((
SELECT SUM(FTH_LC_AMOUNT)
   FROM FIN_TXN_HEADER
  WHERE FTH_REF_CODE = POH_CODE
    AND FTH_REF_NO = POH_NO
    AND FTH_ACNT_CODE = 'AC1009'
  GROUP BY FTH_REF_CODE,FTH_REF_NO),0) NET, POH_CODE, POH_NO
FROM PURCHASE_ORDER_HEADEr
WHERE NVL(POH_FREIGHT_LC_AMOUNT,0) > 0);
    M_CNT1
         1
in pre-form
declare
m_cnt1 number;
BEGIN
SELECT COUNT(*) INTO M_CNT1
FROM(
SELECT NVL(POH_FREIGHT_lc_amount,0)
-NVL((
SELECT SUM(FTH_LC_AMOUNT)
   FROM FIN_TXN_HEADER
  WHERE FTH_REF_CODE = POH_CODE
    AND FTH_REF_NO = POH_NO
    AND FTH_ACNT_CODE = 'AC1009'
  GROUP BY FTH_REF_CODE,FTH_REF_NO),0) NET
FROM PURCHASE_ORDER_HEADER
WHERE NVL(POH_FREIGHT_LC_AMOUNT,0) > 0);
END;return error;
Error 103 at line 11, column 2
Encountered the symbol "SELECT" when expecting on of the following:
( - + mod not null others<an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
cast<a string literal with character se specification>
<a number> <a single-quoted SQL string>
Error 103 at line 16, column 36
Encountered the symbol "," when expecting on of the following:
) intersect minus union
i think the problem is continuation line or single quote.
what is it can anybody help me please? tyvm.

>
Error is in this line.
Use : before M_CNT1hi Navneet,
m_cnt1 is neither a db-or-a-non-db-block item.
so how come i used : sign before m_cnt1.
i guess the problem is below sonewhere may be,
-NVL((
SELECT SUM(FTH_LC_AMOUNT)       --- line 11
                     OR
  GROUP BY FTH_REF_CODE,FTH_REF_NO),0) NET    --line 16

Similar Messages

  • Why it is giving compilation error

    byte b = 50;
    byte c = 50*2; //giving compilation error
    why????

    It shouldn't give you compilation errors. It compiles
    fine using JDK 1.4Maybe an earlier compiler (one that doesn't bother to actually check the int literals) is griping about a potential loss of precision, would be my only guess...

  • Do java programms after giving compilation error generates .class file?

    Do java programms after giving compilation error generates the .class file?
    Do any outer class may have the private as access modifier?
    If someone asks you that -do any program in java after giving a compilation error gives the .class file -do any class except(inner class)
    be defined as private or static or protected or abc or xxx Now type the
    following program
    private class test
    public static void main(String s[])
    System.out.println("Hello!How are You!!");
    -Compile it.... You must have
    received this error test.java:1:The type type can't be private. Package members are always accessible within the current package. private class
    test ^ 1 error
    Here please notify that compiler has given the
    error not the warning therfore .class file should not be created but now type
    >dir *.class
    ___________ and you will see that the
    test.class file existing in the directory nevertheless this .class file
    is executable. if you will type __________________ >java test
    it will
    wish you Hello! and suerly asks you that How are You!! ________________!
    You can test it with the following as acces modifiers and the progrm will run Ofcourse it will give you compilation error.
    protected
    xxx
    abc
    xyz
    private
    Do you have any justification?

    Hmm,
    I've been working with different versions of jdk since, if I'm not mistaken, jdk1.0.6 and never was able to get *.class with compilation errors. It was true for Windows*, Linux, and Solaris*.
    About the 'private'/'protected' modifier for the type (class) - it makes perfect sence not to allow it there: why would anyone want to create a type if no one can access it? There should be a reason for restricting your types - let's say, any inner class can be private/protected.
    For ex., you shouldn't have compile problems with this:
    class Test
    public static void main(String s[])
    System.out.println("Hello!How are You!!");
    private class ToTest{}
    Sorry, but I don't really know where you can read up on that.

  • Given query giving an error -invalid month????

    select to_date(add_months(trunc(sysdate),-5) ||' 10:30:00 AM','mm/dd/yyyy hh:mi:ss am') from dual
    giving an error-invalid month..

    1. Instead of comma you have put dot.
    2. Below is teh correct usage
    select to_date(to_char(add_months(trunc(sysdate),-5),'DD/MM/YYYY')||' 10:30:00 AM','DD/MM/YYYY HH:MI:SS AM')
    from dual3. But, why are you going for this when there is a straight forward way?

  • Custom Function giving compile error

    Hi All,
    I have created a custom function to get the current time stamp. Below is the java code:
    package com.oracle.determinations.examples;
    import com.oracle.determinations.engine.CustomFunction;
    import com.oracle.determinations.engine.EntityInstance;
    import java.util.*;
    import java.text.*;
    public class CurrentTimeStamp extends CustomFunction {
       public Object evaluate(EntityInstance entityInstance, Object[] objects) {
          Date dNow = new Date( );
          SimpleDateFormat ft =
          new SimpleDateFormat ("MM/dd/yyyy HH:mm:ss");
        /*System.out.println(ft.format(dNow));*/
          return ft.format(dNow);
    My Extension.xml is as below:
    <?xml version="1.0" encoding="utf-8"?>
    <extension>
      <functions>
        <function name="CurrentTimeStamp" return-type="text">
      <arg name="entered-name" type="text"/>
           <handler platform="java" class="com.oracle.determinations.examples.CurrentTimeStamp"/>
          </function>
      </functions>
    </extension>
    The extension.xml is placed under following path:
    Development/Extension/CurrentTimeStamp/extension.xml
    The JAR file is palced under following path:
    Development/Extension/CurrentTimeStamp/lib/CurrentTimeStamp.jar (the jar file includes the com.oracle.determination.example folder structure)
    When i am using CurrentTimeStamp() in the rule base, it is throwing compile error saying:
    Error after text CurrentTimeStamp(' Fount Text: ')'. Exptected value variable or constant OPA - E00111
    Can you please help me where i am getting wrong and why it is not identifying the function?
    Thanks,
    KK

    Hi,
    I tried using the function with blank arguments like:CurrentTimeStamp("") and it was compiled successfully. When I tried running this rulebase in the tomcat server (web determinations).. i got the below error; Can someone please let me know what is happening here:
    HTTP Status 500 - Servlet.init() for servlet WebDeterminationsServlet threw exception
    type Exception report
    message Servlet.init() for servlet WebDeterminationsServlet threw exception
    description The server encountered an internal error that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Servlet.init() for servlet WebDeterminationsServlet threw exception org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) java.lang.Thread.run(Unknown Source)
    root cause
    java.lang.UnsupportedClassVersionError: Unsupported major.minor version 51.0 java.lang.ClassLoader.defineClass1(Native Method) java.lang.ClassLoader.defineClassCond(Unknown Source) java.lang.ClassLoader.defineClass(Unknown Source) java.lang.ClassLoader.defineClass(Unknown Source) com.oracle.determinations.engine.local.CustomResourceClassLoader.findClass(CustomResourceClassLoader.java:120) java.lang.ClassLoader.loadClass(Unknown Source) java.lang.ClassLoader.loadClass(Unknown Source) java.lang.Class.forName0(Native Method) java.lang.Class.forName(Unknown Source) com.oracle.determinations.util.PlatformClassLoader.newInstance(PlatformClassLoader.java:61) com.oracle.determinations.engine.local.RulebaseLoader.loadCustomFunctions(RulebaseLoader.java:267) com.oracle.determinations.engine.local.RulebaseLoader.loadRulebase(RulebaseLoader.java:178) com.oracle.determinations.interview.engine.InterviewRulebase.<init>(InterviewRulebase.java:137) com.oracle.determinations.interview.engine.local.LocalRulebaseService.applyChangeSet(LocalRulebaseService.java:250) com.oracle.determinations.interview.engine.plugins.rulebaseresolver.ClassloaderRulebaseResolverPlugin.initialise(ClassloaderRulebaseResolverPlugin.java:73) com.oracle.determinations.interview.engine.local.LocalRulebaseService.<init>(LocalRulebaseService.java:53) com.oracle.determinations.interview.engine.local.LocalInterviewEngine.initialise(LocalInterviewEngine.java:181) com.oracle.determinations.interview.engine.local.LocalInterviewEngine.<init>(LocalInterviewEngine.java:66) com.oracle.determinations.interview.engine.InterviewEngineFactory.createInstance(InterviewEngineFactory.java:19) com.oracle.determinations.web.platform.servlet.WebDeterminationsServletContext.init(WebDeterminationsServletContext.java:180) com.oracle.determinations.web.platform.servlet.WebDeterminationsServletContext.<init>(WebDeterminationsServletContext.java:116) com.oracle.determinations.web.platform.servlet.WebDeterminationsServlet.init(WebDeterminationsServlet.java:73) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) java.lang.Thread.run(Unknown Source)
    note The full stack trace of the root cause is available in the Apache Tomcat/7.0.40 logs.

  • Upgrade from 6.40 - 7.10, Analyzer giving compile errors

    We are testing out an upgrade to SAP GUI 7.10 (SP 9, V7100.2.9.1039), BEx (SP7 P1 R1352).
    When running queries in the Analyzer, we get the following error "Compile Error: Can't find project or library" and the VB editor pops up to the following VB code:
    Public Function BEx() As BExApplication
      Set BEx = Application.Run("BExAnalyzer.xla!GetBEx")
    End Function
    I can shut down the debugger and the results are available but the VB windows continually pops up when any modifications are made to the report.
    The following shows up in the trace although I'm not sure if it is related:
    * Trace Started as: 10/10/2008 10:11:17 AM*
    ListSeparator: ,
    ExcelVersion: 11.0
    AddinVersion: 7100.3.701.1352
    BExCheckFrontend.CheckFrontend: No Check performed (20081003) 0
    Errors while executing the 7.0 exit : SAPBEXonRefresh
    -2146788248
    Exception from HRESULT: 0x800A9C68
       at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)
       at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)
       at com.sap.bi.et.analyzer.addin.BExItemGrid.CallExitSAPBEXonrefresh()
    -------------------10/10/2008 10:20:39 AM-------------------
    System.Runtime.InteropServices.COMException (0x800A9C68): Exception from HRESULT: 0x800A9C68
       at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)
       at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)
       at com.sap.bi.et.analyzer.addin.BExConnect.FindLF(Object& iRange, Object& eRange)
    Exception from HRESULT: 0x800A9C68
       at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)
       at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)
       at com.sap.bi.et.analyzer.addin.BExConnect.FindLF(Object& iRange, Object& eRange)
    Any debug ideas or suggestions would be appreciated.
    Thanks

    Hi Adam,
    Can you please check that the following settings are correct in Excel.
          1. Make the following setting in Excel:
              o Tools
              o Macros
              o Security
              o Trusted Sources
              o [x] Trust Access to Visual Basic Visual Basic Projects (CheckBox))
    Also ensure that the default macro security setting is set to "Low".
    Let me know how you go.
    Cheers
    Shaun

  • Adding a Custom Hierarchy field to SPM query giving Server Error

    Hi
    I have enahnced the SPM data model with Organistaion Unit Infobject 0ORGUNIT as part of a
    enhancement requirement for using 0ORGUNIT Hierarchy .
    The field has been added to Bex Query - Spend Analysis Final and also appear in the SPM datasource.
    When I add this 0ORGNUNIT field to the SPM report in SPM UI , I get a server error.
    There isn't anymore information showing up about the error.
    I dont think I missed any step here . I a;lso checked the Analysis administration - Dimension Properties and all looks fine there.
    I can see the new field 0ORGUNIT showing up with Hierarchy selected.
    We are in SPM 3.0 support pack 7.
    Appreciate your quick help in this.
    Thanks
    Rettna Kumar

    Hi,
    Please check whether your key flex structure is frozen or not. If now please freeze it and re compile and try.
    This may helps too
    error while developing KFF in oaf
    Thanks
    Bharat
    Edited by: Bharat on May 10, 2013 4:51 AM

  • FPGA code successfully compiled in 2010 is giving compilation error in 2014.

    I have developed RS485 FPGA code and successfully compiled with LabVIEW FPGA 2010.
    Later changed the software to 2014 and installed Xilinx 14.7.
    Now if I compile the same code with LabVIEW 2014 compile worker, i am getting error 'Process "Synthesis" failed'.
    I am using a case structure with Error cluster as selector, So the case structure has 'No error' and 'Error' cases.
    If I change the selector to 'True/False' then the compilation works.
    Below is the error that i am getting when using Case structure with Error cluster as selector
     LabVIEW FPGA: The compilation failed due to a Xilinx error. Details: ERROR:HDLParsers:1401 - "C:/NIFPGA/jobs/JyWfWcc_Gv3a9ah/NiFpgaAG_00000041_CaseStructureFrame_0001.vhd" Line 41. Object tunnel_s_error_out_2007 of mode OUT cannot be read. ERROR:HDLParsers:1401 - "C:/NIFPGA/jobs/JyWfWcc_Gv3a9ah/NiFpgaAG_00000041_CaseStructureFrame_0001.vhd" Line 42. Object tunnel_s_error_out_2007 of mode OUT cannot be read. --> Total memory usage is 190240 kilobytes Number of errors : 2 ( 0 filtered) Number of warnings: 1 ( 0 filtered) Number of infos : 0 ( 0 filtered)

    Attached FPGA_error_2014.jpg which depicts the working and 'not working' code in 2014.
    In 'Not working' code,the selector terminal is error cluster.
    I am able to resolve the issue just by changing the selecter terminal to boolean as in 'working code'.
     But both sets of software code works fine in version 2010.
    Attachments:
    FPGA_error_2014.jpg ‏128 KB

  • Query giving run time error.

    Hi BW Experts,
    Here goes my question :
    There is a query which is giving runtime error as time limit exceeded. This query is based on an infoset which is based on 4 ODS's.
    Is there any way we can do performance tuning for this query?
    Many Thanks in advance,
    Sudip.

    Hi Ganesh,
    Thanks for your help.
    Can you please tell me which option to select for the infoset query as i'm seeing a lot of options on the left hand side of the screen like master Data, Transaction data, ODS objects,PSA tables etc for the RSRV transaction?
    Also to add-on from my first post...this particular query is executing for an hour after which the error message comes an "System Failue, Time limit exceeded".
    Regards,
    Sudip.

  • Query Compilation Error - Function overloaded

    I'm trying to use 2 document style web services in a query. When I test the query
    I get:
    tart server side stack trace:
    java.rmi.RemoteException: EJB Exception:; nested exception is:
         java.rmi.RemoteException: Query Compilation Error (Type Checks) 1-3-1-3: Function
    Employees1:ProcessDocument() is overloaded.
    java.rmi.RemoteException: Query Compilation Error (Type Checks) 1-3-1-3: Function
    Employees1:ProcessDocument() is overloaded.
         at com.bea.ldi.server.QueryBean.execute(Unknown Source)
         at com.bea.ldi.server.QueryBean_1ao78o_EOImpl.execute(QueryBean_1ao78o_EOImpl.java:306)
         at com.bea.ldi.server.QueryBean_1ao78o_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
         at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:114)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
         at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:821)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
    End server side stack trace
    Can someone tell me what this error means?
    Thank you,
    Jason

    Release Note Entry:
    When designing Workshop web services, you may need to alter the
    Targetnamespace for a web service if a method name in this web service
    clashes with a method name in another web service that uses the same
    Targetnamespace.
    "Mike Reiche" <[email protected]> wrote:
    >
    "A function with the same name has multiple definitions in the configuration.
    Check
    you configuration"
    Check for multiple definitions of Employees1:ProcessDocument() in your
    CFLD file(s).
    - Mike
    "Jason Levine" <[email protected]> wrote:
    I'm trying to use 2 document style web services in a query. When I test
    the query
    I get:
    tart server side stack trace:
    java.rmi.RemoteException: EJB Exception:; nested exception is:
         java.rmi.RemoteException: Query Compilation Error (Type Checks) 1-3-1-3:
    Function
    Employees1:ProcessDocument() is overloaded.
    java.rmi.RemoteException: Query Compilation Error (Type Checks) 1-3-1-3:
    Function
    Employees1:ProcessDocument() is overloaded.
         at com.bea.ldi.server.QueryBean.execute(Unknown Source)
         at com.bea.ldi.server.QueryBean_1ao78o_EOImpl.execute(QueryBean_1ao78o_EOImpl.java:306)
         at com.bea.ldi.server.QueryBean_1ao78o_EOImpl_WLSkel.invoke(Unknown
    Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
         at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:114)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
         at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:821)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
    End server side stack trace
    Can someone tell me what this error means?
    Thank you,
    Jason

  • Flex compilation error after adding an additional output port to a query

    Hello,
    I need to add an additional output port to a query in order to dynamically filter some results. Our version of VC 7.0 (SP16) doesn't support filter components with access to store data.
    Just when we add an extra output port to the query and deploy it we run into a flex compilation error.
    Has somebody come along with that?
    Kind regards
    Stefan

    Hi
    Why exactly you want another output port. With same output port you can drag multiple filters & restrict the output.
    Creation of second output port is not required.
    If first way is not suitable in your case, then you add that query twice (or multiple times) & pass the same input parameters.
    If still it is not serving the purpose then please elaborate your requirement as what dynamic filter you want.
    Regards
    Sandeep

  • Flash Builder stops giving me compile errors or warnings

    Hi,
    I've been using Flex / Flash Builder since Flex2 and I've always had this problem.  At some point in an AS project, my project just breaks down and stops giving me errors.  I then have to get my errors when publishing in the Flash IDE, and of course, I'd rather get them in FB before hand.
    I'd say this happens in 80% of my AS Projects, and the only way to fix it is to delete the project, and start a new one with the same scripts.  Clean does nothing.  Is there a hidden file I can delete when this happens perhaps, something quicker than starting a new project?
    Thanks for any help.
    P.S.  I'm on a MAC

    Hello.
    I found a solution for Flash Builder not compiling SWFs.
    1. Just remove your project from Package Explorer, widthout deleting files of course (right click on project name -> delete)
    2. Close Flash Builder.
    3. Check your process explorer if you have Flash Player running, if so, kill the process (ctrl+alt+del)
    3. Import your project to Package Explorer (right click -> import -> file system)
    4. It should work as intended now.
    If it helps you - I am very glad.
    Don't hesitate to thanks-email me

  • Help with Data Block Based on Procedure--getting compilation error

    I am trying to create a datablock based on a procedure , but im getting errors in compilation:
    Errors are :
    1) identifier 'HSM_WSH_DEL_UTIL.DEL_TBL' must be declared
    2)PL/SQL ERROR 320 at line 7, column 27
    the declaration of the type of this expression is incomplete or malformed
    ANy Help would be appreciated !
    Heres my pkg spec and body for the data block:
    CREATE OR REPLACE PACKAGE hsm_wsh_del_util IS
    TYPE del_record is record
    (delivery_id number);
    TYPE del_tbl is table of del_record INDEX BY BINARY_INTEGER;
    procedure do_query(p_del IN OUT del_tbl);
    END hsm_wsh_del_util ;
    CREATE OR REPLACE PACKAGE BODY hsm_wsh_del_util IS
    procedure do_query(p_del IN OUT del_tbl)
    IS
    idx number :=1;
    CURSOR DELIVERY IS
    SELECT DELIVERY_ID
    FROM abc_deliveries;
    begin
    FOR CUR IN DELIVERY LOOP
    p_del(idx).delivery_id :=cur.delivery_id;
    idx:= idx+1;
    END LOOP;
    end do_query;
    END hsm_wsh_del_util;
    Edited by: 981170 on Mar 13, 2013 1:08 PM

    Hi,
    Yes I did use the wizard,
    I agve it the package.proc name for query.
    it pulled up the field delivery ID,
    Hit finish, because I do not need update/delete/inserts.
    the query data source columns and arguments was defaulted correctly.
    THe QUERY-PROCEDURE was built by default.
    It is giving me an error though: wrong number or types of arguments in call to POPULATE_BLOCK..
    DECLARE
    bk_data HSM_WSH_DEL_UTIL.DEL_TBL;
    BEGIN
    hsm_wsh_del_util.do_query(bk_data);
    PLSQL_TABLE.POPULATE_BLOCK(bk_data, 'NEW_DELIVERIES');
    END;

  • Db link in trigger causes compilation error

    Using Forms 10.1.2.0.2
    Post-Query trigger
    BEGIN
    SELECT item_desc
    INTO :block1.item_desc
    FROM items@database100
    WHERE item_code = :block1.item_code;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    item_code := 'No description for this item';
    END;
    Compilation error
    Error 201: Identifier 'items@database100' must be declared.
    The select statement works in Toad and Sqlplus, but giving me compilation errors in Forms 10g.
    So is this a bug? If yes, is there a patch?
    Can somebody please post a link to a metalink where this problem is discussed/solved?
    Thanks in advance.

    Well, yeah, that had been considered as a work-around.
    However, at this point, the decision is still to use the db link, and we are still trying to figure out how to make it work.
    Edited by: vanilla.villain on May 21, 2009 11:20 AM

  • Compilation errors with store procedure

    Hi guys, I just started SQL so forgive me if I ask any real stupid questions. This is the problem I have right now as said in my title.
    This is my procedure.sql
    CREATE OR REPLACE PROCEDURE verify IS
    no_of_duplicates NUMBER:=0;
    BEGIN
    SELECT COUNT(*) INTO no_of_duplicates
    FROM EMPLOYEE
    WHERE E# =
    (sELECT E# FROM DRIVER
    WHERE EXISTS
    (SELECT E# FROM MECHANIC
    WHERE DRIVER.L# = MECHANIC.L#));
    IF no_of_duplicates:=0 THEN dbms_output.put_line('OK');
    ELSE
    SELECT E#,NAME FROM EMPLOYEE
    WHERE E# =
    (SELECT E# FROM DRIVER
    WHERE EXISTS
    (SELECT E# FROM MECHANIC
    WHERE DRIVER.L# = MECHANIC.L#));
    END IF;
    END verify;
    While trying to create the procedure, it gives me the compilation errors. I have been stuck with this for hours and can't seem to find anything wrong with it. Can anyone point me in the right direction? Thanks!

    Hi,
    Once again, post your code.  The error occurs when you call the procedure, but you haven't posted the code that calls the procedure and causes the error.
    When I do this in SQL*Plus:
    SET  SERVEROUTPUT  ON  FORMAT WRAPPED
    EXEC  verify;
    The procedure you posted runs perfectly (that is, is displays the e# only, exactly as it was designed to do).
    One way to display both the e# and the name is to BULK COLLECT both the e# and name into separate collections, like this:
    CREATE OR REPLACE PROCEDURE verify IS 
        TYPE  e#_table  IS TABLE OF employee.e#%TYPE;
        e#_list    e#_table;
        TYPE  name_table  IS TABLE OF employee.name%TYPE;
        name_list  name_table;
    BEGIN 
        SELECT            e#,       name
        BULK COLLECT INTO e#_list,  name_list
        FROM              employee 
        WHERE   e# IN (
                          SELECT  d.e#
                          FROM    driver    d
                          JOIN    mechanic  m  ON  d.e#  = m.e# 
        IF  e#_list.COUNT  = 0
        THEN
            dbms_output.put_line ('OK, there are no illict duplications');
        ELSE     -- that is, e#_list.COUNT <> 0
            dbms_output.put_line ('The following employees are both drivers and mechanics:');
            FOR j IN 1..e#_list.COUNT LOOP    -- i in parentheses sometimes displays wrong on the OTN site
                dbms_output.put      ( TO_CHAR ( e#_list (j)
                                               , '999999999999'
                dbms_output.put      ('   ');
                dbms_output.put_line (name_list (j)); 
            END LOOP; 
        END IF; 
    END verify; 
    SHOW ERRORS
    Here's the output I get when I run the procedure above with your sample data:
    The following employees are both drivers and mechanics:
                1   John Smith
    You'll notice I made several other changes in your code, sometimes because they are clearly better practices, and sometimes just to show you different ways to do the same thing, which you may or may not want to use in this problem.
    For example, you were doing the same query (with only very slight differences) 2 times: once to get no_of_duplicates, and then a second time to get the actual data.  I don't know if that's the most efficient way to do what you need.  Say there are 1000 rows in the result set.  You'll fetch all 1000 once just to get the total number, (which you don't need, if all you care about at this point is if there are any), and then to get the data.  When you do a BULK COLLECT, you automatically get the COUNT anyway, so why not do the BULK COLLECT first, then use that COUNT to see what you have to do next.  If the COUNT is more than 0, then you've already got the data, and you don't need to fetch it again.  Also, repeating (essentially) the same code is a maintenance problem.  If you ever need to make a change, you need to make the same change in multiple places.  At best, that's a pain; but this is the exactly the kind of mistake that is easy to miss in in testing, and you might have code running for weeks in Production before you notice that sometimes it's giving the wrong results.
    Another example: e# is a NUMBER.  While it is possible to convert NUMBERs into VARCHAR2s, and then store those VARCHAR2s in a VARCHAR2 collecction, wouldn't it make more sense just to store them in a NUMBER collection?

Maybe you are looking for