Permalink
Browse files

null safe concat operator for varchar2 and nvarchar2

  • Loading branch information...
okbob committed Nov 28, 2018
1 parent 84150a6 commit 9538afcf4a8f162f44857874335154aef13bc412
Showing with 26 additions and 0 deletions.
  1. +13 −0 orafce--3.6--3.7.sql
  2. +13 −0 orafce--3.7.sql
@@ -20,3 +20,16 @@ LANGUAGE sql IMMUTABLE STRICT;
COMMENT ON FUNCTION oracle.sessiontimezone() IS 'Ruturns session time zone';
COMMENT ON FUNCTION oracle.dbtimezone() IS 'Ruturns server time zone (orafce.timezone)';
CREATE FUNCTION concat2(varchar2, varchar2)
RETURNS varchar2 AS $$
SELECT pg_catalog.concat($1::text, $2::text)
$$ LANGUAGE sql;
CREATE FUNCTION concat2(nvarchar2, nvarchar2)
RETURNS varchar2 AS $$
SELECT pg_catalog.concat($1::text, $2::text)
$$ LANGUAGE sql;
CREATE OPERATOR || (function = concat2, leftarg = varchar2, rightarg = varchar2);
CREATE OPERATOR || (function = concat2, leftarg = nvarchar2, rightarg = nvarchar2);
@@ -2483,6 +2483,19 @@ UPDATE pg_proc
SET protransform=(SELECT oid FROM pg_proc WHERE proname='varchar2_transform')
WHERE proname='nvarchar2';
CREATE FUNCTION concat2(varchar2, varchar2)
RETURNS varchar2 AS $$
SELECT pg_catalog.concat($1::text, $2::text)
$$ LANGUAGE sql;
CREATE FUNCTION concat2(nvarchar2, nvarchar2)
RETURNS varchar2 AS $$
SELECT pg_catalog.concat($1::text, $2::text)
$$ LANGUAGE sql;
CREATE OPERATOR || (function = concat2, leftarg = varchar2, rightarg = varchar2);
CREATE OPERATOR || (function = concat2, leftarg = nvarchar2, rightarg = nvarchar2);
/* PAD */
/* LPAD family */

0 comments on commit 9538afc

Please sign in to comment.