Re: [GENERAL] tab_to_sting

2014-07-29 Thread David G Johnston
Ramesh T wrote > Hi, > when i ran below statement its working fine.. >select string_agg(part_id::text,':') from part; > But, > SELECT tab_to_largeStringcheck(cast(string_agg(part_id::text,':')as > t_varchar2_tab)) FROM part > > > [image: Inline image 1] > > when i ran like > > SELECT > qa

Re: [GENERAL] tab_to_sting

2014-07-25 Thread Ramesh T
Hi, when i ran below statement its working fine.. select string_agg(part_id::text,':') from part; But, SELECT tab_to_largeStringcheck(cast(string_agg(part_id::text,':')as t_varchar2_tab)) FROM part [image: Inline image 1] when i ran like SELECT qa.tab_to_largeStringcheck(string_agg(part_id

Re: [GENERAL] tab_to_sting

2014-07-24 Thread Adrian Klaver
On 07/24/2014 08:03 AM, Ramesh T wrote: I have try select string_agg(partname,':') from part_tab;its return same, ERROR: function string_agg(bigint, unknown) does not exist LINE 1: select string_agg(part_id,':') from part; Try: select string_agg(part_id::text,':') from part;

Re: [GENERAL] tab_to_sting

2014-07-24 Thread Ramesh T
I have try select string_agg(partname,':') from part_tab;its return same, ERROR: function string_agg(bigint, unknown) does not exist LINE 1: select string_agg(part_id,':') from part; ^ HINT: No function matches the given name and argument types. You might need to add explicit

Re: [GENERAL] tab_to_sting

2014-07-24 Thread Ramesh T
i ran the \df string_agg is their but retuns like ERROR: function string_agg(character varying) does not exist LINE 2: qa.tab_to_largestringcheck(cast(string_agg(part_num)as t_var... ^ HINT: No function matches the given name and argument types. You might

Re: [GENERAL] tab_to_sting

2014-07-24 Thread Ramesh T
HI, when i use string_agg function it returns string_agg(bigint) does'nt exist. when "array_string" function it's return can't convert bigint to the t_varchar2_tab. i have questiont_varcha2_tab type is available on postgres 9.3..? i need it please let me kno

Re: [GENERAL] tab_to_sting

2014-07-24 Thread Ramesh T
SELECT qa.tab_to_largestringcheck(cast(array_agg(part_id)as t_varchar2_tab),':')FROM qa.part when i replace string_agg it's return does not exit, need to enable string_agg ..?i think is predefined right On Thu, Jul 24, 2014 at 7:47 PM, Ramesh T wrote: > postgres 9.3 > > > On Thu, Jul 24,

Re: [GENERAL] tab_to_sting

2014-07-24 Thread Ramesh T
SELECT tab_to_largestring(cast(array_agg(dhar_id)as t_varchar2_tab),':')FROM qa.dhar when i run above statement it's return can't convert bigint to the t_varchar2_tab for the above function,i think problem at the t_varchar2_tab .. please any help..?runs on postgres 9.3 thanks in advance, ramesh

Re: [GENERAL] tab_to_sting

2014-07-24 Thread Ramesh T
CREATE OR REPLACE TYPE t_varchar2_tab AS TABLE OF VARCHAR2(4000); / CREATE OR REPLACE FUNCTION tab_to_string (p_varchar2_tab IN t_varchar2_tab, p_delimiter IN VARCHAR2 DEFAULT ',') RETURN VARCHAR2 IS l_string VARCHAR2(32767);

Re: [GENERAL] tab_to_sting

2014-07-24 Thread Adrian Klaver
On 07/24/2014 07:46 AM, Ramesh T wrote: i ran the \df string_agg is their but retuns like ERROR: function string_agg(character varying) does not exist LINE 2: qa.tab_to_largestringcheck(cast(string_agg(part_num)as t_var... I should have explained what is going on here. If you do: production

Re: [GENERAL] tab_to_sting

2014-07-24 Thread Adrian Klaver
On 07/24/2014 07:46 AM, Ramesh T wrote: i ran the \df string_agg is their but retuns like ERROR: function string_agg(character varying) does not exist LINE 2: qa.tab_to_largestringcheck(cast(string_agg(part_num)as t_var... ^ HINT: No function matches th

Re: [GENERAL] tab_to_sting

2014-07-24 Thread Adrian Klaver
On 07/24/2014 07:22 AM, Ramesh T wrote: SELECT qa.tab_to_largestringcheck(cast(array_agg(part_id)as t_varchar2_tab),':')FROM qa.part when i replace string_agg it's return does not exit, My guess is if you look at the error message it is complaining about the type of argument passed in. Plea

Re: [GENERAL] tab_to_sting

2014-07-24 Thread Adrian Klaver
On 07/24/2014 07:11 AM, Ramesh T wrote: hi , i looked into that link ,when i run string_agg does not exist returns ,But i'm using function here not paasing table to the function only i'm passing column name and delimiter to the function from select statement please look into the my first post..

Re: [GENERAL] tab_to_sting

2014-07-24 Thread Adrian Klaver
On 07/24/2014 07:03 AM, Ramesh T wrote: HI, when i use string_agg function it returns string_agg(bigint) does'nt exist. when "array_string" function it's return can't convert bigint to the t_varchar2_tab. i have questiont_varcha2_tab type is available on

Re: [GENERAL] tab_to_sting

2014-07-24 Thread Adrian Klaver
On 07/24/2014 05:54 AM, Ramesh T wrote: i need this one please let me know.. thanks in advance , Previous post would have been better with the link :( http://stackoverflow.com/questions/43870/how-to-concatenate-strings-of-a-string-field-in-a-postgresql-group-by-query ramesh -- Adrian

Re: [GENERAL] tab_to_sting

2014-07-24 Thread Adrian Klaver
On 07/24/2014 05:54 AM, Ramesh T wrote: CREATE OR REPLACE TYPE t_varchar2_tab AS TABLE OF VARCHAR2(4000); / CREATE OR REPLACE FUNCTION tab_to_string (p_varchar2_tab IN t_varchar2_tab, p_delimiter IN VARCHAR2 DEFAULT ',') RETURN V

Re: [GENERAL] tab_to_sting

2014-07-23 Thread Adrian Klaver
On 07/23/2014 09:12 AM, Ramesh T wrote: Hi, SELECT hr.tab_to_largestring(CAST(COLLECT(cust_name) AS t_varchar2_tab)) AS employees FROM hr.customer when i run function for table column values to single row function name is hr.tab_to_largestring this code from oracle it return

Re: [GENERAL] tab_to_sting

2014-07-23 Thread hubert depesz lubaczewski
I don't know what collect actually does, but just guessing, I would say that you're looking for string_agg() depesz On Wed, Jul 23, 2014 at 6:12 PM, Ramesh T wrote: > Hi, > > SELECT hr.tab_to_largestring(CAST(COLLECT(cust_name) AS > t_varchar2_tab)) AS employees > FROM hr.custome

[GENERAL] tab_to_sting

2014-07-23 Thread Ramesh T
Hi, SELECT hr.tab_to_largestring(CAST(COLLECT(cust_name) AS t_varchar2_tab)) AS employees FROM hr.customer when i run function for table column values to single row function name is hr.tab_to_largestring this code from oracle it return like function collect(character varying)