From 3a2217253deca6adb680cfbca35e413c79c1e2bf Mon Sep 17 00:00:00 2001 From: PeggySchmidtMittenzwei <51525779+PeggySchmidtMittenzwei@users.noreply.github.com> Date: Mon, 21 Jul 2025 14:05:08 +0200 Subject: [PATCH 1/4] Update why-i-get-lua-error-decimal-expected-got-number.md --- .../why-i-get-lua-error-decimal-expected-got-number.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Database-Features/why-i-get-lua-error-decimal-expected-got-number.md b/Database-Features/why-i-get-lua-error-decimal-expected-got-number.md index 9d575f6a..30b93fc5 100644 --- a/Database-Features/why-i-get-lua-error-decimal-expected-got-number.md +++ b/Database-Features/why-i-get-lua-error-decimal-expected-got-number.md @@ -29,8 +29,9 @@ SELECT TEST.NUMBER_DECIMAL_UDF (a) FROM TEST.T; I get the following error message: -> [!CAUTION] -> [Code: 0, SQL State: 22001] Lua Error "decimal expected, got number" caught in script "TEST"."NUMBER_DECIMAL_UDF" at line 4 (Session: 1836005522647613440) +```sql +[Code: 0, SQL State: 22001] Lua Error "decimal expected, got number" caught in script "TEST"."NUMBER_DECIMAL_UDF" at line 4 (Session: 1836005522647613440) +``` ## The Error @@ -57,8 +58,9 @@ end * ctx.a / 10: Performs floating-point division in Lua. * DECIMAL(): Converts the floating-point result into an integer by rounding down -> [!TIP] -> Always use decimal() for calculations if you’re working with DECIMALs! +### Hint + +❗ Always use decimal() for calculations if you’re working with DECIMALs! ❗ ## References From b44211c5145460ab340b73f0aa5e02b2d74f4955 Mon Sep 17 00:00:00 2001 From: PeggySchmidtMittenzwei <51525779+PeggySchmidtMittenzwei@users.noreply.github.com> Date: Wed, 23 Jul 2025 16:56:46 +0200 Subject: [PATCH 2/4] Update Database-Features/why-i-get-lua-error-decimal-expected-got-number.md Co-authored-by: allipatev <58830344+allipatev@users.noreply.github.com> --- .../why-i-get-lua-error-decimal-expected-got-number.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Database-Features/why-i-get-lua-error-decimal-expected-got-number.md b/Database-Features/why-i-get-lua-error-decimal-expected-got-number.md index 30b93fc5..87fc1601 100644 --- a/Database-Features/why-i-get-lua-error-decimal-expected-got-number.md +++ b/Database-Features/why-i-get-lua-error-decimal-expected-got-number.md @@ -29,7 +29,7 @@ SELECT TEST.NUMBER_DECIMAL_UDF (a) FROM TEST.T; I get the following error message: -```sql +```text [Code: 0, SQL State: 22001] Lua Error "decimal expected, got number" caught in script "TEST"."NUMBER_DECIMAL_UDF" at line 4 (Session: 1836005522647613440) ``` From a591074533f2f58d5258b27d51bc262bea417775 Mon Sep 17 00:00:00 2001 From: PeggySchmidtMittenzwei <51525779+PeggySchmidtMittenzwei@users.noreply.github.com> Date: Wed, 23 Jul 2025 17:00:17 +0200 Subject: [PATCH 3/4] Update why-i-get-lua-error-decimal-expected-got-number.md --- .../why-i-get-lua-error-decimal-expected-got-number.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Database-Features/why-i-get-lua-error-decimal-expected-got-number.md b/Database-Features/why-i-get-lua-error-decimal-expected-got-number.md index 87fc1601..dec8185a 100644 --- a/Database-Features/why-i-get-lua-error-decimal-expected-got-number.md +++ b/Database-Features/why-i-get-lua-error-decimal-expected-got-number.md @@ -30,7 +30,8 @@ SELECT TEST.NUMBER_DECIMAL_UDF (a) FROM TEST.T; I get the following error message: ```text -[Code: 0, SQL State: 22001] Lua Error "decimal expected, got number" caught in script "TEST"."NUMBER_DECIMAL_UDF" at line 4 (Session: 1836005522647613440) +[Code: 0, SQL State: 22001] Lua Error "decimal expected, got number" caught in +script "TEST"."NUMBER_DECIMAL_UDF" at line 4 (Session: 1836005522647613440) ``` ## The Error @@ -58,12 +59,12 @@ end * ctx.a / 10: Performs floating-point division in Lua. * DECIMAL(): Converts the floating-point result into an integer by rounding down -### Hint +### 💡Hint💡 -❗ Always use decimal() for calculations if you’re working with DECIMALs! ❗ +* Always use decimal() for calculations if you’re working with DECIMALs! ## References -* [Exasol Lua Scripting: Decimal number handling](https://docs.exasol.com/db/latest/database_concepts/scripting/general_script_language.htm#TypesandValues) +* Documentation of [Exasol Lua Scripting: Decimal number handling](https://docs.exasol.com/db/latest/database_concepts/scripting/general_script_language.htm#TypesandValues) *We appreciate your input! Share your knowledge by contributing to the Knowledge Base directly in [GitHub](https://github.com/exasol/public-knowledgebase).* From 8d17211897043d7d27939e556e376b4553241501 Mon Sep 17 00:00:00 2001 From: PeggySchmidtMittenzwei <51525779+PeggySchmidtMittenzwei@users.noreply.github.com> Date: Wed, 23 Jul 2025 17:02:05 +0200 Subject: [PATCH 4/4] Update why-i-get-lua-error-decimal-expected-got-number.md --- .../why-i-get-lua-error-decimal-expected-got-number.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Database-Features/why-i-get-lua-error-decimal-expected-got-number.md b/Database-Features/why-i-get-lua-error-decimal-expected-got-number.md index dec8185a..df6550be 100644 --- a/Database-Features/why-i-get-lua-error-decimal-expected-got-number.md +++ b/Database-Features/why-i-get-lua-error-decimal-expected-got-number.md @@ -61,7 +61,7 @@ end ### 💡Hint💡 -* Always use decimal() for calculations if you’re working with DECIMALs! +* Always use decimal() for calculations if you’re working with DECIMALs! ## References