Store procedure help please

Oracle Stored procedure query..
I have 1 table with below schema.
ID empID clsID Year Cuser CDatetime
Sample Data:
ID     EMPID     ClsID     Year     Cuser     CDateTime
1     100     2     2000     John     1/1/2000
2     100     3     2000     John     1/1/2000
3     100     4     2000     John     1/1/2000
4     100     5     2000     John     1/1/2000
5     100     6     2000     John     1/1/2000
6     100     7     2000     John     1/1/2000
7     100     8     2001     John     1/1/2000
8     100     2     2001     John     1/1/2000
9     100     3     2001     John     1/1/2000
10     101     9     2000     John     1/1/2000
I need to write a stored procedure which will copy the data from Year 2000 to year 2001. So I can reuse data from yr 2000 to yr 2001.
Conditions:
1. Copy data from 2000 to 2001.
2. If 2001 already has some data, leave those data alone.
3. No duplicate data from 2000 to 2001.
Using cursor variable what is the stored procedure will do the same. I need the stored procedure code, Thanks in advance.

here are some basic query. i'll leave to you the creation of procedure so that you have something work on.
  select [sequence id e.g. sequence_id.nextval],
         empid,
         cisid,
         year,
         cuser,
         cdatetime
    from [table name]
   where (empod,cisid,year,cuser,cdatetime) not in (select empod,cisid,year,cuser,cdatetime
                                                       from table)

