From 7a69d627750037ee2604a19ae45004568b93476e Mon Sep 17 00:00:00 2001 From: "S.Listl" <S.Listl@SLISTL.aditosoftware.local> Date: Thu, 30 Jan 2020 12:11:12 +0100 Subject: [PATCH] Sql_lib documentation small fix --- process/Sql_lib/documentation.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/process/Sql_lib/documentation.adoc b/process/Sql_lib/documentation.adoc index 1ff588dee8..c3695fa62f 100644 --- a/process/Sql_lib/documentation.adoc +++ b/process/Sql_lib/documentation.adoc @@ -288,6 +288,8 @@ var costData = newSelect("CAMPAIGNCOSTID, CAMPAIGNSTEP_ID, CAMPAIGNSTEP.NAME, CA `.build()` has to be called before the statement is given to a `db.` method, like `db.cell()` or `db.table()`. But SqlBuilder also provides own functions for executing the query, if you use these, you don't need `.build()`. These methods are explained in the next chapter. Because of a more concise syntax and additional checks that are done in these functions, you should prefer them over the default `db.` methods. +NOTE: Because `.build()` returns an array, you can't use it in combination with `result.string()`. + `.toString()` is for cases where you need the query as string, but you should prefer `.build()` whenever possible. Processes like the "conditionProcess" in a dbRecordContainer and the "expression" from a dbRecordContainer field require a string as result, so you should use it there. If `result.string()` is used, you can omit the `.toString()`, since it would then be called implicitly. TIP: `.toString()` can be useful for logging, as you get an easy to read SQL string. -- GitLab