From f1ef50a2f1f13ec62c422cababcb77ea2bd8f666 Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Thu, 12 May 2022 08:04:16 +0200 Subject: [PATCH] Indicator-docs: Clarify when exception will be thrown Fixes #964 --- docs/indicators.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/indicators.md b/docs/indicators.md index 9963fc50..2645ad4f 100644 --- a/docs/indicators.md +++ b/docs/indicators.md @@ -52,9 +52,9 @@ else } ``` -The use of indicator variable is optional, but if it is not used and the result would be `i_null`, -then the exception is thrown. +The use of indicator variable is optional. However, if `sql.got_data() == true` and the result would be `i_null`, an exception is thrown if no indicator was used. This means that you should use indicator variables everywhere where the application logic (and database schema) allow the "attribute not set" condition. +If no data was fetched to begin with, the indicator would also be `i_null` (see above example) but no exception will be thrown. Thus, you will have to explicitly handle `sql.got_data() == false` (instead of relying on an exception being thrown), if you want to perform any special action in this event. ## Insert with NULL values