Compilation of procedure error

I'm trying to compile a procedure which is supposed to fill the tables with data, but I get errors ignored multiple statements. I'm running out of ideas what could be wrong, because the syntax seems very well. I downloaded the full code here: http://pastebin.com/gTnpj0Jm . Could someone please take a look?

0566fdce-4035-4cdd-b2da-37d1e2b97e42 wrote:

I'm sorry, but I searched in my code for a good 10 minutes and I can't find any case to appoint a pl/sql variable same as column name.

You are right. Question is different.

DECLARE
DATE OF BORN_DATE_VALUE;
BEGIN
BORN_DATE_VALUE: = Trunc)
TO_DATE ('2000 ', 'yyyy')
+
DBMS_RANDOM. VALUE)
0,
TO_DATE ('2015 ","yyyy")
-
TO_DATE ('2000 ', 'yyyy')
));
END;

INSERT INTO STUDENT (ID_STUDENT, F_NAME, L_NAME, BORN_DATE)
VALUES (S_STUD. NEXTVAL, F_NAME_VALUE, L_NAME_VALUE, BORN_DATE_VALUE);

BORN_DATE_VALUE range block, in which it is declared. If being outside the block INSERT statement in that born_date_value is declared, INSERT does not know what BORN_DATE_VALUE and assume it is the column name.

SY.

Tags: Database

