Greetings! I am trying to avoid the old problem of inserting a 40
character string into a 20 character field. However, I'd like to avoid
hard-coding the acceptable length (20). Is there a way to say "cast to
the same type as a given column"? E.g., if I have tables Long and
Short:
CREATE TABLE Lo
Greetings! I am trying to avoid the old problem of inserting a 40
character string into a 20 character field. However, I'd like to avoid
hard-coding the acceptable length (20). Is there a way to say "cast to
the same type as a given column"? E.g., if I have tables Long and
Short:
CREATE TABLE Lon
On Wed, Dec 16, 2009 at 7:20 PM, Tom Lane wrote:
> Really? Works for me, in everything back to 7.3.
>
I must be missing something, because this function fails:
CREATE OR REPLACE FUNCTION insertShort()
RETURNS VOID AS
$BODY$
DECLARE
s Short.shortCol%TYPE;
BEGIN
SELECT longCol I