Цитата: vdm ➤ Не буду вникать, что там у вас, скину свое видение запроса.
SQL код:
SELECT c.article, c.name
FROM supermag.smcard c,
(select ost.article, sum(ost.quantity) qty
from supermag.smgoods ost
group by ost.article
) ost,
(select distinct logi.article
from supermag.smcardsecuritylog logi
where logi.actioncode=1
and logi.eventtime>=:FirstDate
) clog,
(select distinct s.article
from supermag.smdocuments d, supermag.smspec s
where d.doctype in ('OR', 'WI', 'WO', 'IW', 'CS', 'CR', 'PO', 'PN', 'PE')
and s.doctype=d.doctype and s.docid=d.id
and d.createdat>=:FirstDate
and d.docstate>=2
) docs
WHERE c.accepted=1 AND c.datatype<>5
AND ost.article(+)=c.article
AND clog.article(+)=c.article
AND docs.article(+)=c.article
AND NVL(ost.qty, 0)=0
AND clog.article is null
AND docs.article is null
ORDER BY article
Спасибо за ответ вывел ошибку? это в LASTDATE? and logi.eventtime>=:+RepSqlText.ToSqlDate(sFirstDate)+ так грит ошибка в host/bind
SQL код:
сообщение: "ORA-01008: не все переменные привязаны"
исключение: Oracle.ManagedDataAccess.Client.OracleException
источник: Oracle Data Provider for .NET, Managed Driver
текст команды: SELECT c.article, c.name FROM supermag.smcard c, (select ost.article, sum(ost.quantity) qty from supermag.smgoods ost group by ost.article ) ost, (select distinct logi.article from supermag.smcardsecuritylog logi where logi.actioncode=1 and logi.eventtime>=:sFirstDate ) clog, (select distinct s.article from supermag.smdocuments d, supermag.smspec s where d.doctype in ('OR', 'WI', 'WO', 'IW', 'CS', 'CR', 'PO', 'PN', 'PE') and s.doctype=d.doctype and s.docid=d.id and d.createdat>=:sFirstDate and d.docstate>=2 ) docs WHERE c.accepted=1 AND c.datatype<>5 AND ost.article(+)=c.article AND clog.article(+)=c.article AND docs.article(+)=c.article AND NVL(ost.qty, 0)=0 AND clog.article is null AND docs.article is null ORDER BY article
тип команды: Text
метод: Boolean ReadBuffer(System.Collections.ObjectModel.ReadOnlyCollection`1[TRecord] ByRef)
в Sm.BusinessServer.BackgroundReaderBase`1.ReadBuffer(ReadOnlyCollection`1& result)
в Sm.FastReports.Server.FastReportBO.Sm.FastReports.Link.IFastReportBO.FillTableDataNext(BusinessOperation businessOperation, ReadOnlyCollection`1& dataTable)
в Sm.FastReports.SupermagFastReportConnection.<>c__DisplayClass8.<FillTableData>b__5(IFastReportBO bo)
в Sm.BusinessServer.LocalServer.LocalClient`1.Do(Action`1 action)
в Sm.FastReports.SupermagFastReportConnection.TransactedBusinessObject.Do(Action`1 action)
в Sm.FastReports.SupermagFastReportConnection.FillTableData(DataTable table, String selectCommand, CommandParameterCollection parameters)
в FastReport.Data.DataConnectionBase.FillTable(TableDataSource source)
в FastReport.Data.TableDataSource.LoadData(ArrayList rows)
в FastReport.Data.DataSourceBase.Init(Relation relation, String filter, SortCollection sort, Boolean useAllParentRows)
в FastReport.Data.DataSourceBase.Init(DataSourceBase parentData, String filter, SortCollection sort, Boolean useAllParentRows)
в FastReport.DataBand.InitDataSource()
в FastReport.Engine.ReportEngine.RunDataBand(DataBand dataBand)
в FastReport.Engine.ReportEngine.RunBands(BandCollection bands)
в FastReport.Engine.ReportEngine.RunReportPage(ReportPage page)
в FastReport.Engine.ReportEngine.RunReportPages()
в FastReport.Engine.ReportEngine.RunReportPages(ReportPage page)
в FastReport.Engine.ReportEngine.Run(Boolean runDialogs, Boolean append, ReportPage page)
в FastReport.Report.Prepare(Boolean append)
в Sm.FastReports.Domain.FastReportDomainModel.ExecuteReport(Report report, String reportFile, ReportParametersList commonParameters, ReportParametersList objectParameters, Int32 moduleRole, Int32 functionRole)
в Sm.FastReports.Domain.FastReportDomainPanel.Report_DoWork(Object sender, TaskWorkEventArgs`3 e)
в Sm.Core.TaskWorker`3.OnDoWork(DoWorkEventArgs e)
в Sm.Core.TaskWorkerBase.InternalBackgroundWorker.OnDoWork(DoWorkEventArgs e)
в System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)