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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:14:25+00:00 2026-06-03T16:14:25+00:00

On a small pre-registration database, I’m using the following SQL to generate a VIEW

  • 0

On a small pre-registration database, I’m using the following SQL to generate a VIEW whenever a specific user name is given. I’m using this mainly to get a snapshot whenever a sysadmin suspects duplicate names are registering. This will be done rarely (atmost once per hour), so the database schema shouldn’t be getting excessively big.

CREATE OR REPLACE TRIGGER upd_on_su_entry
    AFTER UPDATE OR INSERT
    ON PRE_REG_MEMBER
    FOR EACH ROW
BEGIN
    IF :new.MEMBER_NAME  = 'SysAdmin Dup Tester' THEN
        EXECUTE IMMEDIATE 'CREATE OR REPLACE VIEW mem_n AS SELECT :old.MEMBER_NAME, COUNT(:old.MEMBER_NAME) FROM MEMBER GROUP BY MEMBER_NAME';
    END IF;
END;

However, this appears to be a bloated, inefficient and erroneous way of working (according to my admin). Is there a fundamental error here ? Can I take an equivalent snapshot some other way?

I’m very new to SQL, so please bear with me.

Also, I want to be using the view as :

public void dups()throws Exception
{
    Calendar cal = Calendar.getInstance();
    jt.setText("Duplicate List at : "+ cal.getTime());
    try{
        rs=stat.executeQuery("select * from upd_on_su_entry");
        while(rs.next())
        {
            jt.append(rs.getString("MEMBER_NAME")+"\t");
            jt.append(rs.getString(2)+"\t");
        }
    }
    catch(Exception e){System.out.print("\n"+e);}
}
  • 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-03T16:14:26+00:00Added an answer on June 3, 2026 at 4:14 pm

    There seem to be some misunderstandings here.

    1.) views are basically stored sql statements, not stored sql results, so your view will always display the data as it is at the point of querying the view.

    2.) Never ever use DDL (create statements) and similar during normal processing of an application. Its just not the way databases are intended to work.

    If you want a snapshot at a point in time, create a secondary table which contains all the columns of the original table plus a snapshot time stamp.

    When ever you want to make a snapshot copy all the data you want from the original table into the snapshot table while adding the current time stamp.

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

Sidebar

Related Questions

I'm running this small C# test program launched from a pre-commit batch file private
A small - little question. I have seen many application having buttons like following.
A small portion of my app contains a view were people can take brief
I have just written a small utility to be used in a pre-build event.
I have limited SQL background, basically a small amount of manipulation through HTML and
I am using Magento and I'm trying to fix a small issue I have
Folks, My Issue Why is an HSQLDB file-based database I have pre-populated with a
I calculated following data frame of maximimum response time of a server with pre-defined
I just finished a small project where changes were required to a pre-compiled, but
I am writing a (very small) framework for checking pre- and postconditions of methods.

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.