ORA-01489:字符串连接的结果太长
下面的sql查询用于从数据库中提取数据作为管道分隔,并将其假脱机到unix上的文本文件
select a||'|'||b||'|'||c||'|'||d from table
union
select a||'|'||b||'|'||c||'|'||d from table
Run Code Online (Sandbox Code Playgroud)
有时会出现ORA错误ORA-01489:字符串连接的结果太长
如果选择超过4000限制,这看起来就像发生一样
我尝试使用to_clob,但这只适用于"union all"
有没有办法可以解决这个问题
我们有一个Java应用程序,可定期将行插入Oracle DB中。这是一个多线程应用程序。禁止一个的所有线程都会定期卡住。我们正在考虑升级Oracle JDBC驱动程序,但我感觉它可能会再次出现。只是想获取一些有关我们的代码或其他错误的信息。我既有stacktrace,也有下面的代码。我们在线程信息中看到定期锁定。请向我们提供一些有关我可能会出错的信息。
- - 码 - -
LogEventBatchPreparedStatementUpdater statementUpdater = new LogEventBatchPreparedStatementUpdater(logEvents);
// _jdbcTemplate.batchUpdate(INSERT_SQL, statementUpdater);
Connection connection = null;
PreparedStatement preparedStatement = null;
try
{
connection = _dataSource.getConnection();
connection.setAutoCommit(false);
preparedStatement = connection.prepareStatement(INSERT_SQL);
for (int i = 0; i < statementUpdater.getBatchSize(); i++)
{
statementUpdater.setValues(preparedStatement, i);
preparedStatement.addBatch();
}
preparedStatement.executeBatch();
connection.commit();
}
catch (SQLException e)
{
_Log.error("Error inserting log line batch",e );
}
finally
{
try
{
preparedStatement.close();
connection.close();
}
catch (SQLException e)
{
_Log.error("Error inserting log line batch",e );
}
} …Run Code Online (Sandbox Code Playgroud) 因此,我正在初始化这些实例并使用类中的方法来修改值。当我在修改它们的方法中打印值时,它们会正确打印,但是当它们被传递给“toString”方法时,它们会打印初始值而不是修改后的值。
package com.meritamerica.assignment1;
public class AccountHolder {
/** Bank Account Information */
public String firstName, middleName, lastName, ssn;
public double checkingAccountOpeningBalance, savingsAccountOpeningBalance;
/** Default Constructor */
AccountHolder(){
}
/** Custom Constructor */
AccountHolder
(String firstName,
String middleName,
String lastName,
String ssn,
double checkingAccountOpeningBalance,
double savingsAccountOpeningBalance)
{
this.firstName = firstName;
this.middleName = middleName;
this.lastName = lastName;
this.ssn = ssn;
this.checkingAccountOpeningBalance = checkingAccountOpeningBalance;
this.savingsAccountOpeningBalance = savingsAccountOpeningBalance;
}
/** Getters and Setters */
public String getFirstName() {
return this.firstName;
}
public void setFirstName(String …Run Code Online (Sandbox Code Playgroud)