Simple Create procedure throws compile error

I have a table MyTable with two fields key and value. The table has few records with some number values.
I want to increment this number value and return the updated number value from a procedure.
Below is the procedure that I wrote. When I try to run this, I get this error from the SQLPlus prompt.
Warning: Procedure created with compilation errors.
Here is the procedure.
CREATE OR REPLACE PROCEDURE GetNextValue
     (v_key IN VARCHAR2(25), v_value OUT NUMBER DEFAULT -1) AS
BEGIN
     UPDATE MyTable SET value=value+1 WHERE key=v_key;
     SELECT value INTO v_value FROM MyTable WHERE key=v_key;
END GetNextValue;
I stored this in a .sql file.
Also is there any way that I can write the body in single query to both update the value and return it in the return variable?
Appreciate your help.

Hi,
When creating a PL/SQL procedure, always say SHOW ERRORS on a separate line right after the /. That will geive you more detailed error messages.
In this case, you'll probably get "OUT and IN OUT formal parameters may not have default expressions".
If you want v_value set to -1 in the event that there is no row with key=v_key, then you can say:
CREATE OR REPLACE PROCEDURE GetNextValue
(   v_key    IN   VARCHAR2
,   v_value  OUT  NUMBER
AS
BEGIN
    UPDATE MyTable
        SET value=value+1
        WHERE key=v_key;
    SELECT value
        INTO v_value
        FROM MyTable
        WHERE key=v_key;
EXCEPTION
    WHEN  NO_DATA_FOUND  THEN
        v_value := -1;
    WHEN OTHERS  THEN
        RAISE;
END GetNextValue;
SHOW ERRORS

Similar Messages

  • Help- Components Throwing Compile Errors

    Thank you for reading my issue. I am using Flash CS3.
    Recently, all my projects began throwing compile errors for
    standard component AS3 code.
    UI Component, FLVPlayback.
    I have uninstalled and reinstalled Flash CS3, but to no
    avail. Problem persists
    I keep getting errors involving "QNAN", which I think
    involves trapping for a non-numeric value, or something.
    As a test, I created a new Flash doc, placed an instance of
    FLVPlayback on the stage, pointed it to a .FLV file in the same
    directory.
    Errors on compile:
    1093: Syntax error.
    1084: Syntax error: expecting rightparen before QNAN.
    1093: Syntax error.
    1084: Syntax error: expecting rightparen before QNAN.
    And so on, I get 5 sets of the same errors for different
    functions.
    The first offending function above reads:
    function queueCmd(param1:VideoPlayerState, param2:Number,
    param3:Number = 1.#QNAN) : void
    if (param1.cmdQueue == null)
    param1.cmdQueue = new Array();
    }// end if
    param1.cmdQueue.push(new QueuedCommand(param2, null, false,
    param3));
    return;
    }// end function
    I get similar errors from my UI component AS3 as well.
    I have not touched the shipped AS3 for these components. What
    gives?
    Any ideas?
    Thanks
    Tim

    Thanks, by the way to everyone who has offered thoughts so
    far.
    xchanin - I've encountered issues with the FLVPlayback
    component as well as various of the UI components.
    I tried some example applications (from the web) not too long
    ago and this issue popped up shortly there after.
    But, I'm having issues with even a simple Flash with a single
    FLVPlayback instance and one .flv.
    There is nothing in the class path for my test file and the
    root .as files open from the Flash install when I click the compile
    errors in the output window.
    So, it really looks like I somehow corrupted those files. I
    read a post somewhere that someone had "strange invisible
    characters" show up in their .as that were throwing errors.
    I thought a clean install would do the trick.
    I may completely isolate the example files I was using and
    try another reinstall... that's about all I can think of at the
    moment.
    This has been a couple week search for a solution. I have a
    real project coming up an need to solve this.
    Thanks for any input! (I assume I can't call Adobe for an
    assist as I'm still on CS3 ;)
    Tim

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

  • Create view throwing an error

    Hello guys, I am trying to create a view from the result set of a sql query. The sql when run independently works fine, but when I try to create a view on it it throws an error saying that the table does not exist. below is the create view I am using.
    create view ops$oracle.pci_view as SELECT
         (select name from v$database@dwdev) database_name,
          (select host_name from v$instance) host_name,
          (select version from v$instance) dbversion,
           o.owner,
           o.object_name table_name,
           o.CREATED table_created,
           o.last_ddl_time table_last_ddl_time,
           t.tablespace_name,
           t.last_analyzed,
           t.partitioned,
           t.num_rows,
           T.COMPRESSION,
           t.compress_for,
           t.read_only,
           tb.status tablespace_status,
           tb.encrypted tablespace_encrypted,
           tb.compress_for tablespace_compress,
           tb.contents,
           TC.COLUMN_NAME,
           tc.data_type,
           TC.DATA_LENGTH,
           tc.data_precision,
           tc.data_scale,
           tc.nullable,
           tc.column_id,
           tc.num_distinct,
           tc.avg_col_len,
           tc.density,
           tc.num_nulls,
           tc.low_value,
           tc.high_value,
           tc.last_analyzed col_last_analyzed,
           ec.encryption_alg,
           ec.salt,
           ec.integrity_alg,
           (SELECT tcm.comments
              FROM dba_tab_comments tcm
             WHERE tcm.owner = T.OWNER AND tcm.table_name = t.table_name)
              table_comments,
           (SELECT ccm.comments column_comments
              FROM dba_col_comments ccm
             WHERE     ccm.owner = TC.OWNER
                   AND ccm.table_name = tc.table_name
                   AND ccm.column_name = tc.column_name)
              column_comments
      FROM dba_objects o,
           dba_tables T,
           dba_tablespaces tb,
              dba_tab_columns tc  
            LEFT JOIN
              dba_encrypted_columns ec      ***********************************************
           ON     ec.owner = TC.OWNER
              AND ec.table_name = tc.table_name
              AND ec.column_name = tc.column_name
    WHERE o.owner NOT IN
              ('APPQOSSYS',
               'DBSNMP',
               'EXFSYS',
               'GGAPP',
               'OPS$ORACLE',
               'ORACLE_OCM',
               'OUTLN',
               'SYS',
               'SYSTEM',
               'WMSYS',
               'XDB')
           AND o.object_type = 'TABLE'
           AND NOT EXISTS
                      (SELECT 1
                         FROM dba_mviews mv
                        WHERE mv.owner = o.owner
                              AND mv.container_name = o.object_name)
           AND t.owner = o.owner
           AND t.table_name = o.object_name
           AND tb.tablespace_name = t.tablespace_name
           AND tc.owner = o.owner
           AND tc.table_name = o.object_name
           AND tc.owner = t.owner
           AND tc.table_name = t.table_name
           AND tc.data_length > 15
           AND tc.data_type NOT LIKE ('TIMESTAMP%')
           AND (tc.data_precision IS NULL OR tc.data_precision > 15);(The line containing the string of astrixes, that is the table that the error says does not exist)
    can someone help me where I am going wrong.
    Thanks

    969224 wrote:
    what if I create the view in SYS for few minutes until i can complete the task i was assigned and after that drop the view I created in SYS schema, would that have any effect on the database?Uh, yeah .. SYS isn't any better an option than SYSTEM.
    Those schemas are "off limits" to us ... ignore them .. pretend they do not exist. (seriously ..)
    Sounds like you need a new schema to store your application objects.

  • InstanceCount throwing compile error

    Hi
    We are tryiing to use a simple example of 'InstanceCount' and 'InstanceCountIf' in OPM.
    We have a entity called 'the citizen' under 'global', and a child entity 'the child' under 'the citizen' entity.
    We have named the relationship between 'the citizen' and 'the child' as 'the children'
    We have written the following rules :
    1.the number of children for the citizen = InstanceCount (the children)
    2.the number of included children for the citizen = InstanceCountIf (the children, the child is included in plan)
    There is a separate rule which derives the value of the Boolean variable 'the child is included in plan', and that rule has compiled successfully.
    On compiling the rules 1 or 2, we get the following compile error :
    Expected: Unable to find a relationship belonging to the entity 'the citizen'
    Please advise how to overcome above compile error.
    Thanks
    Swati

    Hi,
    I have a similar problem and would be very glad if anyone could help me.
    My design is as follows, using OPM 10.3.1:
    global (level 1)
    has 0...many Households (level 2)
    have 0...many Residents (level 3)
    What I would like to do is to get the sum of all Salaries of female residents.
    If I try to use all_male_salary = InstanceSumIf(Household's Residents, resident_salary, resident_gender="Female") the following error occurs while compiling: "unable to find a relationship belonging to the entity 'global'".
    The same applies to InstanceCountIf.
    How would it be possible to get level 3 data on level 1 and store the sum/count in a lvl 1 attribute? (with lvl 2 all works fine).
    Many thanks!

  • GW link on VO throws compile error after SP5

    How can we get GW7 WebAccess link in VO to work properly with NW65 but
    after applying SP5.
    Throws a compile error message while directly launching the right URL
    http://servername/gw/webacc
    works well.
    Any suggestions pls
    Best Regards

    Vasanth,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Do a search of our knowledgebase at http://support.novell.com/search/kb_index.jsp
    - Check all of the other support tools and options available at
    http://support.novell.com.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://support.novell.com/forums)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://support.novell.com/forums/faq_general.html
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • Deploying CMP entity bean throws compilation error.

    Jdeveloper build works fine but the server deployment ( embedded) fails. I linked tools.jar to j2ee home dir, same version as jdev uses. Session beans deploy OK.
    The table corr to the entity bean has a primary key and the entity bean was created by dragging-dropping table onto UML diagram.
    error is >>>cmp-field of type 'java.lang.Long' does not have a no-arg constructor which is needed for properties/fields based mapping<<<, message details follow after dashed line.
    Platform details - Jdeveloper 9.0.3 on mdk 9.0, JDK 1.4.1 ( JDK 1.3.1 also does the same).
    [Starting OC4J using the following ports: HTTP=8988, RMI=23891, JMS=9227.]
    /usr/java/j2sdk1.4.1/bin/java -hotspot -classpath /var/jdeveloper/j2ee/home/oc4j.jar -Xverify:none -Doracle.j2ee.dont.use.memory.archive=true -Xrs com.evermind.server.OC4JServer -config /home/demo/jdevhome/system9.0.3.1035/oc4j-config/server.xml
    [waiting for the server to complete its initialization...]
    Embedded OC4J startup time: 9611 ms.
    Copying default deployment descriptor from archive at /home/demo/jdevhome/mywork/MyHRApplication/EJB-Tier/classes/META-INF/orion-ejb-jar.xml to deployment directory /home/demo/jdevhome/system9.0.3.1035/oc4j-config/application-deployments/current-workspace-app/classes...
    Auto-deploying file:/home/demo/jdevhome/mywork/MyHRApplication/EJB-Tier/classes/ (No previous deployment found)... Error compiling /home/demo/jdevhome/mywork/MyHRApplication/EJB-Tier/classes: cmp-field of type 'java.lang.Long' does not have a no-arg constructor which is needed for properties/fields based mapping
    Oracle9iAS (9.0.3.0.0) Containers for J2EE initialized

    Please note that the data-source has been re-architectured in 10.1.3 DP3 and you should have DataSource as follows:
    <data-sources xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://xmlns.oracle.com/oracleas/schema/data-sources-10_1.xsd' schema-major-version='10' schema-minor-version='1'>
    <managed-data-source connection-pool-name='Example Connection Pool' jndi-name='jdbc/OracleDS' name='OracleManagedDS' />
    <connection-pool name='Example Connection Pool' >
    <connection-factory factory-class='oracle.jdbc.pool.OracleDataSource' user='scott' password='tiger' url='jdbc:oracle:thin:@localhost:1521:orcl'>
    </connection-factory>
    </connection-pool>
    </data-sources>

  • Creating CreditNote throw  Internal error -5002

    Hi experts,
    I have a problem creating CreditNote via DI.
    thorw error: "Returncode: -5002:: Se produjo un error interno (-5002)"  (internal error)
    Anybody could help me? Its extrange this error because the same code had work fine times ago
    My code is:
    oAbono.CardCode = oDev.CardCode
                        oAbono.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Items
                        oAbono.DocObjectCode = SAPbobsCOM.BoObjectTypes.oInvoices
                        oAbono.DocumentSubType = SAPbobsCOM.BoDocumentSubType.bod_None
                        oAbono.DocDate = oDev.DocDate
                        oAbono.SalesPersonCode = oDev.SalesPersonCode
                        'amm 20081014 forzar % a cero oAbono.DiscountPercent = oDev.DiscountPercent
                        oAbono.Comments = "Viene del albarán: " + oDev.DocNum.ToString
                        oAbono.UserFields.Fields.Item("U_FGIMAR").Value = oDev.UserFields.Fields.Item("U_FGIMAR").Value
                        oAbono.UserFields.Fields.Item("U_FGIDEMAR").Value = oDev.UserFields.Fields.Item("U_FGIDEMAR").Value
                        oAbono.UserFields.Fields.Item("U_FGIName2").Value = oDev.UserFields.Fields.Item("U_FGIName2").Value
                        strProducto = "Select [U_FGIVIAB] as Via, [U_FGICONB] as Cond from [@FGIPAR]"
                        orecordset.DoQuery(strProducto)
                        oAbono.PaymentMethod = orecordset.Fields.Item("Via").Value
                        oAbono.PaymentGroupCode = orecordset.Fields.Item("Cond").Value
                        oAbono.HandWritten = SAPbobsCOM.BoYesNoEnum.tNO
                        'Linea de factura
                        oAbono.Lines.SetCurrentLine(0)
                        strProducto = "Select [U_FGIPRD] as Prod, [U_FGIPRD1] as Prod1,[U_FGIPRD2] as Prod2, [U_FGIPRD3] as Prod3 from [@FGIPAR]"
                        orecordset.DoQuery(strProducto)
                        If oDev.UserFields.Fields.Item("U_FGIMAR").Value = "101" Then
                            oAbono.Lines.ItemCode = orecordset.Fields.Item("Prod").Value.ToString
                        End If
                        If oDev.UserFields.Fields.Item("U_FGIMAR").Value = "103" Then
                            oAbono.Lines.ItemCode = orecordset.Fields.Item("Prod1").Value.ToString
                        End If
                        If oDev.UserFields.Fields.Item("U_FGIMAR").Value = "104" Then
                            oAbono.Lines.ItemCode = orecordset.Fields.Item("Prod2").Value.ToString
                        End If
                        If oDev.UserFields.Fields.Item("U_FGIMAR").Value = "102" Then
                            oAbono.Lines.ItemCode = orecordset.Fields.Item("Prod3").Value.ToString
                        End If
                        strIva = "Select [U_FGIIVAR] as Iva from [@FGIPAR]"
                        orecordset.DoQuery(strIva)
                        oAbono.Lines.VatGroup = orecordset.Fields.Item("Iva").Value.ToString
                        ' Para los albaranes  tomamos el total del albarán.
                        oAbono.Lines.Quantity = 1
                        Dim precio As Double
                        precio = (oDev.DocTotal - oDev.VatSum)
                        Dim neto As Double
                        neto = precio
                        oAbono.Lines.Price = CDbl(neto)
                        lRetCode = oAbono.Add()
                        If lRetCode <> 0 Then
                            vCompany.GetLastError(lErrCode, sErrMsg)
                            GuardarLog("InsertarOfertaEspecialAbono: Failedu2026; Returncode: " + CStr(lErrCode) + ":: " + sErrMsg)
                            Return False
                        End If

    Solved problem!.
    The Origin of then problem is a PaymentMethod.
    My AddOn set PaymentMethod ='C' and this paymentMethod is not set in BP Card.
    I hope this trhead would be useful for the future for another person
    Regards

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

  • Compilation error warning

    Could someone please let me know that if it is a problem for querying database when there is compilation error warning?
    I've often received warning errors after creating a type, such as :" Type created with compilation error".
    Thanking in advance for your response.

    994819 wrote:
    I tried to get the following stored procedure to work... I've tried two different versions of the procedure... I have both versions below. I get a warning that the procedure was created but with compilation errors... this happens in Oracle 11g Express Edition... it references a function that I already created and has been tested.
    Version 1:
    create or replace procedure ins_ints(v1 number)
    as begin
    for i in 1..v1 loop
    insert into integers values(i,odd_even(i));
    end loop;
    end ins_ints;
    Version 2:
    create or replace procedure ins_ints(v1 in number)
    as begin
    for i in 1..v1 loop
    insert into integers values(i,odd_even(i));
    end loop;
    end ins_ints;
    Any idea whats wrong?
    Note: The odd_even function has the following function call:
    odd_even(v1 number) return varchar2
    again, just calling the funciton from the command line (SQL *Plus) works.
    Thanks!SHOW ERROR
    will display what the compiler does not like about your code
    How do I ask a question on the forums?
    SQL and PL/SQL FAQ

  • Compile error during Flex Deployment of a Webservice

    Hello,
    We are using the Visual Composer (7.0 SP9) to display the data from a home made Web Service. This is the complete display of a simple table without input.
    We tested the Web Service with the "Test Dat Service" option and within the Web Service Navigator of the J2EE Engine. This all worked fine.
    When we try to deploy the application with Flash/Flex it fails, but when we try to deploy it with WebDynpro, the table is displayed correctly.
    The following error is created during the compilation:
    Error in compiling Flex application: Error 1049: Expected a field name after '.' operator.
          (E:\usr\sap\DP6\JC00\j2ee\cluster\server0\GUIMachine_Business_Packages\Prodin_Taken_2_8620\FLEX_COMPILATION_FOLEDR\AAD25B.mxml:300)
    Error 1205: The statement '' is incomplete.
          (E:\usr\sap\DP6\JC00\j2ee\cluster\server0\GUIMachine_Business_Packages\Prodin_Taken_2_8620\FLEX_COMPILATION_FOLEDR\AAD25B.mxml:300)
    Error 1099: This statement is not permitted in a class definition.
          (E:\usr\sap\DP6\JC00\j2ee\cluster\server0\GUIMachine_Business_Packages\Prodin_Taken_2_8620\FLEX_COMPILATION_FOLEDR\AAD25B.mxml:302)
    Error 1099: This statement is not permitted in a class definition.
          (E:\usr\sap\DP6\JC00\j2ee\cluster\server0\GUIMachine_Business_Packages\Prodin_Taken_2_8620\FLEX_COMPILATION_FOLEDR\AAD25B.mxml:303)
    Error 1099: This statement is not permitted in a class definition.
          (E:\usr\sap\DP6\JC00\j2ee\cluster\server0\GUIMachine_Business_Packages\Prodin_Taken_2_8620\FLEX_COMPILATION_FOLEDR\AAD25B.mxml:304)
    Error 1099: This statement is not permitted in a class definition.
          (E:\usr\sap\DP6\JC00\j2ee\cluster\server0\GUIMachine_Business_Packages\Prodin_Taken_2_8620\FLEX_COMPILATION_FOLEDR\AAD25B.mxml:305)
    Error 1099: This statement is not permitted in a class definition.
          (E:\usr\sap\DP6\JC00\j2ee\cluster\server0\GUIMachine_Business_Packages\Prodin_Taken_2_8620\FLEX_COMPILATION_FOLEDR\AAD25B.mxml:307)
    Error 1128: Attribute used outside class.
          (E:\usr\sap\DP6\JC00\j2ee\cluster\server0\GUIMachine_Business_Packages\Prodin_Taken_2_8620\FLEX_COMPILATION_FOLEDR\AAD25B.mxml:310)
    Error 1128: Attribute used outside class.
          (E:\usr\sap\DP6\JC00\j2ee\cluster\server0\GUIMachine_Business_Packages\Prodin_Taken_2_8620\FLEX_COMPILATION_FOLEDR\AAD25B.mxml:337)
    Error 1049: Expected a field name after '.' operator.
          (E:\usr\sap\DP6\JC00\j2ee\cluster\server0\GUIMachine_Business_Packages\Prodin_Taken_2_8620\FLEX_COMPILATION_FOLEDR\AAD25B.mxml:355)
    Error 1205: The statement '' is incomplete.
          (E:\usr\sap\DP6\JC00\j2ee\cluster\server0\GUIMachine_Business_Packages\Prodin_Taken_2_8620\FLEX_COMPILATION_FOLEDR\AAD25B.mxml:355)
    Error 1140: ActionScript 2.0 class scripts may only define class or interface constructs.
          (E:\usr\sap\DP6\JC00\j2ee\cluster\server0\GUIMachine_Business_Packages\Prodin_Taken_2_8620\FLEX_COMPILATION_FOLEDR\AAD25B.mxml:337)
    Error 1128: Attribute used outside class.
          (E:\usr\sap\DP6\JC00\j2ee\cluster\server0\GUIMachine_Business_Packages\Prodin_Taken_2_8620\FLEX_COMPILATION_FOLEDR\AAD25B.mxml:376)
    Error 1128: Attribute used outside class.
          (E:\usr\sap\DP6\JC00\j2ee\cluster\server0\GUIMachine_Business_Packages\Prodin_Taken_2_8620\FLEX_COMPILATION_FOLEDR\AAD25B.mxml:394)
    Error 1128: Attribute used outside class.
          (E:\usr\sap\DP6\JC00\j2ee\cluster\server0\GUIMachine_Business_Packages\Prodin_Taken_2_8620\FLEX_COMPILATION_FOLEDR\AAD25B.mxml:408)
    Error 1029: Unexpected '}' encountered
          (E:\usr\sap\DP6\JC00\j2ee\cluster\server0\GUIMachine_Business_Packages\Prodin_Taken_2_8620\FLEX_COMPILATION_FOLEDR\AAD25B.mxml:417)
    Failed to compile AAD25B.mxml
    Does anybody know what the problem could be?
    Thanks in advance,
    Edwin Oldenburg

    Hi Edwin,
    have you access to the AAD25B.mxml file and take a look at the lines where the errors occurs?
    Maybe you get further particulars about the errors.
    But I think, this is an error in VC, but I'm not sure.
    Best Regards,
    Marcel

  • Application name allows spaces == compiler errors.

    Hi,
    Love the idea of the LaunchPad. Great way to see working code examples for all the top mobile APIs. I noticed when I created my application the Application name allowed spaces in the name. Once I imported the app into Flash Builder 4 Burrito, it threw a number of errors due to a space in the class name(s). It took a while to find all of the places where the spaces needed to be removed.
    I think it would great to have LaunchPad allow spaces in the name, but then know when to replace the spaces with underscores _ for the package and class names. This way we can keep the application name with spaces for things like the app name listed on the device, but then ensure that there are no spaces where it will throw compilation errors.
    Thanks,
    iBrent

    Thanks for the feedback Brent! I see what you're reporting, thanks for letting me know. I recently changed the way that works to use the app name for all the file names, previously it was created with the name Main.mxml so that was not an issue. I'll consider replacing the spaces with underscores as you suggested. Thanks much! Holly

  • Error "Compile error: Invalid character" after copy paste operations in VBE 6.5 PowerPoint 2011

    This is a weird problem with the VBE 6.5 in Office 2011, running natively on a Mac.
    Sometimes, yet often, when I select a word by double clicking on it or a line by highlighting that line in the editor and then copy/paste it somewhere else in the code, the compiler throws the error "Compile error: Invalid character"
    The thing is, what I see has been pasted is exactly the same as the source text. However, if I then paste the same clipboard item to a text editor, I can see that there is an 'invisible' character at the end of the string which is counted in the text editor
    where the cursor is shifted past it but does not shown on the screen!!!
    Back in the VBE, if I select a line that is dubious and drag it, the semi transparent dragged text has a '>' character on a new line.
    In some copy/paste cases, the compiler doesn't see an error but the code doesn't work as expected and I have spent hours debugging stuff that has invisible characters in it (the hardest debugging I've ever had to do!).
    I'm not sure if this example will paste correctly into the forum but this looks like 19 characters but is in fact 20 as there is the offending copy/paste invisible character between 'Test' and '.'
    <code>Test.Value = False</code>
    This seems to be a major oversight in the code of the VBE 6.5 so are Microsoft aware of this and when is it due to be fixed?
    Jamie.

    I had this exact issue.  This is a terrible bug.  The code looks perfect, but there are hidden characters that throw compiler errors.  Thanks for the quick fix, Microsoft.

  • Flash limitations, Invisible Compiler Errors, swc files...

    This question is for expert users of Flash CS4/CS5 and actionscript.   Please do not comment or offer suggestions if you have no experience  with these errors or their causes.
    ===================================================
    Question:
    =======
    Publishing  an extremely complex file can sometimes result in a blank swf being  created, and no compiler errors being shown even though some may exist.   Are there any suggested methods for dealing with this?
    =======
    Details:
    =======
    Those who have written flash files with large actionscript components  will be familiar with needing to set the JAVA_TOOL_OPTIONS evinronment  variable in order to prevent the Flash compiler from crashing due to  memory limits.  The majority of the files in question require this as a  bare minimum in order to be compiled at all.
    The project in question involves several main "launcher" components,  in addition to hundreds of "modules".  The modules themselves are being  developed in a distributed manner by several programmers.  Each module  can be executed as a standalone swf, for testing and production  purposes.  Each module has a companion swc file which holds its assets  and exports them.  All of the modules make use of a shared custom code  library that sits on top of actionscript.
    The launcher program also uses the shared library code, and runs the  modules  (never more than one at a time, and clearing previously loaded ones  before loading a new one) inside of itself.  The launcher contains a  reference file(the class names typed in an include file, referencing all  of the available exported assets from the swcs) that makes all the  necessary assets available to the modules, such that any module can be  run at any time.
    ===========
    The Error:
    ===========
    Seemingly random in occurence, every now and then a file will  "compile blank".  Essentially, the compile time is very short, the swf  pops up as a blank white box, and there is absolutely nothing listed in  the "Compiler Errors" tab, nor in the output tab.  Sometimes closing  flash and relaunching it will bring the Compiler Error messages back,  though usually not.  More often opening the file on another computer in a  different copy of flash and compiling it again will show the errors.   The original computer will still not show anything, but the other  computer can be used to fix the error, and then the file will start  reporting errors again properly.
    However, sometimes, the file will "compile blank" on all computers,  and all copies of flash.  Then the only resort to find the hidden errors  and fix them, is to comment out the entire file, and slowly uncomment  out sections one at a time.  In this manner, the area where the hidden  errors are occuring can be determined, and the error found manually.
    Obviously this is an extremely frustrating situation, but one that can be "worked around".
    However, there are two more serious incarnations of this which cannot be as easily side stepped.
    1.) Sometimes certain computers/copies of flash will "compile blank" a  file that doesnt actually have errors in it.  The same file will  compile and work perfectly on one machine, and not on another.
    2.) The most severe of all...The two more complex components compile fine in cs4, but always "compile blank"  on cs5, no matter what.  The module files all compile much faster on  cs5 and work great.  However, the shared code library and the launcher  program cannot be compiled in cs5, though they compile fine in cs4.   Both compile blank every single time on cs5, with no errors reported.
    --Just as a side note here are the compile times on two different  types of computers, for cs4 and cs5, for the three types of compiled  files:
    =====================
    CS4 Compile time averages:
    =====================
    Dual Core - Pentium 4:
            Module File = 1-4 minutes
            Shared Code Library = 10+ minutes
            Launcher Program = Unusable
    6 Core AMD w 16 GBs of RAM:
             Module File = less than 10 seconds
             Shared Code Library = approx. 1 minute
             Launcher Program = 15-25 minutes
    =====================
    CS5 Compile time averages:
    =====================
    Dual Core - Pentium 4:
            Module File = less than 20 seconds
            Shared Code Library = 2-4 minutes
            Launcher Program = Compiles blank
    6 Core AMD w 16 GBs of RAM:
             Module File = less than 10 seconds
             Shared Code Library = less than 30 seconds
             Launcher Program = Compiles blank
    ========================================
    Summary:
    ========================================
    1.) Large and complex files in cs4 or cs5 can sometimes false compile, showing a blank swf, and no errors.
    2.) Large interlinked projects containing many swcs that can compile on cs4 always compile blank on cs5
    The issues involved "appear" to deal with interlinked swcs and swfs, memory, and compiler messages.
    The best solution i can think of would be some sort of verbose mode  setting, where the cs4/cs5 compilers can be set to trace all the actions  they are taking, either to a log file, or to the screen.  Rather than  simply giving a summary of the results, a real-time display of what is  occuring might lead to the actual bugs/issues.
    Eisley79

    For the future people who come searching this forum and find my thread.
    http://kb2.adobe.com/cps/405/kb405257.html
    Above is a link to adobe's official version of admitting this situation exists(and its true for cs5 as well).
    If you are reading this, and simply have a single large file that won't compile.  Attempt their solutions suggested.  Also, click the link in the comments by the user refering to a blog that helped him.
    That will explain the JAVA_TOOL_OPTIONS memory issue (which you can find many explanations on google as well).
    If however, you are working with a large number of separate swf's that load each other, and share assets and are getting the REAL problem, neither adobe's solutions, nor the JAVA_TOOL_OPTIONS will correct the problem for you.  My best suggestion to you is, have one SWF launch the next one, and break your project into pieces.  Whatever the parent SWF needed to have, can be either copied into all the children SWFs, or into several "brother" SWFs which share the loaded children SWFs, (and can actually be successfully compiled).  Then as you move from brother to brother, they can be made to appear as if they were actually ONE file, loading the children, instead of several launching each other, and sharing the loading duties.
    and as far as adobe is concerned, if i told you what i thought of you, i would get this post deleted...and myself banned.
    Anyone considering doing Enterprise level projects in Flash, DONT.  I wanted to use JAVA, but my company went with flash.  I am stuck working around it constantly, and would have been better off coding foundation classes to mimic whatever functionality we needed from flash into java.
    Maybe when actionscript 4 comes along, it will magically bring with it true object oriented programming, and Adobe will spend the time and money to make a real working compiler.  Somehow i doubt it.

  • Warning: Procedure created with compilation errors.

    I am trying to upload a pdf file into a blob column of a table. I get this error with these three ways of doing that:Warning: Procedure created with compilation errors.
    Any ideas why?
    -- THE STORAGE TABLE FOR THE IMAGE FILE
    ALTER TABLE PDM
    DROP PRIMARY KEY CASCADE;
    DROP TABLE PDM CASCADE CONSTRAINTS;
    CREATE TABLE PDM (
    DNAME VARCHAR2(30), -- DIRECTORY NAME
    SNAME VARCHAR2(30), -- SUBDIRECTORY NAME
    FNAME VARCHAR2(30), -- FILE NAME
    IBLOB BLOB); -- IMAGE FILE
    -- CREATE THE PROCEDURE TO LOAD THE FILE
    CREATE OR REPLACE PROCEDURE LOAD_FILE (
    PDNAME VARCHAR2,
    PSNAME VARCHAR2,
    PFNAME VARCHAR2) IS
    SRC_FILE BFILE;
    DST_FILE BLOB;
    LGH_FILE BINARY_INTEGER;
    BEGIN
    SRC_FILE := BFILENAME('PDF_DIR', '266-5210.pdf');
    -- INSERT A NULL RECORD TO LOCK
    INSERT INTO PDM
    (DNAME, SNAME, FNAME, IBLOB)
    VALUES
    (PDNAME, PSNAME, PFNAME, EMPTY_BLOB())
    RETURNING IBLOB INTO DST_FILE;
    -- LOCK RECORD
    SELECT IBLOB
    INTO DST_FILE
    FROM PDM
    WHERE DNAME = PDNAME
    AND SNAME = PSNAME
    AND FNAME = PFNAME
    FOR UPDATE;
    -- OPEN THE FILE
    DBMS_LOB.FILEOPEN(SRC_FILE, DBMS_LOB.FILE_READONLY);
    DBMS_LOB.OPEN(DST_FILE, DBMS_LOB.LOB_READWRITE);
    -- DETERMINE LENGTH
    LGH_FILE := DBMS_LOB.GETLENGTH(SRC_FILE);
    -- READ THE FILE
    DBMS_LOB.LOADFROMFILE(DST_FILE, SRC_FILE, LGH_FILE);
    -- UPDATE THE BLOB FIELD
    UPDATE PDM
    SET IBLOB = DST_FILE
    WHERE DNAME = PDNAME
    AND SNAME = PSNAME
    AND FNAME = PFNAME;
    -- CLOSE FILE
    DBMS_LOB.FILECLOSE(SRC_FILE);
    END LOAD_FILE;
    -- THE STORAGE TABLE FOR THE IMAGE FILE
    ALTER TABLE PDM
    DROP PRIMARY KEY CASCADE;
    DROP TABLE PDM CASCADE CONSTRAINTS;
    CREATE TABLE PDM
    FNAME VARCHAR2(1000)
    ,IBLOB BLOB
    -- CREATE THE PROCEDURE TO LOAD THE FILE
    CREATE OR REPLACE PROCEDURE LOAD_FILE AS (
    SRC_FILE BFILE := BFILENAME('PDF_DIR', '262-2827.pdf');
    DST_FILE BLOB;
    BEGIN
    -- INSERT A NULL RECORD TO LOCK
    INSERT INTO PDM
    (FNAME, IBLOB)
    VALUES
    ('262-2827.pdf', EMPTY_BLOB())
    RETURNING IBLOB INTO DST_FILE;
    -- OPEN THE FILE
    DBMS_LOB.FILEOPEN(SRC_FILE, DBMS_LOB.FILE_READONLY);
    DBMS_LOB.OPEN(DST_FILE, DBMS_LOB.LOB_READWRITE);
    -- READ THE FILE
    DBMS_LOB.LOADFROMFILE( SRC_FILE, DST_FILE);
    -- UPDATE THE BLOB FIELD
    UPDATE PDM
    SET FNAME = SRC_FILE,
    IBLOB = DST_FILE;
    -- CLOSE FILE
    DBMS_LOB.CLOSE(DST_FILE);
    DBMS_LOB.FILECLOSE(SRC_FILE);
    COMMIT;
    END LOAD_FILE;
    ALTER TABLE IMAGE_TABLE
    DROP PRIMARY KEY CASCADE;
    DROP TABLE IMAGE_TABLE CASCADE CONSTRAINTS;
    CREATE TABLE IMAGE_TABLE (
    ID NUMBER PRIMARY KEY,
    IMAGE ORDSYS.ORDIMAGE);
    CREATE OR REPLACE DIRECTORY IMAGEDIR AS 'C:\cards\';
    GRANT READ ON DIRECTORY IMAGEDIR TO PUBLIC;
    GRANT READ ON DIRECTORY MY_FILES TO twilliam;
    GRANT READ ON DIRECTORY MY_FILES TO tmwillia;
    CREATE OR REPLACE PROCEDURE IMAGE_IMPORT(DEST_ID NUMBER,
    FILENAME VARCHAR2)
    IS
    IMG ORDSYS.ORDIMAGE;
    CTX RAW(64) := NULL;
    BEGIN
    DELETE FROM IMAGE_TABLE
    WHERE ID = DEST_ID;
    INSERT INTO IMAGE_TABLE (ID, IMAGE)
    VALUES (DEST_ID, ORDSYS.ORDIMAGE.INIT())
    RETURNING IMAGE INTO IMG;
    IMG.IMPORTFROM(CTX, 'FILE', 'IMAGEDIR', FILENAME);
    UPDATE IMAGE_TABLE SET IMAGE=IMG WHERE ID=DEST_ID;
    END
    CALL IMAGE_IMPORT(7142,'125-0502.pdf');
    CALL IMAGE_IMPORT(7143,'125-0503.pdf');
    SELECT ID,
    T.IMAGE.GETHEIGHT(),
    T.IMAGE.GETWIDTH()
    FROM IMAGE_TABLE T;
    SELECT ID,
    T.IMAGE.GETFILEFORMAT(),
    T.IMAGE.GETCOMPRESSIONFORMAT()
    FROM IMAGE_TABLE T;
    SELECT ID,
    T.IMAGE.GETCONTENTFORMAT(),
    T.IMAGE.GETCONTENTLENGTH()
    FROM IMAGE_TABLE T;

    In the second load_file procedure you should probably change the update command
    -- UPDATE THE BLOB FIELD
    UPDATE PDM
    SET FNAME = SRC_FILE,
    IBLOB = DST_FILE;into this
    -- UPDATE THE BLOB FIELD
    UPDATE PDM
    SET IBLOB = DST_FILE
    WHERE  FNAME = '262-2827.pdf';but I'm not sure how to explain the eof error message. Usually this happens when you forget an "END;" or "END LOOP;" command.
    Ok I rechecked and the declaration of the second procedure seems wrong
    -- CREATE THE PROCEDURE TO LOAD THE FILE
    CREATE OR REPLACE PROCEDURE LOAD_FILE AS (
    SRC_FILE BFILE := BFILENAME('PDF_DIR', '262-2827.pdf');
    DST_FILE BLOB;
    BEGINshould be rewritten as
    -- CREATE THE PROCEDURE TO LOAD THE FILE
    CREATE OR REPLACE PROCEDURE LOAD_FILE
      AS
      SRC_FILE BFILE := BFILENAME('PDF_DIR', '262-2827.pdf');
      DST_FILE BLOB;
    BEGIN
    ...I removed one parenthesis which was not closed.
    And for the image_import procedure there is a semikolon missing after the final END.
    END*;*
    Edited by: Sven W. on Nov 24, 2008 5:54 PM.
    Edited by: Sven W. on Nov 24, 2008 5:56 PM
    Edited by: Sven W. on Nov 24, 2008 5:59 PM

Maybe you are looking for