Similar Questions

  • Error (34.2): PLS-00103: encountered the symbol "END" when you try to compile the procedure.

    Hello

    I get the following error when I try to compile the procedure. I call a package inside this simple procedure. Not sure where I do worng. Here is the error I get.

    Error (34.2): PLS-00103: encountered the symbol "END"?

    Here is my code

    create or replace PROCEDURE BATCH_JOB_CAC_SP

    (

    vstatus OUT NUMBER)

    AS

    vloadserver global_name.global_name%TYPE: = get_dbservername;

    vuseridmod CONSTANT VARCHAR2 (15): = 'SYSTEM '.

    vloadname CONSTANT VARCHAR2 (30): = "BATCH_JOB_CAC_SP";

    v_cnt_upd NUMBER: = 0;

    vrunid NUMBER;

    v_spoutput VARCHAR2 (150);

    CURSOR job_cac

    IS

    SELECT NumCli, job_cac FROM batch_job_cac, batch_recid, jobnum;

    BEGIN

    I'm in job_cac LOOP

    job_cac_pkg.job_cac_valid_sp (i.custnum, i.jobnum, v_spoutput);

    CASE v_spoutput

    WHEN "1" THEN DBMS_OUTPUT. Put_line ('update job ACC');

    WHEN "2" THEN DBMS_OUTPUT. Put_line ('update job ACC');

    WHEN '3' THEN DBMS_OUTPUT. Put_line ('can not update working ACC');

    OF ANOTHER DBMS_OUTPUT. Put_line (v_spoutput);

    END CASE;

    END LOOP;

    EXCEPTION

    WHILE OTHERS THEN

    IF job_cac % isopen THEN

    CLOSE Job_cac;

    END IF;

    ROLLBACK;

    vStatus: = 1;

    LOG_ERROR_SP_NM (vLoadServer, vLoadName, SQLCODE, SQLERRM, vUserIdMod);

    END;

    END BATCH_JOB_CAC_SP;

    Thanks for your help.

    Hello

    You have 2 statements END at the bottom of your code, but only 1 BEGIN statement earlier.

    Losing one of these END States.

  • Why I get an ORA-04052 error when I try to compile a procedure?

    Hello
    The following procedure I get an ORA-04052 error when I try to compile the following procedure.
    CREATE OR REPLACE PROCEDURE APPS.Find_String (
     pin_referenced_name IN dba_dependencies.referenced_name%TYPE) 
    
    IS
    
    cursor cur_get_dependancy
    is
    SELECT distinct owner, name, type 
      FROM [email protected]        -- prod.world 
     WHERE lower(referenced_name) = lower(pin_referenced_name) --'ftbv_salesrep_all_1d' 
       AND referenced_type <> 'SYNONYM'
       AND owner <> 'SYS'
     order by name;
     
    v_owner  varchar2(40);
    v_name   varchar2(50);
    v_type   varchar2(40);
     
     
        BEGIN
    
           dbms_output.put_line(upper(pin_referenced_name)||' is found in the following objects.');
           dbms_output.put_line(' ');
           dbms_output.put_line(RPAD('OWNER', 30, ' ')||RPAD('NAME', 60, ' ')||RPAD('OBJECT TYPE', 30, ' '));
           dbms_output.put_line('-------------------------------------------------------------------------------------------------------------------');
    
            FOR i IN cur_get_dependancy
            LOOP
                v_owner := RPAD(i.owner, 30, ' ');
                v_name  := RPAD(i.name, 45, ' ');
                v_type  := RPAD(i.type, 30, ' ');
                
               
                dbms_output.put_line(v_owner ||v_name|| v_type);
    
            END LOOP;
    
    END find_string;
    I use the [email protected] link. Commented compiles it procedure for other links of database used in the cursor, including the one to the right of the code 'prod.world '.

    What is even more strange is that I took the SELECT statement
    SELECT distinct owner, name, type 
      FROM [email protected]        -- prod.world 
     WHERE lower(referenced_name) = lower(pin_referenced_name) --'ftbv_salesrep_all_1d' 
       AND referenced_type <> 'SYNONYM'
       AND owner <> 'SYS'
     order by name;
    the procedure and he ran on the command line by using the link to @pinp.world, the SQL statement is fine. But when I tried to compile the procedure above to this exact same SQL query with the same exact link I get the following string of errors.
    ORA-04052: error occurred when looking up remote object [email protected]
    ORA-00604: error occurred at recursive SQL level 1
    ORA-02068: following severe error from PINP
    ORA-03113: end-of-file on communication channel
    How the link can work very well in a regular SQL but then cause an error when its code compiled in that otherwise compile correctly when you use any link, or even just a simple database. Does anyone have any suggestions?

    Hello

    Good thounght, but no, there is no privilege SELECT ANY VIEW; SELECT ANY TABLE includes views and materilaized.

    I suspect that the problem is something specific to the data dictionary. I have just connected as SYS and granted SELECT ANY TABLE to another user with minimum privileges, X. X, ALL_VIEWS included so all views dba_, including the dba_dependencies. However, X was still unable to dba_dependencies the query either in SQL * more or PL/SQL.

  • compile the procedures

    Hi all

    I use oracle 10.2.

    I'm new to the procedures.
    I created the procedure.
    This procedure created with few errors.
    I got the message as warning: procedure created with compilation errors.

    I want to know where the error. So, I want to compile it. where I can compile the procedure?
    the option that I can use?

    Thank you

    After you get this error, write

    SQL>show errors;
    

    But if you want to compile the procedure, run:

    ALTER PROCEDURE your_procedure_name COMPILE;
    
  • Media Encoder: Error compiling Movie - unknown error

    As the title, I have problems with Adobe Premiere Pro CC 2014 Adobe Media Encoder CC 2014 and - "Adobe Media Encoder: error compiling Movie - unknown error" appears each time I try to export my video. Both are trial versions, but my Adobe Media Encoder CC 2014 had ended and my Adobe Premiere Pro CC 2014 have left about 1 week of trial. Please help as soon as possible because I have to do a large project for my school, so cannot function without these great apps. Thank you.

    Hi Charles,

    Have you tried to export with Premiere Pro?

    Go to the file Menu in Premiere Pro > project settings > general and change 'Mercury playback engine' (if it allows) to 'Only software Mode' and then try to export from Premiere Pro.

    Mention also, what operating system are you using, hard RAM (Exxternal or internal), or several installed graphics cards and formats of files used in the project.

    Have you tried to make the scenario first before export?

    If possible send a screenshot of the full timeline.

    Vinay

  • Cannot restore: error compiling Movie: unknown error

    Hey there,

    Need help,

    I'm working on a short sequence (15 seconds).

    It has a few stacked video channels and I have applied overlays and fixed most of the color channels.

    The film is XMF files from a C300. Sequence of parameters defined in accordance with the proposed recommendation (IE when I dropped the clips).

    I get the "error compiling Movie: unknown error" message whenever I try to make or export.» I went through a lot of steps suggested by a blog post, I found here - I went through the sequence, removed the clip, has tried to return, then removed the effects.

    When I deleted the effects and buried the clips off side by side he made out for me.  That's great, but I have to be able to export the effects all in and empty them in layers. What can I do? Starting to pull my hair!

    Details...

    CS6. O

    MacBook, 4 GB Ram,

    Graphics card: NVIDIA GeForce GT 330 M 256 MB

    Thank you,

    Simon

    Hey,.

    Thanks for the tip - tried all of those, unfortunately with no joy.

    I have not deleted my cache - also no joy.

    BUT I installed a (now 6.0.5) update and it does.

    Thanks for the help,

    Simon

  • I can compile new procedures/packages on my instant watch?

    Hello

    I can compile new procedures/packages on my watch to the snapshot ?
    I need to test the new version of the application, which include some changes to the current packages

    Thank you

    Yes, that's the purpose of the eve of the snapshot
    You can test your application with real data
    When you are finished, all changes will be devulcanization (flashback), and the standby database will follow the new primary side

  • Compile with stored procedure errors

    Hi guys, I just start SQL so forgive me if I ask stupid questions real. That's the problem I have right now, as I said in my title.

    It's my procedure.sql

    CREATE OR REPLACE PROCEDURE check IS

    no_of_duplicates NUMBER: = 0;

    BEGIN

    SELECT COUNT (*) IN no_of_duplicates

    THE EMPLOYEE

    WHERE E # =.

    (select E # PILOT)

    WHERE THERE ARE

    (SELECT E # MECHANIC)

    WHERE DRIVER. L # = MECHANIC. L#));

    IF no_of_duplicates: = 0 THEN dbms_output.put_line ('OK');

    ON THE OTHER

    SELECT E #, NAME OF THE EMPLOYEE

    WHERE E # =.

    (SELECT E # PILOT)

    WHERE THERE ARE

    (SELECT E # MECHANIC)

    WHERE DRIVER. L # = MECHANIC. L#));

    END IF;

    END check;

    /

    While trying to create the procedure, it gives me compilation errors. I took with this for hours and can't seem to find anything wrong with it. Can someone point me in the right direction? Thank you!

    Hello

    Once again, your postal code.  The error occurs when you call the procedure, but you have not posted the code that calls the procedure and causes the error.

    When I do this in SQL * more:

    SET SERVEROUTPUT ON ENCAPSULATED FORMAT
    EXEC check;

    The procedure that you have posted works perfectly (i.e., displayed the e # is, exactly as it was designed to do).

    Display the e # and the name consists of BULK COLLECT both the e # name in separate collections, like this:

    CREATE OR REPLACE PROCEDURE check IS
    TYPE e #_table IS the TABLE OF THE employee.e#%TYPE;
    e # e _list #_table;

    TYPE name_table IS TABLE OF THE employee.name%TYPE;
    name_list name_table;
    BEGIN
    SELECT e #, name
    E LOOSE COLLECTION #_list, name_list
    The EMPLOYEE
    WHERE e # (IN)
    SELECT d.e #.
    DRIVER d
    JOIN m mechanic ON d.e # m.e = #.
    );
    E IF #_list. COUNT = 0
    THEN
    dbms_output.put_line ('OK, there without duplicate of illict");
    ELSE - that is to say, e #_list. COUNTY <> 0
    dbms_output.put_line (' the following employees are drivers and mechanics :');)
    J IN 1.e #_list. COUNTY LOOP - I displays parentheses sometimes hard 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 check;
    /
    DISPLAY ERRORS

    This is the result I get when I run the procedure above with your sample data:

    The following employees are drivers and mechanics:

    1 John Smith

    You will notice I did several other changes in your code, sometimes because they are much more practical and sometimes just to show you different ways to do the same thing, that 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 the no_of_duplicates and then a second time to get the actual data.  I don't know if it's the most effective way to do what you need.  Say that there are 1000 rows in the result.  You get all the 1000 once just to get the total number (that you do not need, if all you worry at this point is if there is), then to get the data.  When you make a COLLECTION in BULK, you get automatically the COUNTY anyway, so why not not COLLECTING in BULK, and then use this count to see what to do next.  If the NUMBER is greater than 0, then you already have the data, and you do not need to fetch it again.  In addition, repeating (essentially) the same code is a maintenance problem.  If you need to make a change, you must make the same change to several places.  At best, it's a pain; but it is the exactly the kind of mistake that is easy to miss in trials, and you could have the code that runs for weeks in Production before you notice that it sometimes gives false results.

    Another example: e # is a NUMBER.  If it is possible to convert numbers in VARCHAR2s and save these VARCHAR2s in a VARCHAR2 collection, would be unwise more just to store them in a collection of NUMBER?

  • Compilation of procedure with errors

    Hello

    I don't know why this procedure compile with errors:

    CREATE OR REPLACE PACKAGE BODY emp_package
    PROCEDURE read_emp_table
    (p_emp_table OUTPUT emp_table_type) IS
    I have directory: = 0;
    BEGIN
    FOR emp_record IN (SELECT * FROM employees)
    LOOP
    emp_table (i): = emp_record;
    i: = i + 1;
    END LOOP;
    END read_emp_table;
    END emp_package;
    /

    Can someone help me.

    Thank you

    You did not post the error. I guess that one of them is associated index. Oracle index in the collection begins with 1, not zero. Change

    I have directory: = 0;

    TO:

    I have directory: = 1;

    In addition, emp_table is not declared I guess it must be p_emp_table. So change:

    emp_table (i): = emp_record;

    TO

    p_emp_table (i): = emp_record;

    And after that it compiles it scratch and replace by:

    CREATE OR REPLACE PACKAGE BODY emp_package IS
    PROCEDURE read_emp_table
    (p_emp_table OUT emp_table_type) IS
    BEGIN
    SELECT * BULK COLLECT INTO p_emp_table FROM employees;
    END read_emp_table;
    END emp_package;
    /
    
  • Insert the procedural error

    I wrote an insert procedure. It shows some errors.
    This is the query.

    create or replace PROCEDURE SP_MEMBERS_IN)
    P_MEM_ID IN MEMBERS. MEM_ID,
    P_MEM_NAME IN MEMBERS. MEM_NAME,
    P_B_DAY IN MEMBERS. B_DAY,
    p_address in MEMBERS. ADDRESS

    *)*
    AS
    BEGIN
    INSERT INTO MEMBERS (MEM_ID, MEM_NAME, B_DAY, ADDRESS)
    VALUES (P_MEM_ID, P_MEM_NAME, P_B_DAY, P_ADDRESS);
    COMMIT;

    END SP_MEMBERS_IN;

    Here are the errors.
    Error (1): PL/SQL: analysis of completed Compilation unit
    Error (2.1): PLS-00488: invalid variable declaration: object ' MEMBERS. MEM_ID' must be a type or subtype

    Can someone help me fix it please?

    create or replace PROCEDURE SP_MEMBERS_IN)
    P_MEM_ID IN MEMBERS. MEM_ID % TYPE,
    P_MEM_NAME IN MEMBERS. MEM_NAME % TYPE,
    P_B_DAY IN MEMBERS. B_DAY % TYPE,
    p_address in MEMBERS. ADDRESS TYPE %

    )
    AS
    BEGIN
    INSERT INTO MEMBERS (MEM_ID, MEM_NAME, B_DAY, ADDRESS)
    VALUES (P_MEM_ID, P_MEM_NAME, P_B_DAY, P_ADDRESS);
    COMMIT;

    END SP_MEMBERS_IN;

    you forget to put % TYPE in the settings variable declaration

  • Stored procedure error

    Hello

    I am Oracle 10 G and is the next version.

    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - production
    PL/SQL Release 10.2.0.4.0 - Production
    CORE 10.2.0.4.0 Production
    AMT for 32-bit Windows: release 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production


    I wrote a small stored procedure, but it is throwing error.

    I'm trying to compile the stored procedure on the side using the advanced search tool.

    Create procedure SCEMANAME.testtest as
    Start
    Insert SCHEMANAME. TEST values (10);
    commit;
    end;

    The error that I do face is the following.

    37000 (900) [oracle] [ODBC] [Ora] ORA-00900: invalid SQL statement

    Any help would be appreciated...

    The problem may lie in your advanced search tool. What happens if you try it in SQL * more?

    BTW, you don't need to specify the schema in the INSERT statement. The procedure is already in this scheme.

  • The build procedure error

    Hai All

    I created a procedure in the program unit as I am compiling I got an error which

    BDP-ppu017 source of program unit must define the body of subprogram or package


    Concerning

    Srikkanth.M

    Problem is here

    Srikkanth.M wrote:
    My code of procedure is

    calc1 procedure
    (he in dail_att.intime%type,out in dail_att.outtime%type,a_date in dail_att.attend_date%type)

    OUT is Word reserve

    Its good practice to use P as a prefix for parameters for example p_out / p_it etc.

    procedure calc
     (p_it in dail_att.intime%type, p_out in  dail_att.outtime%type, pa_date in dail_att.attend_date%type)
    

    Baig,
    http://baigsorcl.blogspot.com

  • PLSQL procedure error...

    Hi guys,.

    I have the following functions within a packet...

    I tried to create directories in the runtime dynamically beside a plsql...
    FUNCTION Get_Site_Dir_Name (
       site_     IN VARCHAR2,
       dir_type_ IN VARCHAR2 ) RETURN VARCHAR2
    IS
    
    BEGIN
       
       RETURN (REPLACE(site_, ' ', NULL) || UPPER(dir_type_));
       
    END Get_Site_Dir_Name;
    
    
    PROCEDURE Set_Dir_Path (
       dir_path_ IN VARCHAR2,
       site_ IN VARCHAR2,
       dir_type_ IN VARCHAR2 )
    IS
    
    BEGIN
       
       CREATE OR REPLACE DIRECTORY Get_Site_Dir_Name(site_, dir_type_) AS dir_path_; 
    
    END Set_Dir_Path;
    But it gives me an error during deployment...

    WARNING: The body of a Package created with compilation errors.

    PACKAGE BODY SITE_API errors:

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    1354/4 PLS-00103: encountered the symbol "CREATE" when expecting one of
    What follows:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while < ID >
    < between double quote delimited identifiers of > < a variable binding > < <
    Close current delete fetch locking insert open rollback
    SAVEPOINT SQLExecute set pipe fusion commit forall


    Can someone help me with this?

    Thank you very much...

    It should be

    stmt_ := 'CREATE OR REPLACE DIRECTORY :dir_name AS :dir_path';
    EXECUTE IMMEDIATE stmt_
    USING IN dir_name_,
    IN dir_path_;
    

    See you soon!
    Bobin

  • any simple procedural error off... What am I doing wrong?

    I created a very simple procedure like below to collect statistics of schema for 3 schema diff...
    its getting created but with compilation errors...
    CREATE OR REPLACE PROCEDURE SCOTT.ANALYZE
    AS
    BEGIN
    execute immediate dbms_stats.gather_schema_stats(ownname=>'ABC_OWNER', cascade=> TRUE, estimate_percent=> NULL);
    execute immediate dbms_stats.gather_schema_stats(ownname=>'QWE_OWNER', cascade=> TRUE, estimate_percent=> NULL);
    execute immediate dbms_stats.gather_schema_stats(ownname=>'ZXC_OWNER', cascade=> TRUE, estimate_percent=> NULL);
    END;
    /
    ATTENTION: updated, but with compilation errors


    AND WHEN I DEBUG THIS PROCDEU I GET THE INFORMATION BELOW... WHAT AM I DOING WRONG HERE?



    SCOTT OF THE PROCEDURE. ANALYZE
    Online: 4
    PLS-00306: wrong number or types of arguments in the call to 'GATHER_SCHEMA_STATS '.

    You may not execute immediate.

    CREATE OR REPLACE PROCEDURE SCOTT.ANALYZE
    AS
    BEGIN
    dbms_stats.gather_schema_stats(ownname=>'ABC_OWNER', cascade=> TRUE, estimate_percent=> NULL);
    dbms_stats.gather_schema_stats(ownname=>'QWE_OWNER', cascade=> TRUE, estimate_percent=> NULL);
    dbms_stats.gather_schema_stats(ownname=>'ZXC_OWNER', cascade=> TRUE, estimate_percent=> NULL);
    END;
    / 
    
  • FPGA timing when compiling PID loop error

    Hello.

    I'm using Labview 2011 card FPGA PCI-7833R.

    My problem is that whenever I try to integrate FPGA designed screws in my code, I get an error of timing.  See the photos displayed below.

    In this case, I have an express VI PID which I use in a used while loop (not even timed!) in my FPGA code, but when compiling, I get an error saying that the possible maximum clock frequency is the 43 MHz.

    I have a lot of loops, a few running at 80 MHz.  Is there a way to slow down a specific while loop, so that it runs at 40 MHz and not 80 MHz, as others?  The compiler does not seem to meet the simple addition of a timer loop...

    Thank you

    Orel.

    PS the same thing happens when I try to add a lowpass filter VI of the FPGA code.

    Is it possible that you set the level above 80 Mhz clock?  This is what it looks like to me.  In Explorer, right click on the FPGA target, select Properties, then go to the category "first level clock.

Maybe you are looking for