Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2011
    Posts
    1

    Unanswered: INSERT using SEQUENCE

    Quote Originally Posted by The_Duck View Post
    when in doubt, run in sqlplus first. do not rely on a gui application which you probably are not applying into a production environment.
    this is the procedure tryin to insert values into table using sequence

    CREATE OR REPLACE PROCEDURE TempInsert1
    AS
    BEGIN
    INSERT INTO table1 (id,dateofjoining)VALUES (First.nextval,sysdate);
    END;

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    What's the question?

  3. #3
    Join Date
    Sep 2011
    Posts
    75
    Hello,

    Did you provide the parameters while executing the SP in TOAD

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    What "parameters"? @nithinkumar1519's procedure doesn't contain any.

  5. #5
    Join Date
    Sep 2011
    Location
    Hyderabad
    Posts
    18

    vithal reddy

    you should execute procedure using bind variables
    sql>var x varchar2
    sql>var y number
    sql>exec :x,:y sp_get_inventory(inputdata)
    sql>print

  6. #6
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Guys, please, read the whole discussion.

    FlashMagnuM posted his question in 2009.
    nithinkumar1519 yesterday hijacked his topic and posted another question.

    So why do you keep solving a 2-years old problem?

  7. #7
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Based on a user request, I've split this thread off from http://www.dbforums.com/oracle/16466...dure-toad.html because it seems to be a completely different discussion. The transition was tough for me to follow because the first questionable post includes a quote from the end of the other message thread, but takes a two year old thread in a whole new direction.

    If you have questions, follow the link backwards to the previous thread. If there are objections to my splitting the thread, I can put them back together.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  8. #8
    Join Date
    Sep 2011
    Posts
    75
    Quote Originally Posted by nithinkumar1519 View Post
    this is the procedure tryin to insert values into table using sequence

    CREATE OR REPLACE PROCEDURE TempInsert1
    AS
    BEGIN
    INSERT INTO table1 (id,dateofjoining)VALUES (First.nextval,sysdate);
    END;
    Hello,

    I hope the below links are helpful

    sql - How can I insert multiple rows into oracle with a sequence value? - Stack Overflow

    Use sequence in insert command : Sequence Value**Sequence**Oracle PL / SQL

Posting Permissions

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