forked from idempiere/idempiere
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IDEMPIERE-4178 Replace NVL with Coalesce
- Loading branch information
Showing
22 changed files
with
130 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
-- IDEMPIERE-4178 Replace NVL with Coalesce | ||
CREATE or REPLACE FUNCTION nvl (anyelement, anyelement ) RETURNS anyelement | ||
LANGUAGE plpgsql | ||
IMMUTABLE | ||
AS $function$ | ||
BEGIN | ||
RETURN coalesce($1, $2); | ||
END; | ||
$function$ | ||
; | ||
|
||
CREATE or REPLACE FUNCTION nvl (numeric, integer ) RETURNS numeric | ||
LANGUAGE plpgsql | ||
IMMUTABLE | ||
AS $function$ | ||
BEGIN | ||
RETURN nvl($1, $2::numeric); | ||
END; | ||
$function$ | ||
; | ||
|
||
CREATE or REPLACE FUNCTION nvl (integer, numeric ) RETURNS numeric | ||
LANGUAGE plpgsql | ||
IMMUTABLE | ||
AS $function$ | ||
BEGIN | ||
RETURN nvl($1::numeric, $2); | ||
END; | ||
$function$ | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
SET SQLBLANKLINES ON | ||
SET DEFINE OFF | ||
|
||
-- IDEMPIERE-4178 Replace NVL with Coalesce | ||
-- PostgreSQL only | ||
SELECT register_migration_script('202002211000_IDEMPIERE-4178.sql') FROM dual | ||
; |
33 changes: 33 additions & 0 deletions
33
migration/i7.1z/postgresql/202002211000_IDEMPIERE-4178.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
-- IDEMPIERE-4178 Replace NVL with Coalesce | ||
CREATE or REPLACE FUNCTION nvl (anyelement, anyelement ) RETURNS anyelement | ||
LANGUAGE plpgsql | ||
IMMUTABLE | ||
AS $function$ | ||
BEGIN | ||
RETURN coalesce($1, $2); | ||
END; | ||
$function$ | ||
; | ||
|
||
CREATE or REPLACE FUNCTION nvl (numeric, integer ) RETURNS numeric | ||
LANGUAGE plpgsql | ||
IMMUTABLE | ||
AS $function$ | ||
BEGIN | ||
RETURN nvl($1, $2::numeric); | ||
END; | ||
$function$ | ||
; | ||
|
||
CREATE or REPLACE FUNCTION nvl (integer, numeric ) RETURNS numeric | ||
LANGUAGE plpgsql | ||
IMMUTABLE | ||
AS $function$ | ||
BEGIN | ||
RETURN nvl($1::numeric, $2); | ||
END; | ||
$function$ | ||
; | ||
|
||
SELECT register_migration_script('202002211000_IDEMPIERE-4178.sql') FROM dual | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.