PL/SQL Procedure Compilation error

Hi,
<br><br>
I have wrote a PL/SQL Stored Procedure to read a couple of table values and then output some data to a file, when I create the procedure on the database I get the following compilation error:
<br><br>
LINE/COL ERROR<br>
-------- -----------------------------------------------------------------<br>
25/7 PLS-00103: Encountered the symbol ")" when expecting one of the<br>
following:<br>
( - + case mod new null <an identifier><br>
<a double-quoted delimited-identifier> <a bind variable> avg<br>
count current max min prior sql stddev sum variance execute<br>
forall merge time timestamp interval date<br>
<a string literal with character set specification>
<a number> <a single-quoted SQL string> pipe<br>
The symbol "null" was substituted for ")" to continue.<br>
<br>
The script is below: <br><br>
CREATE OR REPLACE <br>
     PROCEDURE TDF_EXTRACT AS<br>
v_file UTL_FILE.FILE_TYPE;<br>
YEAR number(4);<br>
Q1_VALUE NUMBER(7);<br><br>
BEGIN<br><br>
SELECT PERSON_VALUE<br>
INTO     Q1_VALUE<br>
FROM PERSON<br>
WHERE ID = 79;<br><br>
SELECT EXTRACT(YEAR FROM SYSDATE)<br>
INTO YEAR <br>
FROM DUAL;<br><br>
v_file := UTL_FILE.FOPEN(location => '/tmp',<br>
filename => 'extratced_values.txt',<br>
open_mode => 'W',<br>
max_linesize => 32767);<br><br>
UTL_FILE.PUT_LINE(v_file,<br>
'Q1'     ||     YEAR     ||     '23'     ||     Q1_VALUE || '\r\n' ||<br>
          );<br><br>
UTL_FILE.FCLOSE(v_file);<br><br>
END TDF_EXTRACT;

'Q1' || YEAR || '23' || Q1_VALUE || '\r\n' ||
);Syntax error during concatenation, maybe?
C.
Message was edited by:
cd

