Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Stored proc to fetch row from 1 table and insert into another and delete from the 1st

  1. #1
    Junior Member
    Join Date
    Aug 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Stored proc to fetch row from 1 table and insert into another and delete from the 1st

    create or replace package lcp_archive
    as
    procedure lcp_archive_proc (check_id_var in number, status_var out varchar(1));
    end lcp_archive;


    create or replace package body lcp_archive
    as

    procedure lcp_archive_proc (check_id_var in number, status_var out varchar(1))
    as

    fee_var number;
    closed_date_var date;
    addedby_var varchar2(30);
    amount_var number;
    begin
    select fee
    ,closed_date
    ,addedby
    ,amount
    into fee_var
    ,closed_date_var
    ,addedby_var
    ,amount_var
    from lc_check
    where check_id = check_id_var;


    insert into lc_check_archive values (check_id_var ,fee_var ,closed_date_var ,addedby_var ,amount_var);

    delete from lc_check where check_id = check_id_var;

    exception when (no_data_found)
    then status_var := 'f';

    else status_var := 't';

    end lcp_archive_proc;

    end lcp_archive;





    begin
    lcp_archive.lcp_archive_proc(12345,st_v);
    dbms_output.put_line('status is'||st_v);
    end
    Last edited by shashijsr; September 3rd, 2012 at 12:15 PM.


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Stored proc to fetch row from 1 table and insert into another and delete from the

    This section is for saying hi, not for asking questions. See the sticky at the top of this section, and read the forum rules.
    Also use [code=java] before your code and [/code] after your code.

  3. #3
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Stored proc to fetch row from 1 table and insert into another and delete from the

    Thread moved from Members introductions. I don't see a question, or any java related code. Unless specified as related to java, this may be moved to the Other Programming Languages forum
    I'd recommend reading Announcements - JDBC & Databases

Similar Threads

  1. Replies: 1
    Last Post: June 29th, 2012, 01:29 PM
  2. SQLServer Stored Proc. not working as intented
    By dmalisovas in forum JDBC & Databases
    Replies: 2
    Last Post: May 31st, 2012, 01:45 AM
  3. Insert+Update+Delete in one connections?
    By Hurricane in forum JDBC & Databases
    Replies: 5
    Last Post: February 27th, 2012, 10:13 AM
  4. How to Delete selected table data from DB???? HELP
    By lanepulcini in forum JDBC & Databases
    Replies: 0
    Last Post: February 21st, 2012, 07:07 PM
  5. issue in executing Stored Proc
    By Bhawesh Kurmi in forum JDBC & Databases
    Replies: 1
    Last Post: December 8th, 2010, 10:05 AM