Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Location
    seattle, wa
    Posts
    2

    Unanswered: oracle procedure help

    Hello, I am trying to write a procdure to call a record from a table and insert in to another table. I am a noviceThis is what I got so far but it does not want to compile. Any help would be appreciated.

    CREATE OR REPLACE PROCEDURE final_insert IS
    BEGIN
    INSERT INTO final_dist
    (network_id, min_distance, max_distance)
    VALUES
    (select network_id, min(distance), max(distance)
    from inter_dist
    group by network_id);
    END final_insert;
    /

  2. #2
    Join Date
    May 2003
    Location
    France
    Posts
    112

    Re: oracle procedure help

    CREATE OR REPLACE PROCEDURE final_insert IS
    BEGIN
    INSERT INTO final_dist
    (network_id, min_distance, max_distance)
    (select network_id, min(distance), max(distance)
    from inter_dist
    group by network_id);
    END final_insert;


    Originally posted by yongsu
    Hello, I am trying to write a procdure to call a record from a table and insert in to another table. I am a noviceThis is what I got so far but it does not want to compile. Any help would be appreciated.

    CREATE OR REPLACE PROCEDURE final_insert IS
    BEGIN
    INSERT INTO final_dist
    (network_id, min_distance, max_distance)
    VALUES
    (select network_id, min(distance), max(distance)
    from inter_dist
    group by network_id);
    END final_insert;
    /

  3. #3
    Join Date
    Mar 2004
    Location
    seattle, wa
    Posts
    2

    Re: oracle procedure help

    thank you!!

  4. #4
    Join Date
    Oct 2003
    Posts
    10

    Re: oracle procedure help

    Syntax for insert statement is wrong, remove the VALUES from insert statement and try.


    Originally posted by yongsu
    Hello, I am trying to write a procdure to call a record from a table and insert in to another table. I am a noviceThis is what I got so far but it does not want to compile. Any help would be appreciated.

    CREATE OR REPLACE PROCEDURE final_insert IS
    BEGIN
    INSERT INTO final_dist
    (network_id, min_distance, max_distance)
    VALUES
    (select network_id, min(distance), max(distance)
    from inter_dist
    group by network_id);
    END final_insert;
    /

Posting Permissions

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