Y at - it hurt with that my code? When I run it I get the message

Mr President.

I run the following script and I get the following message. Why the message of creation of procedure come before the message of table design and why I get warnings.

Y at - it hurt with my code in the script.

Help, please.

plsql procedure error.png

BEGIN
       
 -- drop tables 
  EXECUTE IMMEDIATE 'DROP TABLE logger';   
  EXECUTE IMMEDIATE 'DROP PROCEDURE insert_into_logger';   
  EXECUTE IMMEDIATE 'DROP FUNCTION get_emp_fullname';   
  
  
EXCEPTION
  WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('');
END;
/


-- ***** CREATE TABLES *****
create table logger
(log_time timestamp)
tablespace users; 



-- ***** CREATE PROCEDURE *****




create or replace procedure insert_into_logger 


DECLARE
pragma autonomous_transaction;
begin
  insert into logger
  values(systimestamp);
  commit;
end insert_into_logger;

  COMMIT;  
END;  
/  
-- ***** CREATE PROCEDURE *****

create or replace function get_emp_fullname (empid in number) return varchar2 


DECLARE

 v_full_name varchar2(120);
begin
  select first_name||' '||last_name
   into v_full_name
   from employees
   where employee_id = empid;
   
  return v_full_name;
exception
 when no_data_found then 
   return null;
end get_emp_fullname;

  COMMIT;  
END;  
/  
-- ***** End of Creation  *****


SET DEFINE OFF;



COMMIT;



















Concerning

Tender,

What is the complete code?

An example in the following procedure:

create or replace procedure insert_into_logger   

DECLARE
pragma autonomous_transaction;
begin
  insert into logger
  values(systimestamp);
  commit;
end insert_into_logger;  

  COMMIT;
END;
/

Replace 'DECLARE' with 'IS' or 'AS'

Your definition of the procedure ends with "end insert_into_logger". So, that is the VALIDATION and the END for?

The code above should be as below:

create or replace procedure insert_into_logger
is
pragma autonomous_transaction;
begin
  insert into logger
  values(systimestamp);
  commit;
end insert_into_logger;
/

Ditto for any other procedure also. It will be useful.

Reference:

http://docs.Oracle.com/CD/B19306_01/AppDev.102/b14251/adfns_packages.htm#i1006224

http://docs.Oracle.com/CD/B19306_01/server.102/b14200/statements_6009.htm

See you soon

AJ

Tags: Database

Similar Questions

Maybe you are looking for

  • How can I me Thunderbird e-mail sent from a computer that is dead?

    I can see something on my last computer and no longer need to access certain emails sent to. I downloaded Thunderbird on my new computer and get email online from my supplier that I can download the program from Thunderbird. Is it possible that I can

  • Using the pencil and iPad to editing text

    I'm a writer. When a piece of writing seems to 'fact', I print out and go top with a red pen for the final polishing. I carefully then enter the changes in the document (not my favorite part!). How much of this workflow can I replace via Apple pencil

  • Disable the double click the home button

    IPhone 6 - How can I disable double click on the button for the command to NOT come home? Boring... = thanks IOS 9.3.1

  • HP 1b79dx g6: replacement motherboard

    Hello I am currently using a 15 inch hp g6 1b79dx wanted andi cpuy and replacemy motherboard and was able to locate the two pieces When finally receive the motherboard and trying to install it does not fit in the bottom of the case. There is no repol

  • HP LaserJet 200 color MFP M276nw trouble after faxing

    My operating system is Mac OS 10 10.6.8 product # is CF a 145.  When I send a fax, it goes through, but then I get a 'call' short message and then I get a message 'connection' that don't die out.  If I hit Cancel, and then 'Cancel' message comes on b