Function return OUT mode

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hastha23
    New Member
    • May 2007
    • 13

    Function return OUT mode

    Hi friends,

    Is possible function return values use OUT mode?
    Give some coding pls..

    Hastha23.
  • pradeep kaltari
    Recognized Expert New Member
    • May 2007
    • 102

    #2
    Originally posted by hastha23
    Hi friends,

    Is possible function return values use OUT mode?
    Give some coding pls..

    Hastha23.
    Hi,
    Functions can return only one value, which is returned to the calling body by using the RETURN statement. The data type of the value being returned needs to be specified.

    Also, check the following thread,


    Regards,
    Pradeep.

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      Yes u can use OUT mode in functions.

      But the only restriction is the function can't be called directly at SQL> prompt.

      It must be called from within an anonymous block.

      Comment

      • hastha23
        New Member
        • May 2007
        • 13

        #4
        Dear All,

        i wrote one functions this is correct? ..any body give suggestions please.
        functions inside commit is ok?

        create or replace function arun
        return number
        is
        begin
        insert into x values('java',3 22);
        commit;
        return 1;
        end;
        /

        is possible from call function from select.?

        Comment

        • frozenmist
          Recognized Expert New Member
          • May 2007
          • 179

          #5
          Hi Arun,
          Are you getting any error?
          If you are getting error as 'table does not exist' then give
          insert into <schemaname>.x values('java',3 22);
          instead of
          insert into x values('java',3 22);
          The rest is correct, the function should compile.

          Cheers

          Comment

          Working...