以下是我必须在Spotfire中添加说明列的代码。它在Microsoft SQL中运行良好。我应该如何在Spotfire中编写它?
SELECT
v1."DateTime" AS "DISCRETELIVEDATETIME",
v1."TagName" AS "DISCRETELIVETAGNAME",
v1."Value" AS "DISCRETELIVEVALUE",
v2.Description AS "DESCRIPTION"
FROM
"Runtime"."dbo"."v_DiscreteLive" v1
INNER JOIN [Runtime].[dbo].Tag v2 ON v1.TagName = v2.TagName
以上是我制作的代码,它给出了以下错误。
Error message: Failed to execute data source query.
ImportException at Spotfire.Dxp.Data:
Failed to execute data source query. (HRESULT: 80131500)
Stack Trace:
at Spotfire.Dxp.Data.DataSourceConnection.ExecuteQuery2()
at Spotfire.Dxp.Data.DataFlow.Execute()
at Spotfire.Dxp.Data.DataFlow.DataFlowConnection.ExecuteQueryCore2()
at Spotfire.Dxp.Data.DataSourceConnection.ExecuteQuery2()
at Spotfire.Dxp.Data.Producers.SourceColumnProducer.<>c__DisplayClass11.<GetColumnsAndProperties>b__e()
at Spotfire.Dxp.Framework.ApplicationModel.Progress.ExecuteSubtask(String title, ProgressOperation operation)
at Spotfire.Dxp.Data.Producers.SourceColumnProducer.GetColumnsAndProperties(DataSourceConnection connection)
at Spotfire.Dxp.Data.Persistence.DataItem.PerformUpdate(SourceColumnProducer producer, DataSourceConnection connection)
at Spotfire.Dxp.Data.Persistence.DataItem.Update(SourceColumnProducer producer, DataSourceConnection connection)
at Spotfire.Dxp.Data.Persistence.DataPool.<LoadData>d__1.MoveNext()
at Spotfire.Dxp.Data.Producers.SourceColumnProducer.<Refresh>d__0.MoveNext()
at Spotfire.Dxp.Data.DataTable.<>c__DisplayClass66.<>c__DisplayClass69.<BeginRefresh>b__62()
at Spotfire.Dxp.Framework.DocumentModel.Node.Spotfire.Dxp.Framework.DocumentModel.INode.InternalTransaction(Executor executor)
at Spotfire.Dxp.Data.DataTable.<>c__DisplayClass66.<BeginRefresh>b__60()
at Spotfire.Dxp.Framework.Commands.CommandHistory.Transaction(Executor executor, Boolean visible, Boolean sticky, Guid stickyGuid)
at Spotfire.Dxp.Framework.Commands.CommandHistory.StickyTransaction(Guid guid, Executor executor)
at Spotfire.Dxp.Framework.DocumentModel.DocumentNode.StickyTransaction(Guid guid, Executor executor)
at Spotfire.Dxp.Framework.DocumentModel.DocumentNode.Spotfire.Dxp.Framework.DocumentModel.ITransactions.ExecuteStickyTransaction(Guid guid, Executor executor)
at Spotfire.Dxp.Data.DataTable.BeginRefresh(Boolean showDataLoadReport)
at Spotfire.Dxp.Data.DataTable.Refresh(Boolean showDataLoadReport)
at Spotfire.Dxp.Data.DataTableCollection.RefreshProducers(IEnumerable`1 tablesToRefresh, Boolean showDataLoadReport)
at Spotfire.Dxp.Data.DataTableCollection.Refresh(IEnumerable`1 tablesToRefresh)
at Spotfire.Dxp.Forms.Data.DataFormsUserActions.<>c__DisplayClassc.<RefreshData>b__a()
at Spotfire.Dxp.Forms.Application.FormsProgressService.ProgressThread.DoOperationLoop()
InformationModelException at Spotfire.Dxp.Data:
Failed to execute query: Incorrect syntax near 'v2'. (HRESULT: 80131500)
Stack Trace:
at Spotfire.Dxp.Data.InformationModel.InternalInformationModelManager.DataStream.GetNextBlock()
at Spotfire.Dxp.Data.InformationModel.InternalInformationModelManager.DataStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at Spotfire.Dxp.Internal.Utilities.SeekableStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.BinaryReader.FillBuffer(Int32 numBytes)
at System.IO.BinaryReader.ReadUInt16()
at Spotfire.Dxp.Data.Formats.Sbdf.SbdfSectionHeader.ReadSectionType(BinaryReader reader, SbdfSectionTypeId expectedType)
at Spotfire.Dxp.Data.Import.SbdfDataRowReader.DelayedInit()
at Spotfire.Dxp.Data.Import.InformationLinkDataSourceConnection.ExecuteQueryCore2()
at Spotfire.Dxp.Data.DataSourceConnection.ExecuteQuery2()
InformationModelServiceException at Spotfire.Dxp.Services:
Failed to execute query: Incorrect syntax near 'v2'. (HRESULT: 80131509)
Stack Trace:
at Spotfire.Dxp.Services.WebServiceBase`1.InvokeService[T](ServiceMethod`1 serviceMethod, ExceptionFactoryMethod exceptionFactoryMethod)
at Spotfire.Dxp.Data.InformationModel.InternalInformationModelManager.DataStream.GetNextBlock()
答案 0 :(得分:0)
我认为这里的问题是您正在更改sql查询。我认为你只能添加where子句。如果要添加列,则必须在信息设计器中对其进行建模。