Results 1 to 2 of 2
  1. #1
    Join Date
    May 2013
    Posts
    1

    Unanswered: how to detect the function name which is being run

    Hi All,

    I have a case where I need to detect the function name from the function I'm running now.
    I was working on MS SQL database before, and I can use @@procid to get the procedure name I'm running, inside it's own procedure.

    example in MS SQL :
    ----------------------------------------
    create proc dbo.myproc
    as

    select @@procid

    return 0
    ----------------------------------------

    If I execute this :
    exec dbo.myproc

    it will return :
    myproc

    I'm wondering how can I do this in Postgree, without using hardcode inside the function.

    can anyone help ?
    thanks before..

  2. #2
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Quote Originally Posted by kaoru View Post
    in Postgree
    There is no DBMS called Postgree.
    It's either Postgres or PostgreSQL (or simply PG if the context is clear).

    And no, I don't think there is such a function in Postgres
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags: http://www.dbforums.com/misc.php?do=bbcode#code

    Tips for good questions:

    http://tkyte.blogspot.de/2005/06/how...questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html

Posting Permissions

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