Re: Calling function from VFP changes character field to Memo

2022-11-15 Thread Frank Cazabon
On 15/11/2022 2:58 pm, Adrian Klaver wrote: On 11/15/22 10:54 AM, Frank Cazabon wrote: On 15/11/2022 2:44 pm, Tom Lane wrote: Frank Cazabon writes: If however I have a function defined like this CREATE OR REPLACE FUNCTION public.testfunction(       )       RETURNS TABLE       (      F

Re: Calling function from VFP changes character field to Memo

2022-11-15 Thread Frank Cazabon
I don't think that's necessary, I'm 100% certain that it's VFP not able to interpret the size of what is coming back to it so it just gives it the biggest type it can. Thanks 15 Nov 2022 14:59:59 Ron : > On 11/15/22 12:54, Frank Cazabon wrote: >> >> On 15/11/2022 2:44 pm, Tom Lane wrote: >>>

Re: Calling function from VFP changes character field to Memo

2022-11-15 Thread Ron
On 11/15/22 12:54, Frank Cazabon wrote: On 15/11/2022 2:44 pm, Tom Lane wrote: Frank Cazabon writes: If however I have a function defined like this CREATE OR REPLACE FUNCTION public.testfunction(       )       RETURNS TABLE       (      Firstname character(30)       )       LANGUAGE 'plp

Re: Calling function from VFP changes character field to Memo

2022-11-15 Thread Adrian Klaver
On 11/15/22 10:54 AM, Frank Cazabon wrote: On 15/11/2022 2:44 pm, Tom Lane wrote: Frank Cazabon writes: If however I have a function defined like this CREATE OR REPLACE FUNCTION public.testfunction(       )       RETURNS TABLE       (      Firstname character(30)       )       LANGUAGE '

Re: Calling function from VFP changes character field to Memo

2022-11-15 Thread Frank Cazabon
On 15/11/2022 2:44 pm, Tom Lane wrote: Frank Cazabon writes: If however I have a function defined like this CREATE OR REPLACE FUNCTION public.testfunction(     )     RETURNS TABLE     (    Firstname character(30)     )     LANGUAGE 'plpgsql' AS $BODY$ BEGIN     RETURN QUERY

Re: Calling function from VFP changes character field to Memo

2022-11-15 Thread Frank Cazabon
On 15/11/2022 2:48 pm, Adrian Klaver wrote: On 11/15/22 10:43 AM, Frank Cazabon wrote: Please reply to list als. Ccing list Sorry about that, first time using this list and just assumed I was replying to the list and the list would then notify you SELECT * FROM public.testFunction(); SEL

Re: Calling function from VFP changes character field to Memo

2022-11-15 Thread Adrian Klaver
On 11/15/22 10:44 AM, Tom Lane wrote: Frank Cazabon writes: Any idea what I need to do to get it to return the character(30) type? There's no chance of getting back the "30" part with this structure, because function signatures do not carry length restrictions. What I expect is happening

Re: Calling function from VFP changes character field to Memo

2022-11-15 Thread Adrian Klaver
On 11/15/22 10:43 AM, Frank Cazabon wrote: Please reply to list als. Ccing list SELECT * FROM public.testFunction(); SELECT firstname from FROM public.testFunction(); This has the same result. How about?: SELECT firstname::varchar(30) from FROM public.testFunction(); Then FirstName r

Re: Calling function from VFP changes character field to Memo

2022-11-15 Thread Tom Lane
Frank Cazabon writes: > If however I have a function defined like this > CREATE OR REPLACE FUNCTION public.testfunction( >     ) >     RETURNS TABLE >     ( >    Firstname character(30) >     ) >     LANGUAGE 'plpgsql' > AS $BODY$ > BEGIN >     RETURN QUERY SELECT p.cFirstName FROM pa

Re: Calling function from VFP changes character field to Memo

2022-11-15 Thread Adrian Klaver
On 11/15/22 9:44 AM, Frank Cazabon wrote: Hi, I have a simple table Patients with one field FirstName of type character(30). If I SELECT FirstName From public.patients; I get back the expected character(30) field. If however I have a function defined like this CREATE OR REPLACE FUNCTION p

Calling function from VFP changes character field to Memo

2022-11-15 Thread Frank Cazabon
Hi, I have a simple table Patients with one field FirstName of type character(30). If I SELECT FirstName From public.patients; I get back the expected character(30) field. If however I have a function defined like this CREATE OR REPLACE FUNCTION public.testfunction(     )     RETURNS TABLE