From b0d7224f590b5b28e44e02eb05272a1e26373948 Mon Sep 17 00:00:00 2001 From: Jeff Godin Date: Thu, 13 Feb 2014 15:26:25 -0500 Subject: [PATCH] Fix issue with change in copy "floating" datatype In recent versions of Evergreen, asset.copy.floating changed from a bool to an int, which results in an error like the following: operator does not exist: integer = boolean SELECT CASE floating WHEN TRUE THEN 'Y' ELSE NULL END FROM a... This change attempts to accommodate this change in datatype in a backward-compatible way. Signed-off-by: Jeff Godin Signed-off-by: Galen Charlton --- collectionHQ/functions.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collectionHQ/functions.sql b/collectionHQ/functions.sql index 0cea710..52f1e8c 100644 --- a/collectionHQ/functions.sql +++ b/collectionHQ/functions.sql @@ -128,7 +128,7 @@ CREATE OR REPLACE FUNCTION collectionHQ.write_item_rows_to_stdout (TEXT, INT) RE WHERE id = lms_bib_id; SELECT collectionHQ.attempt_price(ac.price::TEXT), barcode, ac.status, REPLACE(create_date::DATE::TEXT, '-', ''), - CASE floating WHEN TRUE THEN 'Y' ELSE NULL END + CASE WHEN floating::int > 0 THEN 'Y' ELSE NULL END INTO price, bar_code, status, date_added, rotating_stock FROM asset.copy ac WHERE id = item; -- 2.11.0