Форум OlegON > Программы и оборудование для автоматизации торговли > Системы автоматизации торговли > Супермаг Плюс (Супермаг 2000)

В какой таблице, в каком столбике хранятся "Состав"? : Супермаг Плюс (Супермаг 2000)

20.04.2024 7:58


04.03.2015 11:40
Mtirt
 
Правда лучше сделать подзапросом...
Код:
SELECT (select i.propval from SUPERMAG.SMCARDPROPERTIES i where i.article=t.article and i.propid='Sys.Composition'), t.ARTICLE, t.NAME, t.COUNTRY, t.UNITNAME,
 t.RUBSUM||','||t.KOPSUM||' р.' PRICE, 
 t.BARCODE, t.QTYPRINT, 
decode(t.PLU,null,'','Весы: '||t.PLU) PLU,
(select supermag.russianspell.PriceCardString(0,p.SavedPrice)||','||supermag.russianspell.PriceCardString(2,p.SavedPrice)||' р.'
FROM supermag.SMPrices p
where p.Article=t.Article
and t.Article=i.Article 
and p.StoreLoc=:pLoc
and p.PriceType=:pPriceType
and p.SavedPrice is not null) OldPrice
FROM SUPERMAG.SVPRICECARD t
order by 1
04.03.2015 11:45
[+kliN+]
 
Пишет - не верное имя\номер переменной
Код:
2015.03.04 (Wednesday) 13:44:36
----- Прерывание работы программы -----
сообщение: "Неправильный результат из-за исключения, возникшего во время операции.  См. описание исключения в InnerException."
исключение: System.Reflection.TargetInvocationException
источник: System
метод: Void RaiseExceptionIfNecessary()
   в System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
   в Sm.Core.RunWorkerCompletedEventArgs`1.get_Result()
   в Sm.FastReports.Domain.FastReportDomainPanel.<>c__DisplayClass2.<RunSingleReport>b__0(Object sender, RunWorkerCompletedEventArgs`1 e)
----- Причина исключения, уровень вложения 1 -----
сообщение: "ORA-01036: неверное имя/номер переменной
"
исключение: System.Data.OracleClient.OracleException
источник: Sm.BusinessServer
данные:   соединено с: База даных=VMARKET; Пользователь=npa
   текст команды: SELECT i.PROPVAL, t.ARTICLE, t.NAME, t.COUNTRY, t.UNITNAME,
 t.RUBSUM||','||t.KOPSUM||' р.' PRICE, 
 t.BARCODE, t.QTYPRINT, 
decode(t.PLU,null,'','Весы: '||t.PLU) PLU,
(select supermag.russianspell.PriceCardString(0,p.SavedPrice)||','||supermag.russianspell.PriceCardString(2,p.SavedPrice)||' р.'
FROM supermag.SMPrices p
where p.Article=t.Article
and t.Article=i.Article 
and p.StoreLoc=:pLoc
and p.PriceType=:pPriceType
and p.SavedPrice is not null) OldPrice
FROM SUPERMAG.SVPRICECARD t, SUPERMAG.SMCARDPROPERTIES i
where t.article=i.article and i.propid='Sys.Composition'
order by 1
   тип команды: Text
   параметры: pLoc=«2»; pPriceType=«0»; MyArticle=«013478»
метод: 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.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, List`1 commonParameters, List`1 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)
04.03.2015 11:50
Mtirt
 
А откуда там взялся MyArticle=«013478»? И как он в запросе участвует???
04.03.2015 12:36
[+kliN+]
 
Исправил, заработало :)
04.03.2015 12:37
Mtirt
 
Только поправь хотя бы запрос, так как я его чуть раньше поправила...
А то будут выводиться только те карточки, у которых есть состав.
04.03.2015 14:15
[+kliN+]
 
все в порядке, печатаются даже те у которых нет состава.
Огромное спасибо :)
29.04.2015 09:39
[+kliN+]
 
Столкнулся с нюансом, помогите пожалуйста поправить. Если в карточке товара в описании заполнено не только поле "Состав", но и какие либо другие ("Аннотация" и\или "Торговая марка"), то на ценнике печатается только то, что забито в поле состав.
из запроса убрал
Цитата:
and i.propid='Sys.Composition'
В таком состоянии, если заполнено только одно поле, то оно отображается на ценнике. Если полей несколько, то появляется ошибка.

Цитата:
2015.04.29 (Wednesday) 11:28:44
----- Прерывание работы программы -----
сообщение: "Неправильный результат из-за исключения, возникшего во время операции. См. описание исключения в InnerException."
исключение: System.Reflection.TargetInvocationException
источник: System
метод: Void RaiseExceptionIfNecessary()
в System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
в Sm.Core.RunWorkerCompletedEventArgs`1.get_Result()
в Sm.FastReports.Domain.FastReportDomainPanel.<>c__DisplayClass2.<RunSingleReport>b__0(Object sender, RunWorkerCompletedEventArgs`1 e)
----- Причина исключения, уровень вложения 1 -----
сообщение: "ORA-01427: single-row subquery returns more than one row
"
исключение: System.Data.OracleClient.OracleException
источник: Sm.BusinessServer
данные: соединено с: База даных=CC; Пользователь=npa
текст команды: select
(select i.propval from SUPERMAG.SMCARDPROPERTIES i where i.article=t.article),
t.article,
replace(t.name, chr(9), ' ') as name,
t.cardcomment,
t.Country,
t.price,
t.unitname,
t.qty,
t.qtyprint,
t.rubsum,
t.rubname,
t.kopsum,
t.kopname,
t.priceshort,
t.pricefull,
t.PLU,

supermag.Rep_GetBarCode(t.article, -1, 1) as BarCode,
supermag.Rep_GetBarCode(t.article, -1, 0) as BarCode_Str,
(select tt.name from supermag.svcarddefproducers tt where tt.article = t.article) as Manufacturer,
supermag.Rep_GetBarCodeSub(t.Article, 1, 4, '0') as ShortBarCode
FROM supermag.svpricecard t


order by 1
тип команды: 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, List`1 commonParameters, List`1 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)
29.04.2015 09:40
Mtirt
 
Логично. Надо не условие убирать, а перечислять все те, которые нужны и объединять как-то их содержимое.
29.04.2015 09:45
[+kliN+]
 
как они в базе обозначаются?
29.04.2015 09:50
Mtirt
 
Разделы - Настройка - Справочники.
Карточки - Доп.характеристики товара.
Графа "Ид."
Часовой пояс GMT +3, время: 07:58.

Форум на базе vBulletin®
Copyright © Jelsoft Enterprises Ltd.
В случае заимствования информации гипертекстовая индексируемая ссылка на Форум обязательна.