FAQ
Hi vibhor,

If there is no difference between functions and stored
procedures, my doubt i show does the server know whether we are writing a
function or stored procedure. As per my knowledge in oracle a function must
return a value where as stored procedure cannot. IS this also true in
postgresql. If yes how can we acheive it?


thanks and regards
sivakiran.B

Search Discussions

  • Thomas Kellerer at Mar 11, 2011 at 8:30 am

    siva kiran balijepalli, 11.03.2011 06:08:
    Hi vibhor,
    If there is no difference between functions and stored procedures, my doubt i show does the server know whether we are writing a function or stored procedure. As per my knowledge in oracle a function must return a value where as stored procedure cannot. IS this also true in postgresql. If yes how can we acheive it?
    thanks and regards
    sivakiran.B
    postgres does not have stored procedures, it only has functions.
  • Vibhor Kumar at Mar 11, 2011 at 8:37 am

    On Mar 11, 2011, at 10:38 AM, siva kiran balijepalli wrote:

    If there is no difference between functions and stored procedures, my doubt i show does the server know whether we are writing a function or stored procedure. As per my knowledge in oracle a function must return a value where as stored procedure cannot. IS this also true in postgresql. If yes how can we acheive it?

    As I have already mentioned, PG Only Support Functions and whatever you want to implement/acheive you can do with Functions too.
    About returning novalue from Function, you can write a function which will not return any value (return VOID).
    Following is an link which you can use for information on Functions.

    http://www.postgresql.org/docs/current/static/sql-createfunction.html

    Thanks & Regards,
    Vibhor Kumar
    EnterpriseDB Corporation
    The Enterprise PostgreSQL Company
    vibhor.kumar@enterprisedb.com
    Blog:http://vibhork.blogspot.com
  • Chetan Suttraway at Mar 14, 2011 at 6:29 am
    On Fri, Mar 11, 2011 at 2:09 PM, Vibhor Kumar wrote:
    On Mar 11, 2011, at 10:38 AM, siva kiran balijepalli wrote:

    If there is no difference between functions and stored
    procedures, my doubt i show does the server know whether we are writing a
    function or stored procedure. As per my knowledge in oracle a function must
    return a value where as stored procedure cannot. IS this also true in
    postgresql. If yes how can we acheive it?


    As I have already mentioned, PG Only Support Functions and whatever you
    want to implement/acheive you can do with Functions too.
    About returning novalue from Function, you can write a function which will
    not return any value (return VOID).
    Following is an link which you can use for information on Functions.

    http://www.postgresql.org/docs/current/static/sql-createfunction.html

    Thanks & Regards,
    Vibhor Kumar
    EnterpriseDB Corporation
    The Enterprise PostgreSQL Company
    vibhor.kumar@enterprisedb.com
    Blog:http://vibhork.blogspot.com


    --
    Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
    To make changes to your subscription:
    http://www.postgresql.org/mailpref/pgsql-novice
    Do check below link:
    http://www.postgresonline.com/journal/archives/15-Stored-Procedures-in-PostgreSQL.html

    --
    Chetan Sutrave
    Senior Software Engineer
    EnterpriseDB Corporation
    The Enterprise PostgreSQL Company
    Phone: +91.20.30589523

    Website: www.enterprisedb.com
    EnterpriseDB Blog: http://blogs.enterprisedb.com/
    Follow us on Twitter: http://www.twitter.com/enterprisedb

    This e-mail message (and any attachment) is intended for the use of the
    individual or entity to whom it is addressed. This message contains
    information from EnterpriseDB Corporation that may be privileged,
    confidential, or exempt from disclosure under applicable law. If you are not
    the intended recipient or authorized to receive this for the intended
    recipient, any use, dissemination, distribution, retention, archiving, or
    copying of this communication is strictly prohibited. If you have received
    this e-mail in error, please notify the sender immediately by reply e-mail
    and delete this message.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-novice @
categoriespostgresql
postedMar 11, '11 at 5:09a
activeMar 14, '11 at 6:29a
posts4
users4
websitepostgresql.org
irc#postgresql

People

Translate

site design / logo © 2022 Grokbase