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 8006723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:36:32+00:00 2026-06-04T17:36:32+00:00

Right now I’m importing and transforming data into an Oracle database as follows: A

  • 0

Right now I’m importing and transforming data into an Oracle database as follows:

  • A program regularly polls specific folders, once a file is found it executes a batch file which does some light transformation in Python & bash and then calls SQL*Loader to load the CSV file into a staging table.

  • Then, the batch script calls an SQL script (via SQLPlus) to do the final transformation and insert the transformed data into master tables for their respective staging table.

The problem with this method is there’s no error-handling on the SQLPlus side, eg. if an ‘insert into’ statement fails because of a violated constraint (or any other reason), it will still continue to execute the rest of the statements contained in the SQL script.

Ideally, if any exception occurs, I’d prefer all changes to be rolled back and details of the exception inserted into an etl log table.

Stored procedures seem to be a good fit as exception handling is built-in. However, I’m struggling with the syntax – specifically how I can take my big SQL scripts (which are just a combination of INSERT INTO, UPDATE, CREATE, DROP, DELETE, etc statements) and throw them into a stored procedure with some very basic error handling.

What I’m hoping for is either:

  • a quick & dirty dummy’s guide to taking my depressing blob of PL/SQL and get it to execute within a stored procedure OR
  • Any alternative (if a stored proc isn’t appropriate) which offers the same functionality, ie. a way to execute a bunch of SQL statements and rollback if any of these statements throw an exception.

About my attempts – I’ve tried copying portions of my SQL scripts into a stored procedure but they always fail to compile with the error ‘PLS-00103 Encountered the symbol when expecting one of the following’. eg.

CREATE OR REPLACE PROCEDURE ETL_2618A AS 
   BEGIN
       DROP SEQUENCE "METER_REPORTING"."SEQ_2618"; 
       CREATE SEQUENCE SEQ_2618; 
END ETL_2618A;

Oracle documentation isn’t terribly accessible and I’ve not had much luck with googling/searching StackOverflow, but I apologise if I’ve missed something obvious.

  • 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-04T17:36:34+00:00Added an answer on June 4, 2026 at 5:36 pm

    To do DDL in PL/SQL you need to use dynamic sql.

    CREATE OR REPLACE PROCEDURE testProc IS
       s_sql    VARCHAR2(500);
    BEGIN
       s_sql := 'DROP SEQUENCE "METER_REPORTING"."SEQ_2618"';
       EXECUTE IMMEDIATE s_sql;
    
    
       s_sql := 'CREATE SEQUENCE "METER_REPORTING"."SEQ_2618"';
       EXECUTE IMMEDIATE s_sql;
    
    EXCEPTION
    
       WHEN OTHERS THEN
           NULL;
    end testProc;
    /
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now I have a mysql database with a table userphone(id, phone, type,userid) and
this is what i have right now Drawing an RSS feed into the php,
Right now I have an application that loads a bunch of thumbnail images into
Right now I've programmed a method for use in a swing program that is
Right now importing an FLV and embedding it in the timeline of a movieclip
Right now we have a dll file that contains all the database calls and
Right now I am writing a little c++ console program using VS2010 Express. The
Right now, I'm particularly interested in reading the data from MP3 files (ID3 tags?),
Right now I have a database (about 2-3 GB) in PostgreSQL, which serves as
right now I have this pulling data for the current week, but the week

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.