11GR2 ......我想为每个表获取 Alter 语句并运行结果脚本以使两个表相同。但是我的结果如下所示如何使每个 Alter 语句以 ; 结尾 分号,看起来像我的结果?我认为问题是为每个表制作alter语句并在每个表之后放置终止符,而不是放置每个alter语句;半列终止符......有什么想法吗?
我的代码:
myCommand = "select DBMS_METADATA_DIFF.COMPARE_ALTER('TABLE','GM_X','GM_X','SCOTT','GARY') from dual";
using (OracleCommand Command = new OracleCommand(myCommand, conn1))
{
using (OracleDataReader reader = Command.ExecuteReader())
{
reader.Read();
string[] split = reader[0].ToString().Trim().Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
foreach (string line in split)
{
RichTextBox1.AppendText(reader[0].ToString().Trim() + ";" + Environment.NewLine);
}
结果;
ALTER TABLE " TABLE_NAME_1" MODIFY ("INVH" VARCHAR2(15));
ALTER TABLE " TABLE_NAME_2" MODIFY ("REODE" VARCHAR2(15));
ALTER TABLE " TABLE_NAME_3" MODIFY ("CUST" NOT NULL ENABLE)
ALTER TABLE " TABLE_NAME_3" MODIFY ("CODE" VARCHAR2(14))
ALTER TABLE " TABLE_NAME_3" MODIFY ("CODE" NOT NULL ENABLE)
ALTER TABLE " TABLE_NAME_3" MODIFY ("E_CODE" NOT NULL ENABLE)
ALTER TABLE " TABLE_NAME_3" MODIFY ("_GR2" NOT NULL ENABLE);
我想要这个结果:
ALTER TABLE " TABLE_NAME_1" MODIFY ("INVH" VARCHAR2(15));
ALTER TABLE " TABLE_NAME_2" MODIFY ("REODE" VARCHAR2(15));
ALTER TABLE " TABLE_NAME_3" MODIFY ("CUST" NOT NULL ENABLE);
ALTER TABLE " TABLE_NAME_3" MODIFY ("CODE" VARCHAR2(14));
ALTER TABLE " TABLE_NAME_3" MODIFY ("CODE" NOT NULL ENABLE);
ALTER TABLE " TABLE_NAME_3" MODIFY ("E_CODE" NOT NULL ENABLE);
ALTER TABLE " TABLE_NAME_3" MODIFY ("_GR2" NOT NULL ENABLE);