The Open Source Swiss Army Knife

/sql_servers/postgresql/pg_plpgsql/
/sql_servers/postgresql/pg_plpgsql/ + sub-categories
http://www.sirfsup.com/
web directory content
    
      

Not logged in
Chat Register Login
return to:  http:/www.sirfsup.com      /sql_servers   /postgresql   /pg_plpgsql 
Permalink: get_pass.sql
Title: add
article options : please login   |  raw source view  

CREATE or replace FUNCTION get_pass(text) RETURNS setof joe.passwd_type as
'
declare

        abc alias for $1;
        row passwd_type%ROWTYPE;
        r record;
begin
     for r in SELECT * from passwd where location like ''%''||   abc  || ''%''
                 loop
                row.uname = r.uname;
                row.pass = r.pass;
                row.location = r.location;
                return next row;
        end loop;
        return next row;
        return;

end
'
LANGUAGE 'plpgsql';
--create type passwd_type as (uname character varying(30), pass character varying(30), location character varying(255) );


Leave a Reply
Your Name:     anonymous
Your Email:
Website:  
Comments:

The author will be notified of your reply.
return to top