Search Postgresql Archives

Re: Calling function from VFP changes character field to Memo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 public.testfunction(
     )
     RETURNS TABLE
     (
         Firstname character(30)
     )
     LANGUAGE 'plpgsql'


AS $BODY$
BEGIN
     RETURN QUERY SELECT p.cFirstName FROM patients p;

In the first query the field name is FirstName not cFirstName.

Is this a typo or are they different fields?

END;
$BODY$;

And I call:

SELECT * FROM public.testFunction();

SELECT firstname from FROM public.testFunction();


Then FirstName returns as a Memo field (similar to a Text field).

Any idea what I need to do to get it to return the character(30) type?



--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux