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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:00:42+00:00 2026-05-14T02:00:42+00:00

I much prefer using this ’embedded’ style inserts in a pl/sql block (opposed to

  • 0

I much prefer using this ’embedded’ style inserts in a pl/sql block (opposed to the execute immediate style dynamic sql – where you have to delimit quotes etc).

-- a contrived example
PROCEDURE CreateReport( customer IN VARCHAR2, reportdate IN DATE )
BEGIN

   -- drop table, create table with explicit column list
   CreateReportTableForCustomer;

   INSERT INTO TEMP_TABLE 
   VALUES ( customer, reportdate );
END;
/

The problem here is that oracle checks if ‘temp_table’ exists and that it has the correct number of colunms and throws a compile error if it doesn’t exist.

So I was wondering if theres any way round that?! Essentially I want to use a placeholder for the table name to trick oracle into not checking if the table exists.

EDIT:

I should have mentioned that a user is able to execute any ‘report’ (as above). A mechanism that will execute an arbitrary query but always write to the temp_table ( in the user’s schema). Thus each time the report proc is run it drops the temp_table and recreates it with, most probably, a different column list.

  • 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-05-14T02:00:42+00:00Added an answer on May 14, 2026 at 2:00 am

    You could use a dynamic SQL statement to insert into the maybe-existent temp_table, and then catch and handle the exception that occurs when the table doesn’t exist.

    Example:

    execute immediate 'INSERT INTO '||TEMP_TABLE_NAME||'  VALUES ( :customer, :reportdate )' using customer, reportdate;
    

    Note that having the table name vary in a dynamic SQL statement is not very good, so if you ensure the table names stay the same, that would be best.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would much prefer to do this without catching an exception in LoadXml() and
I'm doing some Android development, and I much prefer Visual Studio, but I'll have
Much related to this question , we have a scenario on my team where
How much should one DataSet represent? Using the example of an ordering system: While
How much database performance overhead is involved with using C# and LINQ compared to
I have general question regarding the use of pointers vs. references in this particular
How much do web developers earn? What is their salary?
How much less libraries are there for Mono than for Java? I lack the
Pretty much every other editor that isn't a vi descendant (vim, cream, vi-emu) seems
As much as we would all like to say it is a benefit to

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.