Can postgres functions return multiple values???

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ravysters
    New Member
    • May 2008
    • 27

    Can postgres functions return multiple values???

    hi.. i have a function which has 5 out parameters... can i return those in a postgre function...
  • rski
    Recognized Expert Contributor
    • Dec 2006
    • 700

    #2
    of course you can using OUT parameters. If you don't know how put you function/problem here and i'll try to help you.

    Comment

    • ravysters
      New Member
      • May 2008
      • 27

      #3
      thank u so much.. i ll do that

      Comment

      • ravysters
        New Member
        • May 2008
        • 27

        #4
        i ll paste an orcale procedure here... i have to convert it into a postgres function...


        CREATE OR REPLACE PROCEDURE ORCHCTADDDOCUME NT
        (p_inxml IN OUT CLOB,
        p_bravainfos OUT VARCHAR2,
        p_duptitles OUT VARCHAR2,
        p_outxml OUT CLOB,
        p_outdocids OUT VARCHAR2
        )
        AS





        will this declaration work in postgresql????

        Comment

        • rski
          Recognized Expert Contributor
          • Dec 2006
          • 700

          #5
          Code:
          CREATE OR REPLACE PROCEDURE ORCHCTADDDOCUMENT
          (IN OUT p_inxml CLOB,
          OUT p_bravainfos VARCHAR2,
          OUT p_duptitles VARCHAR2,
          OUT p_outxml CLOB,
          OUT p_outdocids VARCHAR2
          )
          AS
          but you must change datatypes, there are no varchar2 and clob in postgresql

          Originally posted by ravysters
          i ll paste an orcale procedure here... i have to convert it into a postgres function...


          CREATE OR REPLACE PROCEDURE ORCHCTADDDOCUME NT
          (p_inxml IN OUT CLOB,
          p_bravainfos OUT VARCHAR2,
          p_duptitles OUT VARCHAR2,
          p_outxml OUT CLOB,
          p_outdocids OUT VARCHAR2
          )
          AS





          will this declaration work in postgresql????

          Comment

          • ravysters
            New Member
            • May 2008
            • 27

            #6
            ya ya... i change them.... is there a row count function in postgres and is there a writetoCLOB funciton in postgres

            Comment

            • rski
              Recognized Expert Contributor
              • Dec 2006
              • 700

              #7
              Originally posted by ravysters
              ya ya... i change them.... is there a row count function in postgres and is there a writetoCLOB funciton in postgres
              To count rows you can use agregate function COUNT(*). There isn't CLOB type in Postgres so there is no writetoCLOB function. If I'm right you can implement CLOB with varchar.

              Comment

              • ravysters
                New Member
                • May 2008
                • 27

                #8
                oh ok ok..thanks for all the help... it was really helpful.. thank u very much

                Comment

                Working...