Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8254271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:07:58+00:00 2026-06-08T01:07:58+00:00

I have created some Procedures in SQL Developer, and they are working fine. However

  • 0

I have created some Procedures in SQL Developer, and they are working fine. However I am now creating a Package to include all those Procedures, and can’t seem to figure out the right way to code the Package as it returns the following error (refering to the PACKAGE BODY’s CREATE):

 PLS-00103: Encountered the symbol "CREATE"

Here is my code:

CREATE OR REPLACE PACKAGE package_test AS

PROCEDURE copy_object;

END package_test;

CREATE OR REPLACE PACKAGE BODY package_test AS

PROCEDURE copy_object IS
CURSOR object_cursor IS
SELECT COD_OBJECT, OBJECT_NAME FROM OBJECT;

object_rec object_cursor%rowtype;

BEGIN
EXECUTE IMMEDIATE 'TRUNCATE TABLE DATABASE2.D_OBJECT';
FOR object_rec IN object_cursor
LOOP
    INSERT INTO DATABASE2.D_OBJECT (COD_OBJECT,OBJECT_NAME) VALUES (object_rec.OOD_OBJECT,object_rec.OBJECT_NAME);
END LOOP;
COMMIT;
END copy_object;
END package_test;

I have done some searching and the only thing I can think of is maybe some problem related to the definition on the CURSOR…not sure though. Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T01:08:00+00:00Added an answer on June 8, 2026 at 1:08 am

    I successfully ran this in sqlplus and sqldeveloper (F5 in sqldeveloper: “Run Script”). I changed the two dml statements since my schema is different.

    SQL> CREATE OR REPLACE PACKAGE package_test AS
      2
      3  PROCEDURE copy_object;
      4
      5  END package_test;
      6  /
    
    Package created.
    
    SQL>
    SQL> CREATE OR REPLACE PACKAGE BODY package_test AS
      2
      3  PROCEDURE copy_object IS
      4  CURSOR object_cursor IS
      5  SELECT * from dual;
      6
      7  object_rec object_cursor%rowtype;
      8
      9  BEGIN
     10  EXECUTE IMMEDIATE 'TRUNCATE TABLE DATABASE2.D_OBJECT';
     11  FOR object_rec IN object_cursor
     12  LOOP
     13      NULL; --INSER INTO DATABASE2.D_OBJECT (COD_OBJECT,OBJECT_NAME) VALUES (object_rec.OOD_OBJECT,object_rec.OBJECT_
    NAME);
     14  END LOOP;
     15  COMMIT;
     16  END copy_object;
     17  END package_test;
     18  /
    
    Package body created.
    
    SQL>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created and launch the SQLJ Java procedure (using SQL Developer). I have some
I have created some tests in my WPF application. Right now I am working
I have created some lovely reports using SQL Server Business Intelligence Development creating a
I have created some functional categories that I use to show/hide markup elements. However,
I'm working on an oracle database which has a package with some stored procedures
I am using Crystal Reports in my application. Now, I have created an SQL
I have created some JQuery that will expand a div 'popup' on hover and
I have created some python code which creates an object in a loop, and
I have created some simple charts (of type FastLine) with MSChart and update them
I have created some documents and managed to make some simple queries but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.