数据库:Oralce 11g
Cloud版本:6.0+补丁
报错内容:ORA-00942: table or view does not exist
总部大神,针对Oracle数据库,简单账表的取数SQL要怎么构建!谢谢!
public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName)
{
// string strSQL = @"/*dialect*/Insert into {0}
// select t1.FBILLNO,t2.FSEQ,t1.FDATE,t1.FSUPPLIERID,t2.FMATERIALID,
// FQTY,t3.FPRICE,t3.FTAXRATE,t3.FTAXPRICE,t3.FAMOUNT,t3.FTAXAMOUNT,{1}
// from T_PUR_POORDER t1
// inner join T_PUR_POORDERENTRY t2 on t1.FID=t2.FID
//inner join T_PUR_POORDERENTRY_F t3 on t2.FID=t3.FID";
// KSQL_SEQ = string.Format(KSQL_SEQ, "t1.FID asc");
// strSQL = string.Format(strSQL, this.KSQL_SEQ, tableName);
StringBuilder sb = new StringBuilder();
sb.Append("/*dialect*/Create table ");
sb.Append(tableName);
sb.Append("( FIbegin number(28,2) default 0,");
sb.Append(" fiytd number(28,2) default 0,");
sb.Append(" fidebit number(28,2) default 0,");
sb.Append(" ficytd number(28,2) default 0,");
sb.Append(" ficredit number(28,2) default 0,");
sb.Append(" fibal number(28,2) default 0);");
//sb.Append("( FIbegin number(28,2) default 0,");
//sb.Append("( FIbegin number(28,2) default 0,");
sb.Append("Insert into ");
sb.Append(tableName);
sb.Append(@" select FIbegin,fiytd,fidebit,ficytd,ficredit,fibal
from tc_t_interest i
inner join tc_t_fee e
on i.ffinaid = e.ffinaid and i.FISr = 1 and e.fisr = 1; ");
sb.Append(@" select FIbegin,fiytd,fidebit,ficytd,ficredit,fibal from ");
sb.Append(tableName);
//sb.Append(@"select FIbegin,fiytd,fidebit,ficytd,ficredit,fibal,
// fdidays, fdidiag, fdibegin, fdiytd, fdidebit, fdicredit, fdicytd, fdibal,
// ffbegin, ffdytd, ffdeb, ffcytd, ffcre, ffbal,
// ffdays, fdfdate, fdfdays, fdfra, fdfdiag, fdfbegin, fdfytd, fdfdeb, fdfcre, fdfcytd, fdfbal
// from tc_t_interest i
// inner join tc_t_fee e
// on i.ffinaid = e.ffinaid and i.FISr = 1 and e.fisr = 1 ");
string StrSql = sb.ToString().Replace("\r\n","");
您的鼓励与嘉奖将成为创作者们前进的动力,如果觉得本文还不错,可以给予作者创作打赏哦!
请选择打赏金币数 *