Similar Messages

  • PL/SQL Procedure Complilation Error

    Can any one advise on the following PL/SQL Compilation errors I am receiving:<br><br>
    LINE/COL ERROR<br>
    -------- -----------------------------------------------------------------<br>
    22/1 PL/SQL: SQL Statement ignored<br>
    24/51 PL/SQL: ORA-00942: table or view does not exist<br>
    32/1 PL/SQL: SQL Statement ignored<br>
    34/30 PL/SQL: ORA-00942: table or view does not exist<br>
    40/1 PL/SQL: SQL Statement ignored<br>
    42/6 PL/SQL: ORA-00942: table or view does not exist<br><br>
    I know the tables exists and if I run the SELECT statements through SQLPLUS (without the INTO statements) they return the values as expected.<br><br>
    Procedure as below:<br><br>
    SQL> CREATE OR REPLACE PROCEDURE BS_TDF_EXTRACT AS<br>
    2 <br>
    3 v_file UTL_FILE.FILE_TYPE;<br>
    4 <br>
    5 EXTRACT_YEAR number;<br>
    6 <br>
    7 --Indicator 23 autogeneration<br>
    8 Q1_VALUE_23 number;<br>
    9 Q1_VALUE_23_PASSED_TOTAL number;<br>
    10 Q1_VALUE_23_FAILED_TOTAL number;<br>
    11 Q1_VALUE_23_TOTAL_JOBS number;<br>
    12 <br>
    13 <br>
    14 BEGIN<br>
    15 <br>
    16 --Initialise current Extract Year<br>
    17 SELECT EXTRACT(YEAR FROM SYSDATE) <br>
    18 INTO EXTRACT_YEAR<br>
    19 FROM DUAL;<br>
    20 <br>
    21 --Initialise PASSED TOTAL<br>
    22 SELECT COUNT(*) <br>
    23 INTO Q1_VALUE_23_PASSED_TOTAL<br>
    24 FROM REP_POSTINSP_OUT_GU A1, REP_JOB_INVOICED A2, REP_JOB_INDICATORS A3<br>
    25 WHERE UPPER(A1.POSTINSP_SUCC_IND) = 'P' <br>
    26 AND A1.JOB_NUMBER = A2.JOB_NUMBER<br>
    27 AND A2.JOB_NUMBER = A3.JOB_NUMBER<br>
    28 AND A2.COMPLETION_DATE BETWEEN TO_DATE('01-APR-2006') AND TO_DATE('30-JUN-2006') <br>
    29 AND A3.POST_INSPECTION_NOT_DONE IS NULL;<br>
    30 <br>
    31 --Initialise FAILED TOTAL<br>
    32 SELECT COUNT(*) <br>
    33 INTO Q1_VALUE_23_FAILED_TOTAL<br>
    34 FROM REP_POSTINSP_OUT_GU A1, REP_JOB_INVOICED A2<br>
    35 WHERE UPPER(A1.POSTINSP_SUCC_IND) = 'F' <br>
    36 AND A1.JOB_NUMBER = A2.JOB_NUMBER <br>
    37 AND A2.COMPLETION_DATE BETWEEN TO_DATE('01-APR-2006') AND TO_DATE('30-JUN-2006');<br>
    38 <br>
    39 --Initialise TOTAL JOBS<br>
    40 SELECT COUNT(DISTINCT JOB_NUMBER)<br>
    41 INTO Q1_VALUE_23_TOTAL_JOBS<br>
    42 FROM REP_JOB_INVOICED;<br>
    43 <br>
    44 --Initialise Indicator Value<br>
    45 Q1_VALUE_23:= (Q1_VALUE_23_PASSED_TOTAL + Q1_VALUE_23_FAILED_TOTAL)/Q1_VALUE_23_TOTAL_JOBS;<br>
    46 <br>
    47 v_file := UTL_FILE.FOPEN(location => '/tmp',<br>
    48 filename => 'bs_imported_values.txt',<br>
    49 open_mode => 'W',<br>
    50 max_linesize => 32767);<br>
    51 <br>
    52 UTL_FILE.PUT_LINE(v_file, 'Q1' || EXTRACT_YEAR || '23' || Q1_VALUE_23 || '\r\n');<br>
    53 <br>
    54 UTL_FILE.FCLOSE(v_file);<br>
    55 <br>
    56 END BS_TDF_EXTRACT;<br>
    57 /<br><br>
    Warning: Procedure created with compilation errors.<br><br>
    SQL> show errors;<br>
    Errors for PROCEDURE BS_TDF_EXTRACT:<br><br>
    LINE/COL ERROR<br>
    <br>22/1 PL/SQL: SQL Statement ignored<br>
    24/51 PL/SQL: ORA-00942: table or view does not exist<br>
    32/1 PL/SQL: SQL Statement ignored<br>
    34/30 PL/SQL: ORA-00942: table or view does not exist<br>
    40/1 PL/SQL: SQL Statement ignored<br>
    42/6 PL/SQL: ORA-00942: table or view does not exist<br>

    go to sql prompt and look for desc of these and if they are not available get permissions,DB link what ever may be required to access it can be the only possibility REP_POSTINSP_OUT_GU A1, REP_JOB_INVOICED A2, REP_JOB_INDICATORS A3

  • DB Adapter calling PL/SQL Procedure gives error

    Created partner link, calling pl/sql procedure with one in variable and one out variable. Invoke works fine. Assigning pl/sql return value to output is causing run time error. "Rebuild" and "Deploy" works file.
    Here is the error:
    Assign_2
    [2007/08/03 14:18:06]
    Error in evaluate <from> expression at line "93". The result is empty for the XPath expression : "/ns3:OutputParameters/ns3:OUT_STATUS_CODE".
    oracle.xml.parser.v2.XMLElement@ba1893
    Copy details to clipboard
    [2007/08/03 14:18:06]
    "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure" has been thrown.
    - <selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    - <part name="summary">
    <summary>
    empty variable/expression result.
    xpath variable/expression expression "/ns3:OutputParameters/ns3:OUT_STATUS_CODE" is empty at line 93, when attempting reading/copying it.
    Please make sure the variable/expression result "/ns3:OutputParameters/ns3:OUT_STATUS_CODE" is not empty.
    </summary>
    </part>
    </selectionFailure>
    Any input would be appreciated..
    Thanks.

    Thanks, it works.
    In the “Assign Variables”
    Changed from:
    <copy>
    <from variable="Invoke_1_ASNDBTest103_OutputVariable"
    part="OutputParameters" query="/ns3:OutputParameters/ns3:OUT_STATUS_CODE"/>
    <to variable="outputVariable" part="payload"
    query="/ns2:ASNReturnStatus102"/>
    </copy>
    Changed to:
    <copy>
    <from variable="Invoke_1_ASNDBTest103_OutputVariable"
    part="OutputParameters" query="/ns3:OutputParameters"/>
    <to variable="outputVariable" part="payload"
    query="/ns2:ASNReturnStatus102"/>
    </copy>
    So far so good, but one question, compiler gives warning…but everything works well.
    Warning(97):
    [Error ORABPEL-10041]: Trying to assign incompatible types
    [Description]: in line 97 of "C:\HOME\jdevOAExt3\jdevhome\jdev\mywork\ASNTest101\BPELProcess1\bpel\BPELProcess1.bpel", <from> value type "{http://xmlns.oracle.com/pcbpel/adapter/db/APPS/XRX_BPEL_INSERT_ASN_TMP102/}OutputParameters anonymous type" is not compatible with <to> value type "{http://www.thiscompany.com/ns/sales}ASNReturnStatus102".
    [Potential fix]: Please make sure that the return value of from-spec query is compatible with the to-spec query.
    Also, instead of direct variable to variable copy, used expression to variable copy and it works. You can avoid the warning from the compiler.
    Does not work ==> bpws:getVariableData('Invoke_1_ASNDBTest103_OutputVariable','payload','/ns3:OutputParameters/ns3:OUT_STATUS_CODE')
    Works ==> bpws:getVariableData('Invoke_1_ASNDBTest103_OutputVariable','payload','/ns3:OutputParameters’)
    So, why the compiler warning?

  • Wierd SQL Select Compile Error

    Hello.
    When I do my SQL like this:
    SQL SELECT cus_surname as "Surname",
    cus_forename as
    "FirstName",
    cus_telephone as
    "Telephone",
    cus_address as
    "Address1",
    cus_line1 as
    "Address2",
    cus_line2 as
    "Address3",
    cus_town as
    "Address4",
    cus_city as
    "Address5",
    cus_postcode as
    "Address6"
    INTO :lCustomer
    FROM msp_customers
    WHERE cus_serial = :lRefCustomer.Serial
    on session SessionToUse;
    I get this compile error:
    The read-only virtual attribute
    FoundationClasses.FoundationBusinessObject.IsNew can't be passed as an
    OUTPUT or an INPUT OUTPUT parameter.
    Yet if I remove the "as" from the SQL Select syntax it works, with no
    compile errors.
    Why? I don't understand why they are different!
    Tim Sawyer
    PanCredit
    Leeds, UK.
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    I added a DBMS_OUTPUT.put_line(l_wrap) in keith codes
    and run out put wrapped test codes in sqlplus and can see wrapped test procedure.
    create or replace procedure test wrapped
    a000000
    b2
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    7
    11d 124
    ohyVALi7ang26ROCF0CZ3wLg6ngwgy7Q2SdqfC/p+D6E39xrRLEK0/eVVEVSORSTWoZXk1gi
    JT9nTrV3IXmGVbi5uMlIl+0C/WV9wPlFL5z37QfcEOYUdmLx8iwul2hEvDehUX0jLfiltHqx
    MhAgy16zDvWPfv5uE4HrlBvRAYoDmETXR7r10x/uyQyUxDw4sVyq6Ndh4GSFw9zp801nKSN1
    P0GOB03CtlcnrqAjQhASJKrP4sXW74oOyr373DBBP/CLndRTT0TZ1HvWVzAgL5C++Dl6PNyQ
    But I got compiled errors as
    Compilation errors for PROCEDURE SYS.TEST
    Error: PLS-00103: Encountered the symbol "ASWALLET_OPEN" when expecting one of the following:
    ( ; is with authid as cluster compress order using compiled
    wrapped external deterministic parallel_enable pipelined
    result_cache
    The symbol "is" was substituted for "ASWALLET_OPEN" to continue.
    Line: 1
    Text: create or replace procedure test wrapped
    Error: PLS-00103: Encountered the symbol "=" when expecting one of the following:
    constant exception <an identifier>
    <a double-quoted delimited-identifier> table long double ref
    char time timestamp interval date binary national character
    nchar
    The symbol "<an identifier>" was substituted for "=" to continue.
    Line: 1
    Text: create or replace procedure test wrapped
    Error: PLS-00103: Encountered the symbol "=" when expecting one of the following:
    constant exception <an identifier>
    <a double-quoted delimited-identifier> table long double ref
    char time timestamp interval date binary national character
    nchar
    Line: 1
    Text: create or replace procedure test wrapped
    .Bot trigger and procedure works well before wrapped.
    I use oracle 11g2 at window 2003.
    Thanks
    newdba

  • Insertin Data useing SQL Procedure Getting Error ORA-00942 and ORA-06512

    I have two Schemas ISYS and ISYSTWO
    I had created a Stored Procedure RECINC2 in Schema ISYS
    as
    procedure recinc2(cName IN CHAR,cWhere IN CHAR,cTable in CHAR)
    AS
    cQry VARCHAR2(1000);
    BEGIN
    cQry := 'INSERT INTO '||cName||'.'||cTable||' SELECT * FROM '||cTable|| ' WHERE ||cWhere;
    dbms_output.put_line(cqry);
    EXECUTE IMMEDIATE cQry;
    end;
    NOW WHEN in Run it gives error
    SQL> begin
    2 recinc2('ISYSTWO','CODE=4','AGENTS');
    3 end;
    4 /
    INSERT INTO ISYSTWO.AGENTS SELECT * FROM AGENTS WHERE CODE=4
    begin
    ERROR at line 1:
    ORA-00942: table or view does not exist
    ORA-06512: at "ISYS.RECINC2", line 8
    ORA-06512: at line 2
    BUT IF I EXECUTE
    the DBMS output
    INSERT INTO ISYSTWO.AGENTS SELECT * FROM AGENTS WHERE CODE=4
    it executes and gives fine result
    Please help
    Thanks
    Chaand kackria

    SQL> conn ISYSTWO/ISYSTWO
    Connected.
    SQL> grant all on agents to isys;
    Grant succeeded.
    SQL> conn isys/isys
    Connected.
    SQL> exec recinc2('ISYSTWO','CODE=4','AGENTS');
    INSERT INTO ISYSTWO.AGENTS SELECT * FROM AGENTS WHERE CODE=4
    PL/SQL procedure successfully completed.

  • Sql statement  - compilation error

    I have a sql statement in a method that looks something like this:
    for each row in
    SELECT *
    FROM LASC.CMS.VW_CERTIFICATEOFGOODSTANDING1
    WHERE barNum = LASC.CertificationRequest.barNum
    do
    display ...
    end
    when I try to compile it, I get an error saying:
    SQL statements can only be used in functions or procedures that run on the server side.
    I am fairly new to BPM, so I am not sure how to resolve this.
    Any help would be greatly appreciated.
    Lilach

    here is the solution that Ignacio provided.
    You could go to Properties tab on the right (in Studio) for this method and inside the Method Properties section, you have on boolean property called "Server Side Method". Check it on "True".
    Hope this helps.
    Ignacio

  • Procedure compilation Error.......

    Hi ,
    I am getting an error while compiling the procedure...Please help me out..
    create or replace procedure generate_test_file RETURN NUMBER
    IS
    CURSOR curEmployee IS
    SELECT empno,
    ename,sal
    FROM Emp;
    --Line to output
    sOutputLine VARCHAR2(4000);
    uFileHndl UTL_FILE.FILE_TYPE;
    sFileName VARCHAR2(30);
    sEmployeeid varchar2(30);
    sEmployeeName varchar2(50);
    sEmployeeSalary varchar2(30);
    sOutputLine varchar2(120);
    -- The directory you want file to be generated
    gs_TestDir CONSTANT VARCHAR2(50):='c:\tms\';
    c_comma VARCHAR2(2) :=',' ; -- Delimiter
    BEGIN
    OPEN curEmployee
    sFileName := 'test.csv'; ---------(ERRORED OUT IN THIS LINE)
    uFileHndl := UTL_FILE.FOPEN(gs_TestDir,sFileName,'w');
    LOOP
    FETCH curEmployee INTO sEmployeeId,sEmployeeName,sEmployeeSalary;
    EXIT WHEN curEmployee%NOTFOUND;
    sOutputLine := sEmployeeId || c_comma ||
    sEmployeeName || c_comma ||
    sEmployeeSalary;
    UTL_FILE.PUT_LINE(uFileHndl,sOutputLine);
    END LOOP;
    CLOSE curEmployee;
    -- Close the output file
    UTL_FILE.FCLOSE(uFileHndl);
    RETURN 0;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE(SQLERRM);
    UTL_FILE.FCLOSE(uFileHndl);
    CLOSE curEmployee;
    RETURN SQLCODE;
    END;
    Error:
    20/1 PLS-00103: Encountered the symbol "SFILENAME" when expecting one
    of the following:
    . ( % ; for
    The symbol ";" was substituted for "SFILENAME" to continue.
    Thanks,
    Nitesh

    Check out the comments in ---------------------XXXX--------------------- below in the code and also this is FUNCTION and not PROCEDURE as you retruning some value using RETURN clause.
    The below code is compiling fine.
    create or replace function generate_test_file RETURN NUMBER
    IS
    CURSOR curEmployee IS
    SELECT empno,
    ename,sal
    FROM Emp;
    --Line to output
    sOutputLine VARCHAR2(4000);
    uFileHndl UTL_FILE.FILE_TYPE;
    sFileName VARCHAR2(30);
    sEmployeeid varchar2(30);
    sEmployeeName varchar2(50);
    sEmployeeSalary varchar2(30);
    sOutputLine varchar2(120); ---------------DECLARE TWICE ----------------------------
    -- The directory you want file to be generated
    gs_TestDir CONSTANT VARCHAR2(50):='c:\tms\';
    c_comma VARCHAR2(2) :=',' ; -- Delimiter
    BEGIN
    OPEN curEmployee; ----------------SEMICOLON MISSING ---------------------
    sFileName := 'test.csv'; ---------(ERRORED OUT IN THIS LINE)
    uFileHndl := UTL_FILE.FOPEN(gs_TestDir,sFileName,'w');
    LOOP
    FETCH curEmployee INTO sEmployeeId,sEmployeeName,sEmployeeSalary;
    EXIT WHEN curEmployee%NOTFOUND;
    sOutputLine := sEmployeeId || c_comma ||
    sEmployeeName || c_comma ||
    sEmployeeSalary;
    UTL_FILE.PUT_LINE(uFileHndl,sOutputLine);
    END LOOP;
    CLOSE curEmployee;
    -- Close the output file
    UTL_FILE.FCLOSE(uFileHndl);
    RETURN 0;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE(SQLERRM);
    UTL_FILE.FCLOSE(uFileHndl);
    CLOSE curEmployee;
    RETURN SQLCODE;
    END;
    ~Vinod

  • Procedure compile error

    Hi, i get an ' identifier EMAIL_ATTACH must be declared' error when i run the following code
    create or replace
    PROCEDURE read_demo(FILENAME VARCHAR2) IS
    V_BFILE BFILE := BFILENAME(EMAIL_ATTACH, FILENAME);
    V_LGH_FILE BINARY_INTEGER;
    BEGIN
    dbms_lob.fileopen(V_BFILE, dbms_lob.file_readonly);
    dbms_lob.fileclose(V_BFILE);
    END;
    EMAIL_ATTACH is a Directory that has been created on the database by myself.
    Any ideas to what th problem may or not be.

    Hi
    you probably just need to enclose the EMAIL_ATTACH with '' like the example on
    http://www.techonthenet.com/oracle/functions/bfilename.php
    Hope it helps.

  • PL/SQL procedure "Not Defined"

    I have created a PL/SQL procedure, compiled it successfully, and am trying to call it from
    an "onmouseover=" construction in the Link Attributes for a report column.
    I have created an application process entry for this procedure in Shared Components/Application Processes.
    When I place the mouse pointer over the column in the report I get an error stating
    the procedure is "Not Defined".
    I am trying to implement this onmouseover event in a manner similar to how it is implemented in the "Aria People, 0.92" packaged application I have downloaded from the Oracle/APEX web site. In the downloaded "Aria People, 0.92" application I have installed the onmouseover="ARIA_DETAIL(this,'#PERSON_ID#")" call works fine (on page 1 of the app).
    Interestingly, if I take the exact same call to the ARIA_DETAIL() procedure and place it in my application I also get a 'Not Defined' error on the ARIA_DETAIL() procedure.
    Clearly I am failing to do what is needed to have a PL/SQL procedure "Defined" for an APEX application. Can some kind soul please tell me what I have failed to do here?
    Thank you in advance.
    Jim Lewis

    Jim,
    Sorry to go to the basics but am I correct about the following?
    1. You created the pl/sql process as an ondemand process.
    2. You added the ARIA_DETAIL javascript function to the page on which your calling it.
    I'm just guessing but it sounds like you missed the second step there. Take a look at the application you got the code from and look at the Page Attributes. You should see some code in the HTML Header. That's what you need to add to your app.
    Dan

  • (SD 1.5.4.59.40) Compilation with coment - success with compilation error

    Hi!
    If I run this script:
    create table t(n number);
    create or replace
    TRIGGER t1
    -- Coment wiсh work!
    BEFORE UPDATE ON t
    REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW
    DECLARE
    past_due EXCEPTION;
    begin
    if 1 = 1 then
    raise_application_error(-20001, 'First trigger!' , TRUE);
    end if;
    end t1;
    +/+
    create or replace
    -- Coment with error
    TRIGGER t2
    BEFORE UPDATE ON t
    REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW
    DECLARE
    past_due EXCEPTION;
    begin
    if 1 <> 1 then
    raise_application_error(-20001, 'Second trigger!' , TRUE);
    end if;
    end;
    +/+
    Result:
    +SQL Command: create or replace --+
    Failed: ORA-24344: success with compilation error
    +24344. 00000 - "success with compilation error"+
    *Cause:    A sql/plsql compilation error occurred.+
    *Action:   Return OCI_SUCCESS_WITH_INFO along with the error code+
    anonymous block completed
    trigger text in SLD Developer:
    create or replace TRIGGER t2
    BEFORE UPDATE ON t
    REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW
    DECLARE
    past_due EXCEPTION

    It looks to me like there is a bug in the logic that determines if the current statement is SQL (terminated by ";") or PL/SQL (terminated by "/") - putting the comment before the object type you are creating is causing SQL Developer to assume it is SQL and it stops the statement at the first ";".
    The same thing happens if you try to create a package with a comment between the "create or replace" and the "package", for example:
    create or replace
    -- comment
    package xxx_pkg
    i number;
    j number;
    end;
    /creates a package with the following source, executing as a statement (so long as the cursor is between the create and the first ";"):
    package xxx_pkg
    i numbertheFurryOne

  • Procedure compilation failed with SQL command not properly ended error

    Hi All,
    Kindly help me to fix this.
    I am compiling a procedure and getting an error. Procedure and error details are as follows:
    Procedure:
    CREATE or REPLACE PROCEDURE jiostore_new.auditReportCount (u_name IN VARCHAR2,stdate IN DATE,eddate IN DATE)
    IS
    BEGIN
    DECLARE Total Number;
    BEGIN
    SELECT COUNT(am.id) into Total FROM auditMaster_ AS am  INNER JOIN jioworld.deviceos_ dvos ON dvos.id=am.deviceOs WHERE am.updatedBy=u_name or am.updatedBy=ALL AND DATE(am.updatedDate)>=stdate OR DATE(am.updatedDate)='0000-00-00' AND DATE(am.updatedDate)<=eddate or DATE(am.updatedDate)='0000-00-00';
    dbms_output.put_line('Total Count:' || Total);
    END;
    END;
    Error:
    Error(6,1): PL/SQL: SQL Statement ignored
    Error(6,50): PL/SQL: ORA-00933: SQL command not properly ended
    Regards,
    Vishal G

    2922723 wrote:
    Hi All,
    Kindly help me to fix this.
    I am compiling a procedure and getting an error. Procedure and error details are as follows:
    Procedure:
    CREATE or REPLACE PROCEDURE jiostore_new.auditReportCount (u_name IN VARCHAR2,stdate IN DATE,eddate IN DATE)
    IS
    BEGIN
    DECLARE Total Number;
    BEGIN
    SELECT COUNT(am.id) into Total FROM auditMaster_ AS am  INNER JOIN jioworld.deviceos_ dvos ON dvos.id=am.deviceOs WHERE am.updatedBy=u_name or am.updatedBy=ALL AND DATE(am.updatedDate)>=stdate OR DATE(am.updatedDate)='0000-00-00' AND DATE(am.updatedDate)<=eddate or DATE(am.updatedDate)='0000-00-00';
    dbms_output.put_line('Total Count:' || Total);
    END;
    END;
    Error:
    Error(6,1): PL/SQL: SQL Statement ignored
    Error(6,50): PL/SQL: ORA-00933: SQL command not properly ended
    Regards,
    Vishal G
    The first thing, is that for your own sanity you should learn to format your code for readability.  And for the sanity of those from whom you seek help, you should learn to preserve that formatting when you post to a forum:
    CREATE OR REPLACE PROCEDURE jiostore_new.auditReportCount(
        u_name IN VARCHAR2,
        stdate IN DATE,
        eddate IN DATE)
    IS
    BEGIN
      DECLARE
        Total NUMBER;
      BEGIN
        SELECT COUNT(am.id)
        INTO Total
        FROM auditMaster_ AS am
        INNER JOIN jioworld.deviceos_ dvos
        ON dvos.id              =am.deviceOs
        WHERE am.updatedBy      =u_name
        OR am.updatedBy          =ALL
        AND DATE(am.updatedDate)>=stdate
        OR  DATE(am.updatedDate) ='0000-00-00'
        AND DATE(am.updatedDate)<=eddate
        OR  DATE(am.updatedDate) ='0000-00-00';
        dbms_output.put_line('Total Count:' || Total);
      END;
    END;
    What is the data type of am.updateDate?  It appears to be a varchar being passed to a function named DATE to convert it to a DATEfor comparison to your input parameters,  But you also compare it to strings. 
    Where are the variables 'u_name' and 'ALL'?  (and what kind of a name is that for a variable -- 'ALL'?)

  • Create Procedure - How to Detect Compilation Errors

    Hi,
    I am working on an application where users will be able to type in their own stored procedures. I perform some basic parsing of the function spec, to make sure it is well-formed, but that's all the parsing I do. I assumed an SQLException would be thrown by the executeUpdate() call which creates the procedure if the procedure is malformed. This is not the case. executeUpdate() returns 0, whether or not the procedure was created with compilation errors.
    After they type it in, I would like to be able to tell the user whether or not their procedure is syntactically correct. Given that writing a complete PL/SQL parser in Java is obviously out of the question, how can I do this? There must be a way.
    Thanks in advance for any and all help,
    James

    Note that there is a USER_ERRORS table.
    You could DELETE FROM USER_ERRORS before issuing the procedure declaration and then SELECT ... FROM USER_ERRORS to see if errors have occured and if so to print them out.

  • Sqlserver_utilities use for migrating MS SQL to 9i - compilation error

    I've seen lot of questions about compilation error in the sqlserver_utilities particularly on Oracle 9i database where some procedure and functions are not compiled and required rewritten. The main issues seem to be with new features or tables/views not available in pre-10g such as regex, DBA_IND_STATISTICS, etc. Even though there is a IF clause (
    IF NOT DBMS_DB_VERSION.VER_LE_9_2 THEN) to prevent execution, however, it won't work for compilation standpoint.
    My question is that do we need to comment this section out or rewrite to work for 9i - for example, DBA_IND_STATISTICS view for last_analyzed is not in 9i, but we can use last_analyzed in USER_INDEXES. Is that the only option (manual labor work :-) to resolve this issue for 9i database?
    Thanks in advance,
    IC

    I think you made the right choice to go with 10g, 9i is obsolete anyway.
    The Migration Workbench come with SQL Developer might only work with 10g because it's built pretty new in 2007.
    You can try the older version of standalone Oracle Migration Workbench
    http://www.oracle.com/technology/tech/migration/workbench/index.html
    It support 9i, The Oracle Migration Workbench is a tool that simplifies the process of migrating
    Informix, and DB2 databases to the Oracle platform (Oracle9i and Oracle10g). Again, I still believe go with 10g is better choice.

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

  • Procedure created with compilation errors. help?

    SQL> create or replace procedure p_update_audit_log
    2 ( p_audit_id audit_log.audit_id%type
    3 p_grade_update audit_log.grade_update%type
    4 p_grade audit_log.grade%type
    5 sys_date
    6 p_user_id audit_log.user_id%type
    7 is
    8 BEGIN
    9 insert into audit_log (user_id, audit_id, grade, grade_update,
    10 sys_date)
    11 values (p_user_id, p_audit_id, p_grade, p_grade_update, sys_date);
    12 END p_update_audit_log;
    13
    14
    15
    16
    17
    18 /
    Warning: Procedure created with compilation errors.
    SQL> show errors
    Errors for PROCEDURE P_UPDATE_AUDIT_LOG:
    LINE/COL ERROR
    3/1 PLS-00103: Encountered the symbol "P_GRADE_UPDATE" when expecting
    one of the following:
    := ) , default character
    The symbol "," was substituted for "P_GRADE_UPDATE" to continue.
    4/1 PLS-00103: Encountered the symbol "P_GRADE" when expecting one of
    the following:
    := ) , default character
    The symbol "," was substituted for "P_GRADE" to continue.
    5/1 PLS-00103: Encountered the symbol "SYS_DATE" when expecting one
    LINE/COL ERROR
    of the following:
    := ) , default character
    The symbol ", was inserted before "SYS_DATE" to continue.
    7/1 PLS-00103: Encountered the symbol "IS" when expecting one of the
    following:
    := ) , default character
    The symbol ")" was substituted for "IS" to continue.
    Could anyone help me with this problem?

    These are syntax errors:
    Try this
    create or replace procedure p_update_audit_log
    ( p_audit_id audit_log.audit_id%type,
    p_grade_update audit_log.grade_update%type,
    p_grade audit_log.grade%type,
    sys_date DATE,
    p_user_id audit_log.user_id%type)
    is
    BEGIN
    insert into audit_log (user_id, audit_id, grade, grade_update,
    sys_date)
    values (p_user_id, p_audit_id, p_grade, p_grade_update, sys_date);
    END p_update_audit_log;

Maybe you are looking for

  • Connect to extenal server on click in ALV Report

    Hi Everybody, I want to open PDF image corresponding to article which is stored on the extenal server when i double click on the Article no. in ALV report. Is it possible?? Thanks in Advance..... AK

  • Folders in List View

    Can you guys add folders in the main list view of the remote desktop app for Mac. I am glad you guys finally implemented search again but being able to group connections into folders would be even better.

  • Internal table record checking (Urgent)

    Hi Experts, I have an internal table having records. I want to check each record of the table with every other record to find out if there exist same record for more then one key field. Can anybody help me to place the logic for how i can check the r

  • Help on min and max query

    hi all, I have a query that returns the following. SELECT id, start_time, end_time FROM accounts WHERE id = 006267 ORDER BY begin_time result is      ID     BEGIN_TIME     END_TIME      006267     11-12-2006 15:00:00     11-12-2006 17:30:00      0062

  • How to know what these Subtotal fields in R3 represent

    In the extractor of a the purchasing datasource (2LIS_02_SCL), I found a number of key figures but not exactly the one I wanted. Yet, there were other key figures Subtotal1, Subtotal2, Subtotals 3, etc. I needed to know what they were. They may be wh