Things under legendu
**
Things under legendu
It is suggested that you do not use paste to concatenate SQL queries, but rather have a complete SQL query with special marked variables and then substitute the marked variables with aproprivate values. This makes the SQL code much easier to understand. For example,
q = "
select
id,
name
from
table
where
id in (${IDs})
"You can then substitute ${IDs} with the right values.
Some people might against this due to injection attack,
but I really do not think this is a problem
as database users usually do not have write permissions to public tables.
I value readability more here.
JDBC¶
RJDBCis a usable but has some glitches.You cannot end a SQL statement with a semicolon when using
RJDBC. This means that you can send only a single query at a time when usingRJDBC, which is not efficient.RJDBC::dbWriteTablehas a bug for Teradata. As an workaround, you can generate SQL statement to insert data by yourself (which is tedious of course).RJDBC has a bug on schema when checking whether a table exists or not. For exampel, if there is a (non volatile) table
p_chdu_t.employees. ‘dbExistsTable(‘employees’)’ returnsTRUEbutdbExistsTable('p_chdu_t.employees')returnsFALSE. This impacts server functions in RJDBC.
ODBC¶
RODBC
teradataR