We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As can be visualised with our new manual sections for different functions, and their emulations: https://www.jooq.org/doc/3.14/manual/sql-building/column-expressions/string-functions/space-function/
The SPACE(n) emulation is more complicated than it needs to be in many dialects:
SPACE(n)
-- FIREBIRD cast(rpad(' ', (char_length(' ') * 3), ' ') as varchar(4000)) -- CUBRID, H2, MARIADB, MYSQL, ASE, AURORA_MYSQL, DB2, SQLSERVER, SQLDATAWAREHOUSE, SYBASE, VERTICA space(3) -- INFORMIX, MEMSQL rpad(' ', (char_length(' ') * 3), ' ') -- HANA, INGRES, ORACLE, TERADATA rpad(' ', (length(' ') * 3), ' ') -- SQLITE "replace"(hex(zeroblob(3)), '00', ' ') -- HSQLDB, POSTGRES, AURORA_POSTGRES, COCKROACHDB, REDSHIFT repeat(' ', 3)
It uses repeat() internally, but with a literal(' '), whose length is known by jOOQ, so the length doesn't need to be calculated dynamically.
repeat()
literal(' ')
See also: https://twitter.com/Avalanche1979/status/1255089041005056001
The text was updated successfully, but these errors were encountered:
[#10135] Improve SPACE(n) emulation where possible
958857c
No branches or pull requests
As can be visualised with our new manual sections for different functions, and their emulations:
https://www.jooq.org/doc/3.14/manual/sql-building/column-expressions/string-functions/space-function/
The
SPACE(n)
emulation is more complicated than it needs to be in many dialects:It uses
repeat()
internally, but with aliteral(' ')
, whose length is known by jOOQ, so the length doesn't need to be calculated dynamically.See also: https://twitter.com/Avalanche1979/status/1255089041005056001
The text was updated successfully, but these errors were encountered: