Skip to content

Commit

Permalink
Update as.character
Browse files Browse the repository at this point in the history
Ajout d'un argument pour le nombre chars
Par défaut 255
Corrige le bug
  • Loading branch information
rplsmn committed Oct 14, 2024
1 parent 665eedd commit c898924
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/backend-teradata.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ sql_translation.Teradata <- function(con) {
sql_expr(CAST(!!x %as% DECIMAL(12L, !!digits)))
},
as.double = sql_cast("FLOAT"),
as.character = sql_cast("VARCHAR(MAX)"),
as.character = function(x, nchar = 255L) {
nchar <- vctrs::vec_cast(nchar, integer())
sql_expr(CAST(!!x %as% VARCHAR(!!nchar)))
},
as.Date = teradata_as_date,
log10 = sql_prefix("LOG"),
log = sql_log(),
Expand Down

0 comments on commit c898924

Please sign in to comment.