This is an automated email from the ASF dual-hosted git repository.
mxmanghi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git
The following commit(s) were added to refs/heads/master by this push:
new 55ddc2b fix SQL insert statement arguments
55ddc2b is described below
commit 55ddc2bc1cf9e676a1c21bb6748ef8653aa85430
Author: Massimo Manghi <[email protected]>
AuthorDate: Tue Oct 7 00:26:42 2025 +0200
fix SQL insert statement arguments
---
rivet/packages/dio/dio_Tdbc.tcl | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/rivet/packages/dio/dio_Tdbc.tcl b/rivet/packages/dio/dio_Tdbc.tcl
index b01fd4e..d34cfcb 100644
--- a/rivet/packages/dio/dio_Tdbc.tcl
+++ b/rivet/packages/dio/dio_Tdbc.tcl
@@ -119,7 +119,7 @@ namespace eval DIO {
#
# build_insert_query --
#
- # Override ::DIO::build_insert_query method taking advantage of
+ # Override ::DIO::build_insert_query method taking advantage of
# the named parameters feature of TDBC SQL statements objects
#
@@ -136,11 +136,19 @@ namespace eval DIO {
foreach field $fields {
if {![info exists array($field)]} { continue }
lappend vars "$field"
+
+ # we reformat the fields evaluating through the "special
fields formatter"
+ # and assign their value to the array row_a which shadows
$arrayName in
+ # the caller frame
+
set row_a($field) [$special_fields_formatter $myTable $field
$row_a($field)]
- lappend named_pars_l ":row_a($field)"
+
+ # we don't evaluate an SQL statement, we build it for
evaluation by the caller
+
+ lappend named_pars_l ":${arrayName}($field)"
}
- return "insert into $myTable ([join $vars {,}]) VALUES ([join
$named_pars_l {,}])"
+ return "INSERT INTO $myTable ([join $vars {,}]) VALUES ([join
$named_pars_l {,}])"
}
#
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]