diff --git a/Oracle/or_query_table_date.go b/Oracle/or_query_table_date.go index af79b93214a8abfc2fb5005b13c551a14e9b4e66..49cb632d0610ee6ebb84288365af7d7cd9072b58 100644 --- a/Oracle/or_query_table_date.go +++ b/Oracle/or_query_table_date.go @@ -191,7 +191,7 @@ func (or *QueryTable) TableRows(db *sql.DB, logThreadSeq int64) (uint64, error) dispos := dataDispos.DBdataDispos{DBType: DBType, LogThreadSeq: logThreadSeq, Event: Event, DB: db} vlog = fmt.Sprintf("(%d) [%s] Start querying the statistical information of table %s.%s in the %s database and get the number of rows in the table", logThreadSeq, Event, or.Schema, or.Table, DBType) global.Wlog.Debug(vlog) - strsql = fmt.Sprintf("exec dbms_stats.gather_table_stats('%s','%s');", or.Schema, or.Table) + strsql = fmt.Sprintf("BEGIN dbms_stats.gather_table_stats('%s','%s');END;", or.Schema, or.Table) dispos.DBSQLforExec(strsql) strsql = fmt.Sprintf("select num_rows as \"tableRows\" from dba_tables where owner='%s' and table_name='%s'", or.Schema, or.Table) if dispos.SqlRows, err = dispos.DBSQLforExec(strsql); err != nil {