Joined words : String Calculation « Postgre SQL « PostgreSQL






Joined words


postgres=# CREATE FUNCTION "compound_word" (text,text) RETURNS text AS '
postgres'#      DECLARE
postgres'#        -- defines an alias name for the two input values
postgres'#        word1 ALIAS FOR $1;
postgres'#        word2 ALIAS FOR $2;
postgres'#      BEGIN
postgres'#        -- displays the resulting joined words
postgres'#        RETURN word1 || word2;
postgres'#      END;
postgres'#   ' LANGUAGE 'plpgsql';
CREATE FUNCTION
postgres=#
postgres=# select compound_word('www.java2s.com',' Postgre SQL');
       compound_word
----------------------------
 www.java2s.com Postgre SQL
(1 row)

postgres=#
postgres=#
           
       








Related examples in the same category

1.Assigning a concatenated value to a string