By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,982 Members | 1,939 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,982 IT Pros & Developers. It's quick & easy.

Can postgres functions return multiple values???

P: 27
hi.. i have a function which has 5 out parameters... can i return those in a postgre function...
Jun 4 '08 #1
Share this Question
Share on Google+
7 Replies


Expert 100+
P: 700
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.
Jun 4 '08 #2

P: 27
thank u so much.. i ll do that
Jun 4 '08 #3

P: 27
i ll paste an orcale procedure here... i have to convert it into a postgres function...


CREATE OR REPLACE PROCEDURE ORCHCTADDDOCUMENT
(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????
Jun 5 '08 #4

Expert 100+
P: 700
Expand|Select|Wrap|Line Numbers
  1. CREATE OR REPLACE PROCEDURE ORCHCTADDDOCUMENT
  2. (IN OUT p_inxml CLOB,
  3. OUT p_bravainfos VARCHAR2,
  4. OUT p_duptitles VARCHAR2,
  5. OUT p_outxml CLOB,
  6. OUT p_outdocids VARCHAR2
  7. )
  8. AS
  9.  
but you must change datatypes, there are no varchar2 and clob in postgresql

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


CREATE OR REPLACE PROCEDURE ORCHCTADDDOCUMENT
(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????
Jun 5 '08 #5

P: 27
ya ya... i change them.... is there a row count function in postgres and is there a writetoCLOB funciton in postgres
Jun 5 '08 #6

Expert 100+
P: 700
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.
Jun 5 '08 #7

P: 27
oh ok ok..thanks for all the help... it was really helpful.. thank u very much
Jun 5 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.