Similar Messages

  • The pass 4 days now my iTunes Store is not responding, when I reload it all that comes up is a blank white page that says iTunes Store. Help please!!!! Cannot load my gift card to buy music and such!!!

    The pass 4 days now my iTunes Store is not responding, when I reload it all that comes up is a blank white page that says iTunes Store. Help please!!!! Cannot load my gift card to buy music and such!!!

    I tookyour suggestion and SUCCESS!  I can now access the Itunes Store.  A simple fix, and thanks so much!!.
    Below is the advice you forwarded:
    I found a solution to my problem.
    > start menu
    > accessories,
    > right click on the command prompt icon and choose "run as administrator".
    Once it opens, type in the following command...
    netsh winsock reset
    hit enter
    You should get a message that the winsock reset successful and you will need to reboot your computer.
    Reboot and when I reloaded itunes the store loaded fine.
    Thanks again, -Dean Stoneburner

  • I had 10$ gift card that works only on US. I redeemed the gift card but back in the game i get buy stuff and it says "you cant buy in US store you must swich bla bla bla" i dont want ti swich because the 10 $ works only at the US store. Help please.

    I had 10$ gift card that works only on US. I redeemed the gift card but back in the game i get buy stuff and it says "you cant buy in US store you must swich bla bla bla" i dont want ti swich because the 10 $ works only at the US store. Help please.

    Hello SBentley22,
    I can only imagine how upset I would be to discover that over $1000 in gift card funds seemed to be missing. I certain that I would not do well with the additional complications that you've described either. I apologize for you and your boyfriend having to cope with this situation. Certainly this was never our goal.
    I was unable to locate the purchases or returns that you mention using the information you provided when you signed up for Best Buy Unboxed. I would very much like to look into this situation for you and do what I can to help, but I will need more information to begin. If you will please send me a private message that includes your full name, telephone number, and the Customer Service PIN from the receipt where the gift card was issued, I'll get started with my research.
    Please know that I'm extremely grateful that you took the time to bring your situation to our attention. I look forward to hearing from you.
    Sincerely,
    John|Social Media Specialist | Best Buy® Corporate
     Private Message

  • I can't find pages and keynotes on my imac (ie not in applications folder)after purchasing them from the app store? help please!!!

    can't find pages and keynotes on my imac (ie not in applications folder)after purchasing them from the app store? help please!!!

    Try searching with Spotlight. Click the magnifying glass icon top right corner of your screen.
    If you can't locate the apps, you can re download without being charged again.
    http://support.apple.com/kb/HT2519

  • Store procedure help

    is it possible to write store procedure for inserting records and multiplying them
    description qt rate Amount
    drop procedure a1;
    create or replace procedure a1
    a_description in varchar2,
    a_qt in number,
    a_rate in number,
    a_amount in number)
    as
    begin
    insert into employee_record values (a_description,a_qt,a_rate,a_qt * a_rate);
    end;
    is it possible that column amount calculates the amount itself
    when i try to execute ( 'Hard Drive', 4, 100)
    it gives me an error message .
    wrong number or types of arguments in call to 'INSERT_a1'
    when i try to run it with ('Hard Drive',4,100, 5) it inserts values and also updates column with correct amount which is 400 .
    it would be kind of you if you could show me the a better way to write this store procedure or where i should makes changes.
    so that my amount column calculates the total itself
    thanks

    Hi,
    Someoneelse is right: storing columns that depend entirely on other columns is usually a bad idea. Compute the amount in queries, as needed, or create a view that computes amount.
    If you really must store it in the table, then you can use a trigger, like this:
    CREATE OR REPLACE TRIGGER employee_record_biu
    BEFORE INSERT OR UPDATE OF qt, rate, amount
                                 ON employee_record
    FOR EACH ROW
    BEGIN
        :NEW.amount := :NEW.qt * :NEW.rate;
    END;
    /This will automatically run whenever you issue an INSERT or UPDATE statement that references the columns involved. If that statement provides a value for amount, that value will be ignored. Amount will always be calculated from qt and rate.
    Starting in Oracel 11, you can create a virtual column, which will probably be better than a trigger.
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_7002.htm#sthref7273

  • Procedure Help Please

    I am creating an apex app as part of a personal project and am a bit stuck.
    I have created 2 procedures but I can't figure out how to make them run at the same time, I would ideally like to put them into one single procedure, but every time I try I end up with error warnings.
    the procedures I have are as follows:
    PROCEDURE 1
    CREATE OR REPLACE PROCEDURE upload_new_image
      (p_filename IN VARCHAR2)
    IS
      l_upload_size   INTEGER;
      l_upload_blob   BLOB;
      l_image_id      NUMBER;
      l_image         ORDSYS.ORDImage;
    BEGIN
        -- Get the length, MIME type and the BLOB of the new image from the
        -- upload table. apex_application_files is a synonym for WWV_FLOW_FILES
      SELECT doc_size,
             blob_content
      INTO   l_upload_size,
             l_upload_blob
      FROM apex_application_files
      WHERE name = p_filename;
      -- Insert a new row into the table, returning the newly allocated sequence
      -- number from seq_image_id
      INSERT INTO images
       image_id,
       filename,
       image
      VALUES
       seq_image_id.nextval,
       p_filename,
       ORDSYS.ORDIMAGE.INIT()
      RETURNING image_id
      INTO l_image_id;
      -- lock the row
      SELECT image
      INTO l_image
      FROM images
      WHERE image_id = l_image_id
      FOR UPDATE;
    -- copy the blob into the ORDImage BLOB container
    DBMS_LOB.COPY( l_image.source.localData, l_upload_blob, l_upload_size );
    l_image.setProperties(); -- just in case
      UPDATE images
      SET image = l_image
      WHERE image_id = l_image_id;
      -- clear from upload table
      DELETE FROM apex_application_files 
      WHERE name = p_filename;
      COMMIT;
      EXCEPTION
      WHEN others
      THEN htp.p(SQLERRM);
    END upload_new_image;PROCEDURE 2
    CREATE OR REPLACE PROCEDURE create_blob_thumbnail (p_image_id IN INTEGER) IS
      l_orig          ORDSYS.ORDImage;
      l_thumb         ORDSYS.ORDImage;
      l_blob_thumb    BLOB;
    BEGIN
      -- lock row
      SELECT image
      INTO l_orig
      FROM images
      WHERE image_id = p_image_id FOR UPDATE;
      l_thumb := ORDSYS.ORDImage.Init();
      dbms_lob.createTemporary(l_thumb.source.localData, true);
      ORDSYS.ORDImage.processCopy(l_orig,
                                  'maxscale=128 128',
                                  l_thumb);
      UPDATE images
      SET thumbnail = l_thumb.source.localData
      WHERE image_id = p_image_id;
      dbms_lob.freeTemporary(l_thumb.source.localData);
      COMMIT;
    END;Any help would be greatly appreciated
    Edited by: BluShadow on 30-Nov-2012 14:45
    added {noformat}{noformat} tags. Please read {message:id=9360002} and learn to do this yourself in future posts                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    974264 wrote:
    I have created 2 procedures but I can't figure out how to make them run at the same timeRunning things in parallel would require setting them running as scheduled jobs so they run in their own transactional sessions. You won't be able to run two procedures in parallel from the same session.
    However you should certainly be able to combine two procedures into one if that is all you require.

  • Hi I don't have face time in my mini iPad I got it from UAE I don't live there I need is desperately please help and tell me should I visit apple store near help please

    Tell me what to do please help me

    All iPad from the UAE do not have FaceTime and it cannot be downloaded or installed.

  • Sci-15c purchased app survived the upgrade to ios 6.1.2 on ipad3 and iphone 4s, but missing on ipad mini.  App store doesn't show app and it doesn't appear on my purchases.  Whats the point of icloud and the app store?  Help please.

    Why is the excellent hp-15c emulator, sci-15c, which I purchased years ago, missing from my ios upgraded ipad and not shown in my purchased apps nor in the store?
    The app did get properly reatored to my other ipad 2 and 3 and iphone 4s
    Thanks in advance for any suggestions

    Check iTunes on the computer you normally sync with. The app might still be there and you could sync it back onto your iPad mini. Then see if it still works on the most recent iPads.

  • Updates tab won't load in the app store.. help please!

    Recently updated my iPhone 4s to iOS 6.1 and I have apps to update but my updates tab in the app store won't load!
    I've tried everything I can, restarting my phone, turning on and off wifi, crossing the app and opening it again but none have worked so far!

    Same problem here, I've tried everything and nothing is working.
    Very very disappointed.

  • I've got ipad 4th generation but I can not connect to iTunes .when press video or music it ask me to g iTunes Store when press that the iTunes come up with white page and blue icon saying can connect to iTunes Store .any help please .thanks

    I can not connect to iTunes from ipad

    This what Apple's iTunes specific error codes support article says about that particular error.
    Errors 3000-3999 (3004, 3013, 3014, 3018, 3164, 3194, and so on): Error codes in the 3000 range generally mean that iTunes cannot contact the update server (gs.apple.com) on ports 80 or 443.
    Update to the latest version of iTunes.
    Verify the computer's date and time are accurate.
    Check that your security or firewall software is not interfering with ports 80 or 443, or with the server gs.apple.com.
    Follow Troubleshooting security software. Often, uninstalling third-party security software will resolve these errors.
    An entry in your hosts file may be redirecting requests to gs.apple.com (see "Unable to contact the iOS software update server gs.apple.com" above).
    Internet proxy settings can cause this issue. If you are using a proxy, try without using one.
    Test restoring while connected to a known-good network.

  • How to create store procedure using cursor, and looping condition with exce

    Hi,
    I am new in pl/sql development , please help me for follwoing
    1. I have select query by joining few tables which returns lets say 100 records.
    2. I want to insert records into another table(lets say table name is tbl_sale).
    3. If first record is inserted into tbl_sale,and for next record if value is same as first then update into tbl_sale else
    insert new row
    4. I want to achieve this using store procedure.
    Please help me how to do looping,how to use cursor and all other necessary thing to achieve this.

    DECLARE
       b   NUMBER;
    BEGIN
       UPDATE tbl_sale
          SET a = b
        WHERE a = 1;
       IF SQL%ROWCOUNT = 0
       THEN
          INSERT INTO tbl_sale
                      (a
               VALUES (b
       END IF;
    END;note : handle exceptions where ever needed
    Regards,
    friend
    Edited by: most wanted!!!! on Mar 18, 2013 12:06 AM

  • Call store procedure from pre-mapping

    Hi,
    I am currently working on OWB client version 10.2.0.4.36.My requirement is to call store procdure from pre-mapping tranformation.How to achieve this & how to pass parameters to the store procedure?
    Please let me know.
    Thanks,
    Siva

    Thanks for the quick reply.I am doing the same way as suggested.But am getting warning,when I validate it and is expecting to synchronize it.What warning you got exactly and i think you have not deployed the procedure.
    The reason for this procedure is to select max value from one of the table and then drop & recreate the sequence with max value + 1.
    Inside the procedure,am doing this all dynamically.which means am passing Columnname,tablename & sequencename to this procedure.
    Do you think is this good approach or any other advisable approach?Can you explain you requirement then only we can suggest the better way .
    Cheers
    Nawneet

  • Help please with iPhoto Update on Maverick. Not updating!

    iPhoto not work and not updating with apple store.
    Help please!

    I'm having the same exact problem after upgrading to Maverick.
    The App Store shows I have two updates, one for iPhoto and and one for iMovie.  When I try to install, I get the following 3 messages:
    "Update Unavailable with This Apple ID
    This update is for an app downloaded with a different Apple ID. Sign in with that Apple ID and try again."
    "We could not complete your request.
    There was an error in the App Store. Please try again later. (null)"
    "There was an error in the App Store. Please try again later. (null)"
    My macbook pro was a refurbished computer purchased online through Apple.com two years ago.  It arrived preinstalled with Lion and did not come with any DVD's or installation disks.  It is an early 2011 Macbook Pro. 
    It appears that I have iPhoto 9.1.5.  After downloading Maverick the application will not open now. The application icon has a circle with a slash through it. 
    It appears that I currently have iMovie 11 and seems to be working fine.  I am able to access and open the application.
    How do I resolve this problem so I can update iPhoto to work again?
    Thanks!

  • Using store procedures with SQLJ - please help!

    I have two questions:
    1.I wrote simple test appllication that uses SQLJ to run store
    procedures from SQL package. It compiles and work fine from
    JDeveloper 3 if I use java version JDK1.2.2_JDeveloper.
    It compiles OK in regular JDK1.2.2 but raise the following
    exception when running:
    profile
    com.itrade.trserver.truser.dbqueries.ItrHistorian_SJProfile0 not
    found: java.io.InvalidClassException: [Ljava.lang.Object;;
    Serializable is incompatible with Externalizable
    Does it mean that I have to use JDeveloper JDK?
    2.When I give other then default package for *.sqlj file the
    *.sqlj file is added to project but I cannot see it in specified
    package (the *.sqlj file is created in the its directory).
    After I compile the project the I can see *.java file in the
    specified package, but compiler gives errors about redefined
    symbols. If I remove *.sqlj file from the project it compiles OK.
    What I am doing wrong?
    Yakov Becker
    null                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Thank you for the response.
    I don't create jar file. I run it from JDeveloper environment.
    What do you mean by "I made sure to also copy over the
    : the .ser file"? What purpose of the *.ser file in this case?
    Yakov
    JDeveloper Team (guest) wrote:
    : I have come across this error before..
    : I'm assuming that your jar file is in the classpath as
    : specified in the Jserv configuration?
    : When I had the error, I made sure to also copy over the
    : the .ser file.
    : In my case, I happened to have both my class files and
    : the .ser file outside of a jar file and it worked..
    : Hope this helps!
    : Yakov Becker (guest) wrote:
    : : I have two questions:
    : : 1.I wrote simple test appllication that uses SQLJ to run
    store
    : : procedures from SQL package. It compiles and work fine from
    : : JDeveloper 3 if I use java version JDK1.2.2_JDeveloper.
    : : It compiles OK in regular JDK1.2.2 but raise the following
    : : exception when running:
    : : profile
    : : com.itrade.trserver.truser.dbqueries.ItrHistorian_SJProfile0
    : not
    : : found: java.io.InvalidClassException: [Ljava.lang.Object;;
    : : Serializable is incompatible with Externalizable
    : : Does it mean that I have to use JDeveloper JDK?
    : : 2.When I give other then default package for *.sqlj file the
    : : *.sqlj file is added to project but I cannot see it in
    : specified
    : : package (the *.sqlj file is created in the its directory).
    : : After I compile the project the I can see *.java file in the
    : : specified package, but compiler gives errors about redefined
    : : symbols. If I remove *.sqlj file from the project it
    compiles
    : OK.
    : : What I am doing wrong?
    : : Yakov Becker
    null                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • I keep trying to buy a song on the itunes store but every time I enter my apple id it says "Cannot connect to iTunes store" help please!

    I keep trying to buy a song on the itunes store but every time I enter my apple id it says "Cannot connect to iTunes store" help please!

    Hello seth53,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    Can't connect to the iTunes Store
    http://support.apple.com/kb/ts1368
    Best of luck,
    Mario

Maybe you are looking for

  • How can I delete an old Apple ID account?

    Every time I have to enter my Apple ID, on the Apple site or on iTunes, it is auto-filled with an old, never-used Apple ID email name and password.  I have to use the delete key to XXX-out both and then reenter my current Apple ID.  Any suggestions o

  • Broken ipod screen

    have a broken screen on my ipod touch how do i go about gettin this fixed

  • Black Restart Message-- happening every few minutes!

    A few days ago, I was browsing the web, and a faded gray screen appeared with a restart message. It says something to the effect of "You need to restart your computer. Please hold down the restart button, etc." in about four different languages. So I

  • Function for column validation in SQl Loader control file.

    Hello Gurus, We have an requirement to create a function to validate all date and number columns in control file, and return 0/1 accordingly to valid_column which is last column . I have developed the function which accepts the number and date type c

  • Billing document automatically archiving

    this is the error comming wen i m creating the billing and saving it its automatically archiving how to solve this issu please help if ned i ll provide more information.... Billing document 90000022 does not exist Message no. VF041 Diagnosis The bill