Simple Oracle Store procedure

  • Hi,

    I want to write simple oracle store procedure like in sql server.

    Is it necessary to use cursor in oracle store procedure.

    we don't use cursor in sql server.

    What are the best practices for creatig oracle store procedure.

    Is there any good forum of oracle like this forum.

    Thanks

    [font="Verdana"]Regards
    Kumar Harsh[/font]

    :unsure:

  • Hi,

    --IN SQL

    CREATE PROC proc1

    @i int

    AS

    BEGIN

    WHILE @i > 0

    BEGIN

    print 'SQL WHILE TESTING'

    SELECT @i = @i-1

    END

    END

    --IN ORACLE

    CREATE OR REPLACE PROCEDURE proc1

    (iv_i IN NUMBER)

    AS

    v_i NUMBER(10,0) :=iv_i;

    BEGIN

    WHILE v_i > 0

    LOOP

    BEGIN

    DBMS_OUTPUT.PUT_LINE('ORACLE WHILE TESTING');

    v_i := v_i - 1;

    END;

    END LOOP;

    END

    The good forums for oracle is working with oracle in this site,

    Post the entire/query in the working with oracle forums

    🙂

  • AskTom is a good Oracle forum

    You can also get all the Oracle docs from the oracle website

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply