Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.

Commit acd3ae4

Browse files
committed
fix errors
1 parent ea0399f commit acd3ae4

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

public/miscellaneous/migrate-data.cfm

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,12 @@ function buildInsert(required string tableName, required query data, required nu
180180
// Convert SQL Server BIT (1/0) to boolean string for CockroachDB
181181
var boolVal = (isBoolean(val) && val) || (isNumeric(val) && val == 1);
182182
params[paramName] = { value: boolVal ? "true" : "false", cfsqltype: "cf_sql_varchar" };
183-
// Use a CAST in the SQL instead of parameterized value
184-
arrayAppend(placeholders, "(:#paramName#)::BOOLEAN");
183+
arrayAppend(placeholders, "CAST(:#paramName# AS BOOLEAN)");
184+
continue;
185+
} else if (isDate(val)) {
186+
// Convert timestamps to ISO string to avoid JDBC {ts '...'} escape format
187+
params[paramName] = { value: dateTimeFormat(val, "yyyy-MM-dd HH:nn:ss"), cfsqltype: "cf_sql_varchar" };
188+
arrayAppend(placeholders, "CAST(:#paramName# AS TIMESTAMP)");
185189
continue;
186190
} else {
187191
params[paramName] = { value: val };

0 commit comments

Comments
 (0)