Skip site navigation (1) Skip section navigation (2)

use of %TYPE

From: Dennis Gearon <gearond(at)cvc(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: use of %TYPE
Date: 2003-02-27 22:44:30
Message-ID: WTKHGBB9764Y2JG610465F0S9704IE.3e5e94ce@cal-lab (view raw or flat)
Thread:
Lists: pgsql-general
Can I use %TYPE in a function definition a la:
=============================================================================
CREATE OR REPLACE FUNCTION add_usr ( Usrs.first_name%TYPE,
                                     Usrs.middle_name%TYPE,
                                     Usrs.sur_name%TYPE,
                                     Usrs.sur_name_extra%TYPE,
                                     Gens.gen%TYPE,
                                     Emails.email%TYPE,
                                     UsrEmailTypes.usr_email_type%TYPE )
RETURNS BOOLEAN AS '
    DECLARE
	var_first_name      ALIAS FOR $1;
	var_middle_name     ALIAS FOR $2;
	var_sur_name        ALIAS FOR $3;
	var_sur_name_extra  ALIAS FOR $4;
	var_gen             ALIAS FOR $5;
	var_email_addr      ALIAS FOR $6;
	var_email_addr_type ALIAS FOR $7;
    BEGIN
        RETURN ''f'';
    END;
' LANGUAGE 'plpgsql';

=============================================================================

Also, does pgsql keep case in the table and column names? phpPgAdmin shows no case on tables I 
created with case.





Responses

pgsql-general by date

Next:From: Dennis GearonDate: 2003-02-28 00:46:03
Subject: Using %TYPE in function defs
Previous:From: John GrayDate: 2003-02-27 22:40:44
Subject: Re: XML in PostgreSQL

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group