pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Frank Cazabon <frank.cazabon@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Calling function from VFP changes character field to Memo
Date: Tue, 15 Nov 2022 13:44:13 -0400
Message-ID: <fe531f0e-ff0f-9227-c879-b875dc1201d8@gmail.com> (raw)

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;
END;
$BODY$;

And I call:

SELECT * 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?

-- 

Frank.

Frank Cazabon






view thread (11+ messages)  latest in thread

Message-ID: <fe531f0e-ff0f-9227-c879-b875dc1201d8@gmail.com>
Permalink:  ../fe531f0e-ff0f-9227-c879-b875dc1201d8@gmail.com/
Also on:    postgresql.org/message-id/fe531f0e-ff0f-9227-c879-b875dc1201d8@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: frank.cazabon@gmail.com
  Subject: Re: Calling function from VFP changes character field to Memo
  In-Reply-To: <fe531f0e-ff0f-9227-c879-b875dc1201d8@gmail.com>
  References: <fe531f0e-ff0f-9227-c879-b875dc1201d8@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox