Results 1 to 7 of 7

Thread: procedures

  1. #1
    Join Date
    Feb 2004
    Posts
    5

    Unanswered: procedures

    how do i write a pl/sql procedure to add two columns say salary and commission in employee table( totalsal as the output parameter?
    thanx in advance

  2. #2
    Join Date
    Apr 2003
    Location
    Minneapolis, MN
    Posts
    273
    If You want to add columns to the tables, You do not have to write procedure for that.

    ALTER TABLE <name> ADD (
    salary <datatype>,
    commission <datatype>
    );
    Bhavin

    MS Computer Science
    OCP DBA 9i/8i

  3. #3
    Join Date
    Feb 2004
    Posts
    5
    but i want to write a procedure to do that ..can you help me plz

  4. #4
    Join Date
    Apr 2003
    Location
    Minneapolis, MN
    Posts
    273
    Originally posted by dbkid
    but i want to write a procedure to do that ..can you help me plz
    CREATE OR REPLACE PROCEDURE add_columns IS
    BEGIN
    EXECUTE IMMEDIATE 'ALTER TABLE <name> ADD (
    salary <DATATYPE>,
    commission <DATATYPE> )';
    END;
    /


    please correct any syntax error.
    Bhavin

    MS Computer Science
    OCP DBA 9i/8i

  5. #5
    Join Date
    Feb 2004
    Posts
    5
    thank you,
    is there any way i can do that using DMLs ...bcoz i want to call the procedure in another program and send the output to a different table
    thanx in advance

  6. #6
    Join Date
    Feb 2004
    Posts
    7
    Which language you want to use? I believe all popular languages can do that.
    But because DML run on server side, the server will not send back the reponse to you except a flag.

    Originally posted by dbkid
    thank you,
    is there any way i can do that using DMLs ...bcoz i want to call the procedure in another program and send the output to a different table
    thanx in advance

  7. #7
    Join Date
    Feb 2004
    Posts
    11

    Re: procedures

    Originally posted by dbkid
    how do i write a pl/sql procedure to add two columns say salary and commission in employee table( totalsal as the output parameter?
    thanx in advance

    Hi are you asking to add column values and return that value into totalsal or asking adding two new columns to the table?
    learning Oracle

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •